* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Source Sans 3", sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

html, body {
    height: 100%;
}

#wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Header */
header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 24px;
    margin-bottom: 5px;
    color:  #fff;
}

header p {
    font-size: 14px;
    opacity: 0.9;
}

header p a {
    color:  #fff;
}

/* Navigace */
nav {
    background: #34495e;
    padding: 0;
    overflow-x: auto;
}

nav a {
    display: inline-block;
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    transition: background 0.3s;
    white-space: nowrap;
}

nav a:hover {
    background: #1a252f;
}

nav a.logout {
    float: right;
    background: #e74c3c;
}

nav a.logout:hover {
    background: #c0392b;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: 30px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Formuláře */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Tlačítka */
button,
.btn {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.btn:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    margin-right: 5px;
}


.btnIcons {
    text-align: center;
}
.btn-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    color:  #34495e;
    margin: 0 5px;
}
.btnIcons .btn-icon {
    margin: 0 15px;
}
.btn-icon svg {
    width: 24px;
    height: 24px;
}

/* skrytý text */
.btn-icon .tooltip-text {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    white-space: nowrap;
    transition: opacity 0.2s ease;
    z-index: 10;
}

/* šipka tooltipu */
.btn-icon .tooltip-text::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* zobrazí při hoveru */
.btn-icon:hover .tooltip-text {
    opacity: 1;
}




/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.card .value {
    font-size: 32px;
    font-weight: bold;
    color: #3498db;
}

/* Tabulky */
table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

th {
    background: #2c3e50;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

td {
    padding: 4px 12px;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background: #f9f9f9;
}

tr.unpaid {
    background-color: #ffe0dd;
}

/* Zprávy */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

/* Stavy */
.zaplaceno {
    color: #27ae60;
    font-weight: bold;
}

.nezaplaceno {
    color: #e74c3c;
    font-weight: bold;
}

/* Přihlašovací stránka */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Nadpisy */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    margin-bottom: 15px;
    margin-top: 20px;
}

h2 {
    font-size: 28px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    text-align: center;
}

h3 {
    font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    nav a {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    nav a.logout {
        float: none;
        display: block;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================
   STYLY PRO FAKTURU
   ============================================ */

/* Kontejner faktury */
.faktura-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Žluté záhlaví */
.header-faktura {
    background: #FFD93D;
    padding: 20px;
    margin: -40px -40px 30px -40px;
    text-align: center;
}

.header-faktura h1 {
    margin: 0;
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

/* Grid pro dodavatele a odběratele */
.info-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 2fr;
    gap: 0px;
    margin-bottom: 30px;
}

.infÿ bo 唠翴  {
    font-size: 12px;
    color: #666;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    font-weight: bold;
}

.info-box p {
    margin: 3px 0;
    font-size: 14px;
    line-height: 1.5;
}

.info-box strong {
    font-weight: bold;
}

/* Grid pro detaily (bankovní účet, data, atd.) */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.detail-item {
    font-size: 13px;
}

.detail-item strong {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    font-weight: bold;
}

/* Tabulka položek faktury */
.faktura-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.faktura-table thead {
    background: #f5f5f5;
}

.faktura-table th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
    background: #f5f5f5;
    color: #333;
}

.faktura-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.faktura-table td:nth-child(2),
.faktura-table td:nth-child(4),
.faktura-table td:nth-child(5),
.faktura-table th:nth-child(2),
.faktura-table th:nth-child(4),
.faktura-table th:nth-child(5) {
    text-align: right;
}

/* Celková částka */
.faktura-total {
    text-align: right;
    font-size: 24px;
    font-weight: bold;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 3px solid #333;
}

/* QR kód a podpis */
.qr-podpis {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 40px;
    margin-top: 40px;
}

.qr-code {
    width: 150px;
    height: 150px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    border: 1px solid #ddd;
}

.podpis {
    text-align: right;
    padding-top: 50px;
}

.podpis-line {
    border-top: 1px solid #333;
    display: inline-block;
    min-width: 200px;
    margin-top: 50px;
}

/* Responsive pro fakturu */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .qr-podpis {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .podpis {
        text-align: center;
    }
}

/* Faktury Tabulky */
table.faTable {
}
table.faTable tr td.faClient {
  white-space: nowrap;
  overflow: hidden;
  max-width: 300px;
}
table.faTable tr td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.faTable tr td.faNum a {
    color:  #656565;
}
table.faTable tr th {
    font-size:  70%;
}
table.faTable tr th.faNum {
    min-width:  110px;
}




.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Plynulé scrollování na iOS */
    margin-top: 20px;
}

/* Na mobilech přidáme hint, že se dá scrollovat */
@media (max-width: 768px) {
    .table-wrapper {
        position: relative;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        border-radius: 5px;
    }
    
    .table-wrapper table {
        margin-top: 0;
    }
    
    /* Zmenšíme font na mobilech pro lepší čitelnost */
    .faTable {
        font-size: 14px;
    }
    
    .faTable th, .faTable td {
        padding: 8px 6px;
        white-space: nowrap;
    }
    
    .btn-small {
        font-size: 11px;
        padding: 4px 8px;
    }
}
