/* ============================================================
   Evidenční kniha vinaře – základní styly
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary:    #6b2d2d;
    --color-primary-lt: #8b4040;
    --color-accent:     #c8860a;
    --color-bg:         #f7f4f0;
    --color-surface:    #ffffff;
    --color-border:     #ddd0c4;
    --color-text:       #2c2218;
    --color-muted:      #7a6a5a;
    --color-success:    #2e7d32;
    --color-warning:    #e65100;
    --color-danger:     #c62828;
    --color-info:       #01579b;
    --radius:           4px;
    --shadow:           0 1px 4px rgba(0,0,0,.12);
    --font:             system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout --- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* --- Header --- */
.site-header {
    background: var(--color-primary);
    color: #fff;
    padding: 0 0;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.site-header .container {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 52px;
}
.site-logo {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; opacity: .9; }

/* --- Navigace --- */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.main-nav > a,
.nav-dropdown > span {
    color: rgba(255,255,255,.9);
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
}
.main-nav > a:hover,
.nav-dropdown:hover > span {
    background: var(--color-primary-lt);
    text-decoration: none;
    color: #fff;
}
.nav-dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 180px;
    z-index: 200;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a,
.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 8px 14px;
    color: var(--color-text);
    font-size: 13px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.5;
}
.dropdown-menu a:hover,
.dropdown-menu button:hover { background: var(--color-bg); text-decoration: none; }
.dropdown-menu--right { left: auto; right: 0; }
.dropdown-item-btn {
    display: block; width: 100%; padding: 8px 14px;
    color: var(--color-text); font-size: 13px;
    text-align: left; background: none; border: none;
    cursor: pointer; font-family: inherit; line-height: 1.5;
}

/* --- Obsah --- */
.site-main { padding: 24px 0 24px; }

/* --- Footer --- */
.site-footer {
    background: var(--color-primary);
    color: rgba(255,255,255,.7);
    font-size: 12px;
    text-align: center;
    padding: 7px 0;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

/* --- Nadpisy stránek --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }

/* --- Karty --- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 14px;
    background: #faf7f3;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-body { padding: 16px; }

/* --- Tabulky --- */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th, td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
th {
    background: #f0ebe4;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--color-muted);
}
tr:hover td { background: #fdfaf6; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Formuláře --- */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.form-control {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
    position: sticky;
    bottom: 18px;
    background: var(--color-surface);
    z-index: 10;
    box-shadow: 0 -3px 12px rgba(0,0,0,.18);
    border-radius: 8px 8px var(--radius) var(--radius);
}

/* --- Tlačítka --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn--primary  { background: var(--color-primary); color: #fff; }
.btn--accent   { background: var(--color-accent);  color: #fff; }
.btn--outline  { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn--danger   { background: var(--color-danger);  color: #fff; }
.btn--sm       { padding: 4px 9px; font-size: 12px; }
.btn:disabled, .btn[disabled] {
    background: #e0ddd9;
    color: #a09890;
    border-color: #d0ccc8;
    cursor: not-allowed;
    opacity: 1;
    pointer-events: auto;
}

/* --- Odznaky (badge) --- */
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge--success   { background: #e8f5e9; color: var(--color-success); }
.badge--warning   { background: #fff3e0; color: var(--color-warning); }
.badge--danger    { background: #ffebee; color: var(--color-danger); }
.badge--info      { background: #e3f2fd; color: var(--color-info); }
.badge--primary   { background: #f3e5e5; color: var(--color-primary); }
.badge--secondary { background: #f0ebe4; color: var(--color-muted); }

/* --- Soft-deleted řádky --- */
tr.row--deleted td {
    opacity: .45;
    text-decoration: line-through;
    text-decoration-color: var(--color-muted);
}
tr.row--deleted td .btn,
tr.row--deleted td .badge {
    text-decoration: none;
    opacity: .7;
}

/* --- Flash zprávy --- */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 4px solid;
}
.alert--success { background: #e8f5e9; border-color: var(--color-success); color: var(--color-success); }
.alert--error   { background: #ffebee; border-color: var(--color-danger);  color: var(--color-danger); }
.alert--warning { background: #fff3e0; border-color: var(--color-warning); color: var(--color-warning); }

/* --- Dashboard statistiky --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 11px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 4px;
}

/* --- Stránkování --- */
.pagination { display: flex; gap: 4px; margin-top: 16px; }
.pagination a {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 13px;
}
.pagination a.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* --- Detail DL seznam --- */
.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    font-size: 13px;
}
.detail-list dt {
    color: var(--color-muted);
    font-weight: 600;
    white-space: nowrap;
}
.detail-list dd {
    margin: 0;
}

/* --- Prázdný stav --- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-muted);
}
.empty-state p { margin-bottom: 12px; }
