/* Hordokovetes — Design System CSS */
/* Light, warm winery theme matching dashboard mockup */

/* -- Color Tokens -- */
:root {
    --gold: #b8924a;
    --gold-light: #d4b06a;
    --gold-dark: #8a6d35;
    --gold-bg: #faf6ef;
    --gold-border: #e8d5b0;
    --red-wine: #722f37;
    --white-wine: #e8d44d;
    --rose: #e8a0b4;
    --bg: #f5f0e8;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text: #3a3025;
    --text-light: #7a6f60;
    --text-muted: #a09888;
    --border: #e8d5b0;
    --success: #27ae60;
    --warning: #d4a017;
    --danger: #c0392b;
    --info: #2980b9;
    --header-bg: linear-gradient(135deg, #2c2118 0%, #3a2d1e 50%, #2c2118 100%);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--gold-dark); text-decoration: none; }
a:hover { color: var(--gold); }

/* -- Navigation -- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.nav-brand {
    color: var(--gold-light);
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-links a {
    color: #ccc;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: #fff;
    background: rgba(184, 146, 74, 0.25);
}

.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-user { color: var(--gold-light); font-size: 14px; }
.nav-logout { color: #ccc; font-size: 13px; }
.nav-logout:hover { color: #fff; }

/* -- User Dropdown -- */
.user-dropdown {
    position: relative;
}

.user-dropdown-trigger {
    background: none;
    border: 1px solid rgba(212,176,106,0.3);
    color: var(--gold-light);
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.user-dropdown-trigger:hover,
.user-dropdown.open .user-dropdown-trigger {
    background: rgba(184,146,74,0.2);
    border-color: var(--gold-light);
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 200;
    padding: 6px 0;
}

.user-dropdown.open .user-dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 18px;
    color: var(--text);
    font-size: 14px;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--gold-bg);
    color: var(--gold-dark);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

.dropdown-logout {
    color: var(--danger);
}

.dropdown-logout:hover {
    background: #fdf0ef;
    color: var(--danger);
}

/* -- Main Content -- */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* -- Cards -- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* -- Buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    border-color: var(--gold);
    background: var(--gold-bg);
    color: var(--gold-dark);
}

.btn-primary {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
    font-weight: 600;
}

.btn-primary:hover { background: var(--gold-light); color: #fff; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    font-weight: 600;
}
.btn-danger:hover { background: #a93226; color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-sm.active {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
}

/* -- Badges -- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-gold { background: var(--gold); color: #fff; }
.badge-red { background: var(--red-wine); color: #fff; }
.badge-success { background: var(--success); color: white; }
.badge-warning { background: var(--warning); color: #fff; }
.badge-danger { background: var(--danger); color: white; }
.badge-info { background: var(--info); color: #fff; }
.badge-muted { background: var(--gold-border); color: var(--text-light); }

/* -- Forms -- */
.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-light);
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 146, 74, 0.15);
}

.form-group.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}
.form-group.checkbox-group input[type="checkbox"] {
    width: auto;
    accent-color: var(--gold);
}

/* -- Login -- */
.login-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--gold-dark);
}

.login-form .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
    padding: 10px;
}

/* -- Volume Bar -- */
.volume-bar {
    height: 5px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin: 6px 0;
}

.volume-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.volume-bar-fill.red { background: var(--red-wine); }
.volume-bar-fill.white { background: var(--white-wine); }
.volume-bar-fill.rose { background: var(--rose); }
.volume-bar-fill.empty { background: #ccc; }

/* -- Filter Bar -- */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* -- Barrel Grid & Tiles -- */
.barrel-section { margin-bottom: 24px; }

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.barrel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.tile-link {
    text-decoration: none;
    color: inherit;
}

.barrel-tile {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    background: var(--bg-card);
    transition: all 0.2s;
    position: relative;
}

.barrel-tile:hover {
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(184,146,74,0.2);
    transform: translateY(-1px);
}

.barrel-empty {
    border-style: dashed;
    opacity: 0.6;
}

.barrel-buffer {
    border-color: var(--info);
    background: #f0f7ff;
}

.tile-number { font-weight: 700; font-size: 16px; color: var(--gold-dark); }
.floater-badge { color: var(--info); font-weight: 400; letter-spacing: -2px; font-size: 14px; cursor: default; }
.floater-badge-lg { font-size: 22px; }
.tile-wine { font-size: 10px; color: var(--text-light); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-volume { font-size: 10px; color: var(--text-light); margin-top: 3px; }

.tile-ready-icon, .tile-blocked-icon {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}
.tile-ready-icon { color: var(--success); }
.tile-blocked-icon { color: #e67300; }

/* -- Barrel Detail -- */
.barrel-detail { max-width: 600px; }

.barrel-header {
    margin-bottom: 16px;
}

.barrel-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

.back-link {
    font-size: 13px;
    color: var(--text-light);
}

.barrel-fill-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.barrel-fill-info h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }

.barrel-empty-info {
    border-style: dashed;
    opacity: 0.6;
}

.barrel-meta {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 16px;
}

.barrel-meta p { margin-bottom: 4px; }

/* -- Quick Actions -- */
.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* -- Events List -- */
.events-list { margin-top: 16px; }
.events-list h3 { font-size: 15px; margin-bottom: 8px; color: var(--text); font-weight: 600; }

.event-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    background: var(--gold-bg);
    border: 1px solid transparent;
}

.event-item:hover {
    border-color: var(--gold-border);
}

.event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.event-notes {
    font-size: 0.875rem;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
}

.event-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
    margin-left: auto;
    text-align: right;
    flex-shrink: 0;
}

.event-user { font-weight: 500; }
.event-time { color: var(--text-muted); font-size: 0.75rem; }

/* -- Bottom Sheet -- */
.bottom-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
}

.bottom-sheet-overlay.active { display: block; }

.bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    padding: 16px 24px 32px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 201;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

.bottom-sheet.active { display: block; }

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.bottom-sheet h3 {
    margin-bottom: 16px;
    color: var(--gold-dark);
}

/* -- Error -- */
.error-box {
    background: #fef5f5;
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.error-msg { color: var(--danger); font-size: 13px; }
.error-message {
    background: #fef5f5;
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    color: var(--danger);
    font-size: 14px;
}

.text-light { color: var(--text-light); }

/* -- Dashboard -- */
.dashboard { padding: 16px 0; }
.dashboard h1 { color: var(--text); font-size: 24px; font-weight: 600; margin-bottom: 8px; }

/* -- Task Queue -- */

.task-section {
    margin-bottom: 1.5rem;
}

.task-section .section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.section-danger { color: var(--danger); border-left: 3px solid var(--danger); }
.section-warning { color: var(--warning); border-left: 3px solid var(--warning); }
.section-default { color: var(--gold-dark); border-left: 3px solid var(--gold); }
.section-muted { color: var(--text-light); border-left: 3px solid var(--gold-border); }

.task-item {
    background: var(--card-bg);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.task-item-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.task-meta {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.task-barrel-link {
    color: var(--gold-dark);
    font-weight: 600;
    text-decoration: none;
}

.task-barrel-link:hover {
    text-decoration: underline;
}

.task-due {
    color: var(--text-light);
    font-size: 0.85rem;
}

.task-desc {
    color: var(--text);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-overdue-item {
    border-color: var(--danger);
    border-left: 3px solid var(--danger);
}

.task-overdue {
    color: var(--danger);
    font-weight: 600;
}

.task-blocked .task-item-inner {
    opacity: 0.6;
}

.task-completed .task-item-inner {
    opacity: 0.5;
    text-decoration: line-through;
}

.task-blocked-note {
    margin-top: 0.25rem;
    padding-left: 0.5rem;
}

.text-sm {
    font-size: 0.8rem;
}

.btn-complete {
    background: var(--success);
    color: #fff;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-complete:hover {
    background: #219653;
}

/* Barrel detail tasks section */
.barrel-tasks-section {
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--gold-bg);
    border-radius: 8px;
    border: 1px solid var(--gold-border);
}

.barrel-tasks-section h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--text);
}

/* ── Transfers ── */

.transfer-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.transfer-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: border-color 0.2s;
}

.transfer-item:hover {
    border-color: var(--gold);
}

.transfer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transfer-source {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gold-dark);
}

.transfer-arrow {
    color: var(--text-light);
}

.transfer-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.transfer-wine { color: var(--text); }
.transfer-volume { font-weight: 600; }

.transfer-detail {
    max-width: 600px;
}

.transfer-detail-header {
    margin-bottom: 1rem;
}

.transfer-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dest-section {
    background: var(--gold-bg);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.dest-section h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.dest-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gold-border);
    font-size: 0.9rem;
}

.dest-item:last-child {
    border-bottom: none;
}

.dest-barrel {
    font-weight: 700;
    color: var(--gold-dark);
    min-width: 3rem;
}

.transfer-summary {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.summary-line {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.summary-remaining {
    font-weight: 600;
    color: var(--gold-dark);
    font-size: 1rem;
}

/* ── Transfer Wizard Sections ── */

.transfer-section {
    background: var(--gold-bg);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.transfer-section h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Barrel selection grid in wizard */
.barrel-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 0.5rem;
}

.barrel-selectable {
    cursor: pointer;
    position: relative;
}

.barrel-selectable:hover {
    border-color: var(--gold);
    background: var(--gold-bg);
}

.tile-overlay-btn {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Added destinations in wizard */
.added-dest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--gold-border);
}

.added-dest:last-child { border-bottom: none; }

.btn-remove {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
}

.btn-remove:hover {
    background: var(--danger);
    color: white;
}

/* Cuvée section */
.cuvee-tile-header { font-size: 0.875rem; }
.cuvee-label { color: var(--text-light); font-weight: 400; }
.cuvee-tile-volume { font-size: 0.8rem; color: var(--text-light); margin-top: 0.25rem; }
.cuvee-inline-tile { cursor: pointer; }
.cuvee-new-section { margin-top: 0.5rem; }

/* Buffer section */
.buffer-summary {
    font-size: 1.1rem;
    font-weight: 600;
}

.buffer-alert {
    background: #fef5f5;
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Wine type badges */
.wine-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.wine-type-red { background: var(--red-wine); color: #fff; }
.wine-type-white { background: var(--white-wine); color: var(--text); }
.wine-type-rose { background: var(--rose); color: #fff; }

/* Floater volume input */
.floater-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
}

.floater-select input[type="number"] {
    width: 80px;
    padding: 4px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
}

/* Cancel button */
.btn-cancel {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-cancel:hover {
    background: var(--danger);
    color: white;
}

/* Footer actions bar */
.wizard-footer {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* -- Samples -- */
.samples-section {
    margin-top: 1rem;
}

.samples-section h3,
.samples-page h1 {
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
}

.sample-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sample-item {
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    background: var(--gold-bg);
    border: 1px solid transparent;
    border-radius: 6px;
}

.sample-item:hover {
    border-color: var(--gold-border);
}

.sample-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.sample-header {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.sample-barrel {
    font-weight: 600;
    color: var(--gold-dark);
}

.sample-wine {
    color: var(--text-light);
}

.sample-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.sample-date {
    color: var(--text-light);
}

.results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin: 0.5rem 0 0.25rem;
}

.result-cell {
    display: flex;
    flex-direction: column;
    min-width: 4.5rem;
}

.result-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    line-height: 1.2;
}

.result-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.sample-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.sample-notes {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.sample-info {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.results-form {
    max-width: 100%;
}

.success-msg {
    color: var(--success);
    font-size: 13px;
}

.empty-state {
    color: var(--text-light);
    font-style: italic;
    padding: 1rem 0;
}

.btn-sm.btn-primary {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
}

/* ===== DASHBOARD ===== */

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.dashboard-title-bar {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-title {
    margin: 0;
}

.dashboard-date {
    font-size: 14px;
    color: var(--text-light);
}

/* --- Stats row --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 16px 12px;
}

.stat-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.stat-value-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-dark);
}

.stat-unit {
    font-size: 14px;
    color: var(--text-light);
}

.stat-detail {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* --- Card header/footer --- */
.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card-header-title {
    font-size: 16px;
    margin: 0;
}

.card-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.card-footer-link {
    font-size: 13px;
    color: var(--gold-dark);
    text-decoration: none;
}

.card-footer-link:hover {
    text-decoration: underline;
}

/* --- Dashboard grid layouts --- */
.dashboard-main-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 1.5rem;
}

.dashboard-three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 1.5rem;
}

.dashboard-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 1.5rem;
}

/* --- Barrel overview card --- */
.barrel-overview-card {
    padding: 16px 20px;
}

.barrel-section-title {
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 8px;
}

/* --- Alerts card --- */
.alerts-card {
    padding: 16px 20px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.alert-danger {
    background: #fef5f5;
}

.alert-warning {
    background: #fffbef;
}

.alert-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon-danger {
    background: #fde8e8;
}

.alert-icon-warning {
    background: #fef6e0;
}

.alert-icon {
    font-size: 16px;
}

.alert-text {
    font-size: 13px;
    color: var(--text);
}

.alert-barrel-link {
    font-weight: 600;
    color: var(--gold-dark);
    text-decoration: none;
}

.alert-barrel-link:hover {
    text-decoration: underline;
}

/* --- Activity feed --- */
.activity-card {
    padding: 16px 20px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.dot-fill { background: var(--success); }
.dot-transfer { background: var(--info); }
.dot-event { background: var(--gold); }
.dot-maintenance { background: #8b5cf6; }
.dot-sample { background: #ec4899; }

.activity-text {
    font-size: 13px;
}

.activity-barrel {
    font-weight: 600;
    color: var(--gold-dark);
    text-decoration: none;
}

.activity-barrel:hover {
    text-decoration: underline;
}

.activity-desc {
    color: var(--text);
}

.activity-meta {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

/* --- Tasks card (dashboard) --- */
.tasks-card {
    padding: 16px 20px;
}

/* --- Samples card (dashboard) --- */
.samples-card {
    padding: 16px 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    margin-top: 6px;
}

.result-value {
    font-size: 12px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
}

.latest-result {
    margin-top: 6px;
}

.latest-result h3 {
    font-size: 13px;
    color: var(--text-light);
    margin: 4px 0;
}

/* --- Volume table --- */
.volume-card {
    padding: 16px 20px;
}

.volume-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.volume-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 6px 8px;
    border-bottom: 2px solid var(--border);
}

.volume-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

.volume-barrels {
    font-size: 12px;
    color: var(--text-light);
}

.wine-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.wine-dot-red { background: var(--red-wine); }
.wine-dot-white { background: var(--white-wine); }
.wine-dot-rose { background: var(--rose); }

/* --- Buffer cards --- */
.buffer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.buffer-card {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.buffer-red { border-color: var(--red-wine); }
.buffer-white { border-color: #b8a030; }
.buffer-rose { border-color: var(--rose); }

.buffer-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.buffer-red .buffer-label { color: var(--red-wine); }
.buffer-white .buffer-label { color: #8a7520; }
.buffer-rose .buffer-label { color: #c06080; }

.buffer-value {
    margin-bottom: 2px;
}

.buffer-volume {
    font-size: 24px;
    font-weight: 700;
}

.buffer-red .buffer-volume { color: var(--red-wine); }
.buffer-white .buffer-volume { color: #8a7520; }
.buffer-rose .buffer-volume { color: #c06080; }

.buffer-capacity {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.buffer-gauge {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.buffer-gauge-fill {
    height: 100%;
    border-radius: 3px;
}

.buffer-red .buffer-gauge-fill { background: var(--red-wine); }
.buffer-white .buffer-gauge-fill { background: var(--white-wine); }
.buffer-rose .buffer-gauge-fill { background: var(--rose); }

/* --- Sulfur status --- */
.sulfur-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sulfur-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 6px;
}

.sulfur-barrel {
    font-weight: 600;
    font-size: 13px;
    color: var(--gold-dark);
}

.badge-danger-light {
    background: #fef2f2;
    color: var(--danger);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.badge-warning-light {
    background: #fffbeb;
    color: #b8860b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.badge-success-light {
    background: #ecfdf5;
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.buffer-sulfur-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Active nav link --- */
.nav-active {
    color: var(--gold-dark) !important;
    font-weight: 600;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 2px;
}

/* --- Search box --- */
.search-box {
    position: relative;
}

.search-input {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    width: 200px;
    background: #fff;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(184, 135, 11, 0.15);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 280px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 1000;
    margin-top: 4px;
}

.search-dropdown:empty {
    display: none;
}

.search-results {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.search-result-item {
    padding: 0;
}

.search-result-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
}

.search-result-link:hover {
    background: #f5f0e0;
}

.search-result-number {
    font-weight: 600;
    color: var(--gold-dark);
    min-width: 40px;
}

.search-result-wine {
    flex: 1;
}

.search-result-category {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
}

.search-no-result {
    padding: 8px 12px;
    color: var(--text-light);
    font-size: 13px;
    font-style: italic;
    list-style: none;
}

/* --- Hamburger menu --- */
.nav-toggle-input {
    display: none;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 12px;
    z-index: 101;
    -webkit-tap-highlight-color: transparent;
}
.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--gold-light);
    border-radius: 1px;
    transition: transform 0.2s;
    pointer-events: none;
}

/* --- Quick actions --- */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 8px 16px;
    border: 2px solid var(--gold);
    border-radius: 8px;
    color: var(--gold-dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.quick-action-btn:hover {
    background: var(--gold);
    color: #fff;
}

/* --- Barrel alert states --- */
.barrel-danger {
    border-color: var(--danger) !important;
    position: relative;
}

.barrel-alert {
    border-color: #d4a017 !important;
    position: relative;
}

/* --- Pulsing dot --- */
.pulse-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

/* --- Transfer progress --- */
.transfer-progress-section {
    padding: 16px 20px;
}

.tp-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 8px;
}

.tp-link:hover .transfer-progress-card {
    background: #f9f6ef;
}

.transfer-progress-card {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: background 0.15s;
}

.tp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.tp-barrel {
    font-weight: 600;
    color: var(--gold-dark);
}

.tp-wine {
    font-size: 13px;
    color: var(--text);
}

.tp-bar-wrap {
    margin-bottom: 4px;
}

.tp-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.tp-bar-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
    transition: width 0.3s;
}

.tp-volume {
    font-size: 12px;
    color: var(--text-light);
}

/* -- Responsive -- */
@media (max-width: 768px) {
    .hamburger-btn { display: flex; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        padding: 12px 16px;
        z-index: 999;
    }
    .nav-toggle-input:checked ~ .nav-menu {
        display: block;
    }
    .nav-menu .nav-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .nav-bar { padding: 0 12px; }
    .nav-right { gap: 6px; }
    .search-input {
        width: 100px;
        font-size: 12px;
        padding: 5px 8px;
    }
    .search-input:focus {
        position: absolute;
        right: 0;
        width: 200px;
    }
    .search-dropdown {
        min-width: 250px;
        right: 0;
        left: auto;
    }
    .user-dropdown-trigger {
        font-size: 12px;
        padding: 5px 10px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .quick-action-btn {
        text-align: center;
        padding: 8px 4px;
        font-size: 12px;
    }
    .barrel-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .main-content { padding: 12px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dashboard-main-row { grid-template-columns: 1fr; }
    .dashboard-three-col { grid-template-columns: 1fr; }
    .dashboard-bottom-row { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .stats-row { grid-template-columns: repeat(3, 1fr); }
    .dashboard-main-row { grid-template-columns: 1fr; }
    .dashboard-three-col { grid-template-columns: 1fr 1fr; }
    .dashboard-bottom-row { grid-template-columns: 1fr; }
    .barrel-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (min-width: 1024px) {
    .barrel-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .bottom-sheet { max-width: 500px; left: 50%; transform: translateX(-50%); }
}

/* ---- Page header with inline button ---- */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ---- Fill create buttons (responsive) ---- */
.fill-create-btn-inline { display: inline-flex; }
.fill-create-fab { display: none; }

@media (max-width: 600px) {
    .fill-create-btn-inline { display: none; }
    .fill-create-fab { display: flex; }
}

/* ---- FAB (floating action button) ---- */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height, 56px) + 1rem);
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary, #2563eb);
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 100;
}
.fab:hover { background: var(--primary-dark, #1d4ed8); }

/* ---- Fill create page ---- */
.fill-create-page { max-width: 800px; margin: 0 auto; }

/* ---- Barrel selection grid ---- */
.barrel-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.barrel-select-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border, #e0e0e0);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.barrel-select-tile:hover {
    border-color: var(--primary, #2563eb);
    background: var(--bg-hover, #f5f5f5);
}
.barrel-select-tile.selected {
    border-color: var(--primary, #2563eb);
    background: var(--primary-light, #dbeafe);
}

.barrel-select-cap {
    font-size: 0.85rem;
    color: var(--text-light, #666);
    margin-top: 0.25rem;
}

.barrel-select-summary {
    font-weight: 500;
    padding: 0.5rem 0;
    color: var(--text-light, #666);
}

/* ---- Fills list ---- */
.fills-page { max-width: 800px; margin: 0 auto; }

.fill-list { display: flex; flex-direction: column; gap: 0.5rem; }

.fill-card {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}
.fill-card:hover { background: var(--bg-hover, #f5f5f5); }

.fill-card-info {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fill-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fill-card-name { font-weight: 600; font-size: 1.05rem; }

.fill-card-meta {
    display: flex;
    align-items: center;
    color: var(--text-light, #666);
    font-size: 0.9rem;
}

.fill-card-volume { font-weight: 500; }

.fill-card-barrels {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.mini-barrel-tile {
    min-width: unset;
    padding: 0.3rem 0.5rem;
    text-align: center;
}
.mini-barrel-tile .tile-number { font-size: 0.85rem; }
.mini-barrel-tile .tile-volume { font-size: 0.75rem; color: var(--text-light, #666); }
.fill-card-barrels .tile-link { font-size: 0.85rem; }

/* ---- Fill detail ---- */
.fill-detail { max-width: 800px; margin: 0 auto; }
.fill-detail-header { margin-bottom: 1rem; }
.fill-detail-badges { display: flex; gap: 0.5rem; margin-top: 0.25rem; }

.fill-info-section {
    background: var(--bg-card, #fff);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-light, #eee);
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-light, #666); }
.info-value { font-weight: 500; }

.fill-barrels-section,
.fill-samples-section,
.fill-events-section { margin-bottom: 1.5rem; }


/* ---- Settings page ---- */
.settings-page { max-width: 600px; margin: 0 auto; }

.wine-dict-add-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.wine-dict-add-row .form-group { flex: 1; min-width: 120px; }

.wine-dict-list { margin-top: 1rem; }

.wine-dict-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light, #eee);
}
.wine-dict-name { flex: 1; font-weight: 500; }

/* ---- Nav settings link (legacy, kept for compat) ---- */
.nav-settings {
    font-size: 0.85rem;
    opacity: 0.7;
    text-decoration: none;
    color: inherit;
}
.nav-settings:hover { opacity: 1; }

/* ---- User management: card list ---- */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.user-card {
    padding: 14px 20px;
}

.user-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-card-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.user-card-name {
    font-weight: 600;
    font-size: 15px;
}

.user-card-username {
    color: var(--text-muted);
    font-size: 13px;
}

.user-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- User badges ---- */
.badge-active {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--success);
    color: #fff;
}

.badge-locked {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--text-muted);
    color: #fff;
}

.badge-admin {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--gold);
    color: #fff;
}

/* ---- User action buttons ---- */
.user-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gold-border);
}

/* ---- Checkbox inline ---- */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-inline {
    width: auto !important;
    margin: 0;
}

/* ===== DETAIL & LIST PAGES ===== */
.detail-page { max-width: 640px; margin: 0 auto; }
.list-page { max-width: 900px; margin: 0 auto; }

.detail-hero {
    margin-bottom: 1.25rem;
    padding: 1.25rem;
}
.detail-hero h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}
.detail-hero .detail-subtitle {
    color: var(--text-light);
    font-size: 0.875rem;
}
.detail-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.hero-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Two-column hero: left title + right info sidebar */
.hero-split {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.hero-main { flex: 1; min-width: 0; }
.hero-sidebar {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 220px;
    border-left: 1px solid var(--border);
    padding-left: 1.25rem;
}
.hero-sidebar .info-row {
    padding: 0.25rem 0;
    font-size: 0.85rem;
}
.hero-sidebar .info-label { font-size: 0.75rem; }
.hero-sidebar .info-value { font-size: 0.85rem; }

@media (max-width: 560px) {
    .hero-split { flex-direction: column; gap: 1rem; }
    .hero-sidebar {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 0.75rem;
        min-width: unset;
        max-width: unset;
        width: 100%;
    }
}

.detail-card {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.detail-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.events-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.lab-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
}

@media (max-width: 480px) {
    .lab-fields-grid {
        grid-template-columns: 1fr;
    }
}
