/* ═══════════════════════════════════════════════════════════════════
   GardenHub — core.css
   Single source of truth: variables, reset, layout, sidebar, forms,
   buttons, cards, badges, flash, tables, pagination, print, responsive.
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ───────────────────────────────────────────────── */
:root {
    /* Brand Greens */
    --green-900: #1a3a0a;
    --green-800: #2d5016;
    --green-700: #3d6b1f;
    --green-600: #4a7c1f;
    --green-500: #5a9a24;
    --green-400: #7cb342;
    --green-300: #a4d65e;
    --green-100: #e8f5e9;

    /* Earth Tones */
    --earth-900: #3e2723;
    --earth-700: #5d4037;
    --earth-500: #8d6e63;
    --earth-100: #f5f0eb;
    --earth-50:  #faf7f4;

    /* Semantic Colors — ONE value each, used everywhere */
    --color-success:    #22c55e;
    --color-success-dk: #16a34a;
    --color-success-bg: #dcfce7;
    --color-success-tx: #166534;

    --color-danger:     #ef4444;
    --color-danger-dk:  #dc2626;
    --color-danger-bg:  #fee2e2;
    --color-danger-tx:  #991b1b;

    --color-warning:    #f59e0b;
    --color-warning-dk: #d97706;
    --color-warning-bg: #fef3c7;
    --color-warning-tx: #92400e;

    --color-info:       #3b82f6;
    --color-info-dk:    #2563eb;
    --color-info-bg:    #dbeafe;
    --color-info-tx:    #1e40af;

    --color-purple:     #8b5cf6;
    --color-purple-bg:  #ede9fe;
    --color-purple-tx:  #5b21b6;

    /* Neutrals */
    --text:       #1e293b;
    --text-secondary: #555;
    --text-muted: #888;
    --text-faint: #aaa;
    --border:     #e2e8f0;
    --border-dark:#d1d5db;
    --card-bg:    #fff;
    --page-bg:    #faf7f4;

    /* Layout */
    --sidebar-width:     240px;
    --sidebar-collapsed: 60px;
    --top-bar-height:    56px;
    --content-max-width: 1200px;
    --radius:     8px;
    --radius-lg:  10px;
    --radius-xl:  12px;

    /* Shadows */
    --shadow:    0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}


/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--page-bg);
    color: var(--text);
    line-height: 1.6;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-500); }
hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
img { max-width: 100%; }


/* ═════════════════════════════════════════════════════════════════
   SIDEBAR
   Uses #sidebar ID selector for specificity.
   HTML: <aside id="sidebar" class="sidebar collapsed">
   ═════════════════════════════════════════════════════════════════ */
#sidebar {
    position: fixed; top: 0; left: 0;
    height: 100dvh; height: 100vh;
    width: var(--sidebar-width);
    background: var(--green-900); color: #fff;
    z-index: 100; display: flex; flex-direction: column;
    overflow: hidden;
    transform: translateX(0);
    opacity: 1 !important;
}
#main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
    overflow-x: hidden;
    min-width: 0;
}
.sidebar-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: var(--top-bar-height);
}
.sidebar-header button {
    background: none; border: none; color: #fff; font-size: 18px;
    cursor: pointer; width: 28px; min-width: 28px; text-align: center;
}
.sidebar-title { font-weight: 700; font-size: 16px; white-space: nowrap; flex: 1; }
.sidebar-logout-btn {
    color: rgba(255,255,255,0.4); font-size: 14px;
    padding: 4px; text-decoration: none; transition: color 0.2s;
    flex-shrink: 0;
}
.sidebar-logout-btn:hover { color: #fff; }

.sidebar-nav { flex: 1; overflow-y: auto; min-height: 0; padding: 8px 0; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; color: rgba(255,255,255,0.8);
    white-space: nowrap; transition: background 0.15s, color 0.15s;
    font-size: 14px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-nav a.active { background: #e8dcc8; color: #5a4a2a; font-weight: 600; border-left: 3px solid #c4a96a; }
.sidebar-nav a.active i { color: #8b7340; }
.sidebar-nav a i { width: 28px; min-width: 28px; text-align: center; font-size: 16px; }

.sidebar-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 8px 16px; }

.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; color: rgba(255,255,255,0.6); font-size: 14px;
}
.sidebar-footer a:hover { color: #fff; background: rgba(255,255,255,0.05); }

/* Mobile overlay helpers */
.mobile-hamburger { display: none; }
.sidebar-backdrop {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 99;
}
.sidebar-backdrop.active { display: block; }


/* ═════════════════════════════════════════════════════════════════
   NAV GROUPS — Collapsible disclosure sections
   ═════════════════════════════════════════════════════════════════ */

/* Favorites bar — icon-only quick access row */
.nav-favorites {
    display: flex; justify-content: center; gap: 4px;
    padding: 8px 8px 4px;
}
.nav-favorites a {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius);
    color: rgba(255,255,255,0.65); font-size: 17px;
    transition: background 0.15s, color 0.15s;
}
.nav-favorites a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-favorites a.active { background: #e8dcc8; color: #5a4a2a; border-radius: var(--radius); }

/* Group toggle button — bold section header */
.nav-group { margin: 0; }
.nav-group-toggle {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 8px 16px;
    background: none; border: none;
    color: rgba(255,255,255,0.45);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    cursor: pointer; white-space: nowrap;
    transition: color 0.15s, background 0.15s;
    font-family: inherit;
}
.nav-group-toggle:hover { color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.03); }
.nav-group-toggle i:first-child {
    width: 28px; min-width: 28px; text-align: center; font-size: 14px;
    color: rgba(255,255,255,0.55);
}
.nav-group-toggle:hover i:first-child { color: rgba(255,255,255,0.8); }

/* Chevron — rotates on expand */
.nav-chevron {
    margin-left: auto; font-size: 10px;
    transition: transform 250ms ease;
    color: rgba(255,255,255,0.3);
}
.nav-group.open .nav-chevron { transform: rotate(90deg); }

/* Group items — CSS Grid expand/collapse animation */
.nav-group-items {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 250ms ease;
}
.nav-group.open .nav-group-items {
    grid-template-rows: 1fr;
}
.nav-group-items-inner { overflow: hidden; }

/* Child links — indented, lighter weight than group headers */
.nav-group-items-inner a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px 8px 44px; color: rgba(255,255,255,0.7);
    white-space: nowrap; transition: background 0.15s, color 0.15s;
    font-size: 13px; font-weight: 400;
}
.nav-group-items-inner a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-group-items-inner a.active { background: #e8dcc8; color: #5a4a2a; font-weight: 500; }
.nav-group-items-inner a.active i { color: #8b7340; }
.nav-group-items-inner a i {
    width: 20px; min-width: 20px; text-align: center; font-size: 13px;
    opacity: 0.8;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nav-group-items, .nav-chevron { transition: none; }
}

/* Sub-group — nested accordion (e.g. Logs & Reports inside My Garden) */
.nav-sub-group { margin: 0; }
.nav-sub-group-toggle {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 8px 16px 8px 44px;
    background: none; border: none;
    color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 400;
    cursor: pointer; transition: background 0.15s;
    text-align: left; white-space: nowrap; font-family: inherit;
}
.nav-sub-group-toggle:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-sub-group-toggle i:first-child {
    width: 20px; min-width: 20px; text-align: center; font-size: 13px; opacity: 0.8;
}
.nav-sub-group-toggle .nav-chevron-sm {
    margin-left: auto; font-size: 9px;
    transition: transform 200ms ease;
    color: rgba(255,255,255,0.3);
}
.nav-sub-group.open > .nav-sub-group-toggle .nav-chevron-sm { transform: rotate(90deg); }
.nav-sub-items {
    display: grid; grid-template-rows: 0fr; transition: grid-template-rows 200ms ease;
}
.nav-sub-group.open > .nav-sub-items { grid-template-rows: 1fr; }
.nav-sub-items-inner { overflow: hidden; }
.nav-sub-items-inner a {
    padding-left: 64px !important;
    font-size: 12.5px !important;
}

/* Mobile close button (X) inside sidebar */
.sidebar-close-mobile {
    display: none; position: absolute; top: 12px; right: 12px;
    background: none; border: none; color: rgba(255,255,255,0.5);
    font-size: 20px; cursor: pointer; padding: 4px 8px;
    z-index: 10; border-radius: 4px;
}
.sidebar-close-mobile:hover { color: #fff; background: rgba(255,255,255,0.1); }


/* ═════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═════════════════════════════════════════════════════════════════ */
#main-content {
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}
.top-bar {
    position: sticky; top: 0; z-index: 50;
    height: var(--top-bar-height); background: var(--card-bg);
    border-bottom: 1px solid #e0e0e0;
    display: flex; align-items: center;
    padding: 0 24px; gap: 12px;
}
.topbar-left {
    display: flex; align-items: center; gap: 8px;
    min-width: 0; flex-shrink: 1;
}
.topbar-breadcrumb {
    display: flex; align-items: center; gap: 0;
    min-width: 0; overflow: hidden;
    padding: 4px 24px;
    background: var(--card-bg, #fff);
    border-bottom: 1px solid #eee;
    font-size: 0;
}
.topbar-breadcrumb:empty { display: none; }
.bc-sep {
    color: #aaa; font-size: 0.7rem; margin: 0 7px; flex-shrink: 0;
    font-weight: 400;
}
.bc-section {
    color: #888; font-size: 0.78rem; font-weight: 500;
    white-space: nowrap; flex-shrink: 0;
}
.bc-parent {
    color: var(--green-600, #3A7D44); font-size: 0.78rem;
    text-decoration: none; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    max-width: 200px;
}
.bc-parent:hover { text-decoration: underline; color: var(--green-800); }
.bc-current {
    color: var(--green-900, #1a3a1a); font-size: 0.82rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-bar {
    display: flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid #c5ccd3;
    border-radius: 6px; padding: 0 10px;
    height: 36px;
    flex: 1; max-width: 420px;
    margin: 0 auto;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}
.search-bar:focus-within {
    border-color: var(--green-500, #5a9a24);
    box-shadow: 0 0 0 2px rgba(90,154,36,0.15);
}
.search-icon { color: #aaa; font-size: 12px; flex-shrink: 0; }
.search-bar input {
    border: none; background: none; outline: none;
    font-size: 13px; width: 100%; font-family: inherit;
    color: var(--text-body); height: 100%;
}
.search-bar input::placeholder { color: #b0b7bf; font-size: 13px; }
.search-clear {
    display: none; background: none; border: none;
    color: #999; font-size: 16px; cursor: pointer;
    padding: 0 2px; line-height: 1; flex-shrink: 0;
}
.search-clear:hover { color: #555; }
.user-info { display: flex; align-items: center; gap: 4px; font-size: 14px; flex-shrink: 0; }
.user-name { font-weight: 600; }
.zone-badge {
    background: var(--green-100); color: var(--green-800);
    padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600;
}
.role-badge {
    padding: 2px 8px; border-radius: 10px; font-size: 11px;
    font-weight: 600; text-transform: uppercase;
}
.role-admin { background: #ffcdd2; color: #c62828; }
.role-moderator { background: var(--color-warning-bg); color: #e65100; }
.role-user { background: var(--green-100); color: var(--green-800); }

.content-area { padding: 24px; overflow-x: hidden; min-width: 0; }


/* ═════════════════════════════════════════════════════════════════
   AUTH OVERLAY (Login / Register)
   ═════════════════════════════════════════════════════════════════ */
.auth-overlay {
    position: fixed; inset: 0; display: flex;
    align-items: flex-start; justify-content: center;
    padding: 40px 0 20px; overflow-y: auto; z-index: 1000;
}
.auth-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 50%, var(--earth-700) 100%);
}
.auth-modal {
    position: relative; overflow: visible; background: var(--card-bg); border-radius: var(--radius-xl);
    padding: 32px; width: 90%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h1 { font-size: 28px; color: var(--green-800); margin-bottom: 4px; }
.auth-header p { color: #666; font-size: 14px; }
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid #eee; }
.auth-tab {
    flex: 1; padding: 10px; text-align: center;
    border: none; background: none; cursor: pointer;
    font-size: 15px; font-weight: 600; color: #999;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active { color: var(--green-700); border-bottom-color: var(--green-700); }

/* Mobile auth: tighter padding */
@media (max-width: 600px) {
    .auth-overlay { padding: 16px 0 20px; }
    .auth-modal { margin-top: 0; }
}


/* ═════════════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═════════════════════════════════════════════════════════════════ */
.flash-container {
    position: fixed; top: 12px; right: 12px; z-index: 300;
    max-width: 400px; pointer-events: auto; padding: 0;
}
.flash {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-radius: var(--radius); margin-bottom: 8px;
    font-size: 14px; animation: slideDown 0.3s ease;
}
.flash-success { background: var(--color-success-bg); color: var(--color-success-tx); border: 1px solid #a5d6a7; }
.flash-error   { background: var(--color-danger-bg);  color: var(--color-danger-tx);  border: 1px solid #ef9a9a; }
.flash-info    { background: var(--color-info-bg);     color: var(--color-info-tx);    border: 1px solid #90caf9; }
.flash-warning { background: var(--color-warning-bg);  color: var(--color-warning-tx); border: 1px solid #fde68a; }
.flash-close { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; }
/* has-banner rules removed (P2B: banner is overlay) */
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }


/* ═════════════════════════════════════════════════════════════════
   NOTIFICATION BELL & DROPDOWN
   ═════════════════════════════════════════════════════════════════ */
.notif-bell {
    position: relative; color: #555; font-size: 18px;
    padding: 4px 8px; text-decoration: none; transition: color 0.2s;
    cursor: pointer; background: none; border: none;
}
.notif-bell:hover { color: #3d6b1f; }
.notif-badge {
    position: absolute; top: -2px; right: 0;
    background: #e53e3e; color: #fff; font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
}
.notif-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    width: 360px; max-height: 420px; background: #fff;
    border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    z-index: 200; overflow: hidden;
}
.notif-dropdown.open { display: flex; flex-direction: column; }
.notif-dropdown-header {
    padding: 12px 16px; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 0.9rem;
}
.notif-dropdown-body { overflow-y: auto; flex: 1; max-height: 320px; }
.notif-dd-item {
    padding: 10px 16px; border-bottom: 1px solid #f5f5f5;
    display: flex; gap: 10px; align-items: flex-start;
    cursor: pointer; transition: background 0.15s;
}
.notif-dd-item:hover { background: #f7faf7; }
.notif-dd-item:last-child { border-bottom: none; }
.notif-dd-icon {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.notif-dd-content { flex: 1; min-width: 0; }
.notif-dd-title {
    font-weight: 600; font-size: 0.85rem; margin-bottom: 1px;
    display: flex; align-items: center; gap: 6px;
}
.notif-dd-msg { font-size: 0.8rem; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-dd-time { font-size: 0.7rem; color: #999; margin-top: 2px; }
.notif-dropdown-footer { padding: 10px 16px; border-top: 1px solid #eee; text-align: center; }
.notif-dropdown-footer a { font-size: 0.85rem; color: #3d6b1f; text-decoration: none; font-weight: 600; }
.notif-dropdown-footer a:hover { text-decoration: underline; }
.notif-dd-empty { padding: 24px 16px; text-align: center; color: #999; font-size: 0.85rem; }
.notif-wrapper { position: relative; display: inline-block; }
.notif-mark-form { display: inline; }
.notif-mark-btn { background: none; border: none; color: #3d6b1f; font-size: 0.75rem; cursor: pointer; padding: 0; }
.notif-mark-btn:hover { text-decoration: underline; }

/* Notification icon type colors */
.notif-icon-broadcast { background: #ebf5ff; color: #3182ce; }
.notif-icon-warning   { background: #fffbeb; color: #d69e2e; }
.notif-icon-alert     { background: #fff5f5; color: #e53e3e; }
.notif-icon-info      { background: #f0fff4; color: #38a169; }

/* Urgency dots */
.urgency-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.urgency-low { background: #a0aec0; }
.urgency-normal { background: #3182ce; }
.urgency-high { background: #d69e2e; }
.urgency-critical { background: #e53e3e; }

/* Topbar link styles */
.topbar-icon { color: #777; font-size: 16px; padding: 4px 6px; text-decoration: none; transition: color 0.2s; }
.topbar-icon:hover { color: #3d6b1f; }
a.role-badge { text-decoration: none; cursor: pointer; transition: opacity 0.2s; }
a.role-badge:hover { opacity: 0.8; }
.user-name-link { color: #333; text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: color 0.2s; }
.user-name-link:hover { color: #3d6b1f; }

/* Auth logo */
.auth-logo { display: block; max-height: 100px; max-width: 200px; margin: 0 auto 12px auto; object-fit: contain; }


/* ═════════════════════════════════════════════════════════════════
   PAGE LAYOUT HELPERS
   ═════════════════════════════════════════════════════════════════ */
.page-header h1 { display: none; }
.page-header p { display: none; }
.back-link { font-size: 14px; color: var(--green-600); display: inline-block; margin-bottom: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
.section-title { font-size: 18px; color: var(--green-800); margin: 24px 0 12px; }
.card-header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.page-header { margin-bottom: 16px; position: relative; }
.page-actions {
    display: flex; gap: 8px;
    position: fixed;
    top: calc(var(--top-bar-height) + 16px);
    right: 28px;
    z-index: 40;
}
.page-actions .btn { font-size: 0.82rem; padding: 6px 14px; white-space: nowrap; }
.form-help { display: block; font-size: 13px; color: var(--text-muted); margin-top: 4px; }


/* ═════════════════════════════════════════════════════════════════
   CARDS
   Single definition. Used everywhere.
   ═════════════════════════════════════════════════════════════════ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
}
.card h2 { font-size: 18px; color: var(--green-800); margin-bottom: 12px; }
.card h3 { font-size: 16px; color: var(--green-800); margin-bottom: 8px; }
.card h4 { font-size: 15px; margin-bottom: 6px; }
.card p  { margin-bottom: 8px; }
.card-warning   { border-left: 4px solid var(--color-warning); background: var(--color-warning-bg); }
.card-highlight { border-left: 4px solid var(--color-success); background: var(--green-100); }

/* Card with structured header (admin/phase6 style) */
.card-header {
    margin: -20px -20px 12px;
    padding: 10px 16px;
    background: #f8f9f0;
    border-bottom: 1px solid #e8e8e8;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-header h3 { margin: 0; font-size: 1rem; color: var(--green-800); }


/* ═════════════════════════════════════════════════════════════════
   BUTTONS
   Single definition. All sizes, all variants.
   ═════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none; font-family: inherit;
    transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }

/* Variants */
.btn-primary   { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-600); color: #fff; }
.btn-secondary { background: #e0e0e0; color: var(--text); }
.btn-secondary:hover { background: #d0d0d0; color: var(--text); }
.btn-success   { background: var(--color-success); color: #fff; }
.btn-success:hover { background: var(--color-success-dk); color: #fff; }
.btn-danger    { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: var(--color-danger-dk); color: #fff; }

/* Sizes */
.btn-sm   { padding: 4px 10px; font-size: 12px; }
.btn-xs   { padding: 2px 8px; font-size: 11px; }
.btn-lg   { padding: 12px 24px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; padding: 10px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* Utility buttons */
.btn-icon {
    background: none; border: none; cursor: pointer;
    font-size: 16px; padding: 4px 6px; border-radius: 4px;
    color: var(--text-muted); transition: background 0.15s;
}
.btn-icon:hover { background: #f1f5f9; }
.inline-form { display: inline; }


/* ═════════════════════════════════════════════════════════════════
   FORMS
   ═════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd;
    border-radius: var(--radius); font-size: 14px; font-family: inherit;
    transition: border-color 0.2s; box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none; border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(90,154,36,0.1);
}
.form-control {
    width: 100%; padding: 8px 12px; border: 1px solid #ccc;
    border-radius: var(--radius); font-size: 14px;
    font-family: inherit; box-sizing: border-box;
}
.form-control:focus { border-color: var(--color-success); outline: none; }
.form-sm { padding: 4px 8px; font-size: 14px; height: auto; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; cursor: pointer; font-size: 14px;
}
.action-form { margin-bottom: 12px; }
.action-form .form-control { margin-bottom: 6px; }


/* ═════════════════════════════════════════════════════════════════
   BADGES
   ═════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    background: #eee; color: #666;
}
/* Plant category badges */
.badge-vegetable   { background: #e8f5e9; color: #2e7d32; }
.badge-herb        { background: #f3e5f5; color: #7b1fa2; }
.badge-fruit       { background: var(--color-warning-bg); color: #e65100; }
.badge-flower      { background: #fce4ec; color: #c62828; }
.badge-tree        { background: #e0f2f1; color: #00695c; }
.badge-shrub       { background: #e8eaf6; color: #283593; }
/* Difficulty badges */
.badge-beginner    { background: #e8f5e9; color: #2e7d32; }
.badge-intermediate{ background: var(--color-warning-bg); color: #e65100; }
.badge-advanced    { background: var(--color-danger-bg); color: #c62828; }
/* Type badges */
.badge-pest        { background: var(--color-danger-bg); color: #c62828; }
.badge-disease     { background: var(--color-warning-bg); color: #e65100; }
.badge-fungal      { background: #f3e5f5; color: #7b1fa2; }
.badge-organic     { background: #e8f5e9; color: #2e7d32; }
/* Semantic badges */
.badge-info        { background: var(--color-info-bg);    color: var(--color-info-tx); }
.badge-success     { background: var(--color-success-bg); color: var(--color-success-tx); }
.badge-warning     { background: var(--color-warning-bg); color: var(--color-warning-tx); }
.badge-danger      { background: var(--color-danger-bg);  color: var(--color-danger-tx); }
.badge-overdue     { background: var(--color-danger-bg);  color: var(--color-danger-tx); font-weight: 600; }
.badge-auto        { background: #e0e7ff; color: #4338ca; font-size: 10px; }
.badge-indoor      { background: #e8eaf6; color: #3949ab; padding: 1px 6px; font-size: 10px; }
/* Status badges (planting lifecycle) */
.badge-planned     { background: #e0e7ff; color: #4338ca; }
.badge-started,
.badge-sprouted    { background: var(--color-success-bg); color: var(--color-success-tx); }
.badge-growing     { background: var(--color-success-bg); color: var(--color-success-tx); }
.badge-flowering   { background: #fce7f3; color: #9d174d; }
.badge-fruiting    { background: #ffedd5; color: #9a3412; }
.badge-harvesting  { background: #fef9c3; color: #854d0e; }
.badge-done        { background: #f1f5f9; color: #475569; }
.badge-failed      { background: var(--color-danger-bg); color: var(--color-danger-tx); }
.badge-yes         { background: var(--color-success-bg); color: var(--color-success-tx); }
.badge-no          { background: var(--color-danger-bg); color: var(--color-danger-tx); }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }

/* Small chips */
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 12px; background: #f1f5f9; color: #475569;
    text-decoration: none; transition: background 0.15s;
}
.chip:hover { background: #e2e8f0; }
.chip-sm    { padding: 1px 6px; font-size: 11px; }
.chip-more  { background: transparent; color: var(--text-muted); }
.chip-green { background: #d1fae5; color: #065f46; }
.chip-blue  { background: var(--color-info-bg); color: var(--color-info-tx); }
.chip-purple{ background: var(--color-purple-bg); color: var(--color-purple-tx); }


/* ═════════════════════════════════════════════════════════════════
   TABLES
   ═════════════════════════════════════════════════════════════════ */
/* Original data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left; padding: 8px 12px; background: var(--earth-100);
    color: var(--text-secondary); font-weight: 600; border-bottom: 2px solid #ddd;
}
.data-table td { padding: 8px 12px; border-bottom: 1px solid #eee; }
.data-table tr:hover { background: #fafafa; }

/* Facts table (plant detail, etc.) */
.facts-table { width: 100%; font-size: 13px; }
.facts-table td { padding: 6px 0; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.facts-table td:first-child { font-weight: 600; width: 40%; white-space: nowrap; }

/* Admin-style table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 8px 12px; text-align: left;
    border-bottom: 1px solid #eee; font-size: 14px;
}
.table th {
    font-weight: 600; color: var(--text-secondary);
    font-size: 12px; text-transform: uppercase;
}
.table th a { color: var(--green-800); text-decoration: none; }
.table-hover tr:hover { background: #f8f9f0; }
.row-inactive { opacity: 0.5; }


/* ═════════════════════════════════════════════════════════════════
   DASHBOARD & STAT CARDS
   ═════════════════════════════════════════════════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex; align-items: flex-start; gap: 12px;
    box-shadow: var(--shadow);
    border: 1px solid #e8e8e8;
}
.stat-icon {
    font-size: 1.8rem; color: var(--green-600);
    width: 50px; height: 50px; min-width: 50px;
    background: var(--green-100); border-radius: var(--radius-xl);
    display: flex; align-items: center; justify-content: center;
}
.stat-value  { font-size: 1.5rem; font-weight: 700; color: var(--green-800); }
.stat-number { font-size: 1.5rem; font-weight: 700; color: var(--green-900); display: block; }
.stat-label  { font-weight: 600; color: var(--text-secondary); font-size: 14px; }
.stat-sub    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Mini stats */
.stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}
.stat-mini { background: #f8f9f0; padding: 8px 12px; border-radius: var(--radius); font-size: 14px; }
.stat-mini-val { font-weight: 700; color: var(--green-800); font-size: 1.1rem; }


/* ═════════════════════════════════════════════════════════════════
   ALERTS & NOTIFICATIONS
   ═════════════════════════════════════════════════════════════════ */
.alert {
    padding: 12px 16px; border-radius: var(--radius);
    margin-bottom: 16px; font-size: 14px;
}
.alert-warning { background: var(--color-warning-bg); border: 1px solid #ffe0b2; color: #e65100; }
.alert a { color: inherit; font-weight: 600; }

.notification-item { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.notification-item:last-child { border-bottom: none; }
.notification-unread { background: #f0f8ff; margin: 0 -20px; padding: 12px 20px; }
.notification-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.notification-body { font-size: 14px; color: var(--text-secondary); margin: 4px 0; }

/* Notification bell */
.nav-bell { position: relative; text-decoration: none; font-size: 1.2rem; }
.nav-bell-count {
    position: absolute; top: -6px; right: -8px;
    background: var(--color-danger); color: #fff;
    font-size: 10px; width: 16px; height: 16px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}


/* ═════════════════════════════════════════════════════════════════
   FILTERS
   ═════════════════════════════════════════════════════════════════ */
.filters-bar,
.filter-bar {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 16px; align-items: center;
}
.filter-form {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.filter-form select,
.filter-form input {
    padding: 6px 10px; border: 1px solid #ddd;
    border-radius: var(--radius); font-size: 14px;
}
.filter-row {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px;
}
.filter-controls { display: flex; gap: 8px; }
.filter-controls select {
    padding: 6px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 14px;
    background: var(--card-bg);
}


/* ═════════════════════════════════════════════════════════════════
   TAB BAR
   ═════════════════════════════════════════════════════════════════ */
.tab-bar {
    display: flex; gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1rem;
}
.tab {
    padding: 8px 20px; text-decoration: none;
    color: var(--text-muted); font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--green-700); border-bottom-color: var(--green-700); }


/* ═════════════════════════════════════════════════════════════════
   LIST ITEMS
   ═════════════════════════════════════════════════════════════════ */
.list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid #f0f0f0; gap: 12px;
}
.list-item:last-child { border-bottom: none; }


/* ═════════════════════════════════════════════════════════════════
   QUICK LINKS (Admin sidebar)
   ═════════════════════════════════════════════════════════════════ */
.quick-links { display: flex; flex-direction: column; gap: 4px; }
.quick-links a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; color: var(--green-800);
    text-decoration: none; border-radius: var(--radius);
    transition: background 0.15s;
}
.quick-links a:hover { background: #f0f4e8; }


/* ═════════════════════════════════════════════════════════════════
   ADMIN LAYOUT
   ═════════════════════════════════════════════════════════════════ */
.admin-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.garden-header h1 { display: none; }
.garden-header > *:not(h1) { margin-left: auto; }

.admin-header h1 { display: none; }
.admin-header > *:not(h1):not(p) { margin-left: auto; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-columns {
    display: grid; grid-template-columns: 1fr 360px;
    gap: 20px; margin-top: 16px;
}
.admin-col-main { min-width: 0; }
.admin-col-side { min-width: 0; }


/* ═════════════════════════════════════════════════════════════════
   PAGINATION
   ═════════════════════════════════════════════════════════════════ */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 8px; padding: 12px 0; margin-top: 16px; font-size: 14px;
}
.pagination a { color: var(--green-800); text-decoration: none; font-weight: 600; }


/* ═════════════════════════════════════════════════════════════════
   ERROR DISPLAY
   ═════════════════════════════════════════════════════════════════ */
.error-item { padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.error-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.error-url { font-size: 12px; margin: 2px 0; }
.error-msg { font-size: 14px; color: #c62828; }
.error-trace {
    font-size: 12px; background: #f5f5f5; padding: 8px;
    border-radius: 4px; overflow-x: auto; max-height: 200px; margin-top: 4px;
}


/* ═════════════════════════════════════════════════════════════════
   BACKUPS
   ═════════════════════════════════════════════════════════════════ */
.backup-item { padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.backup-item:last-child { border-bottom: none; }


/* ═════════════════════════════════════════════════════════════════
   TEXT HELPERS
   ═════════════════════════════════════════════════════════════════ */
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: 13px; color: var(--text-muted); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: #e65100; }


/* ═════════════════════════════════════════════════════════════════
   QUICK ACTIONS PANEL — Slide-up from FAB
   ═════════════════════════════════════════════════════════════════ */
.qa-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.35); z-index: 199;
    opacity: 0; transition: opacity 250ms ease;
}
.qa-backdrop.active { display: block; opacity: 1; }

.qa-panel {
    position: fixed; z-index: 200;
    background: var(--card-bg);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    bottom: 0; left: 0; right: 0;
    max-height: 80vh; overflow-y: auto;
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}
.qa-panel.open { transform: translateY(0); }

/* Desktop: position as popover above FAB */
@media (min-width: 769px) {
    .qa-panel {
        bottom: 80px; right: 24px;
        left: auto; top: auto;
        width: 380px; max-height: 70vh;
        border-radius: var(--radius-xl);
        transform: translateY(16px);
        opacity: 0;
        transition: transform 250ms ease, opacity 200ms ease;
    }
    .qa-panel.open { transform: translateY(0); opacity: 1; }
}

.qa-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
}
.qa-panel-title {
    font-size: 16px; font-weight: 700; color: var(--text);
}
.qa-panel-title i { color: var(--color-warning); margin-right: 6px; }
.qa-panel-close {
    background: none; border: none; font-size: 22px;
    color: var(--text-muted); cursor: pointer; padding: 0 4px;
    line-height: 1;
}
.qa-panel-close:hover { color: var(--text); }

.qa-panel-body { padding: 16px 20px 20px; }

.qa-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.qa-grid-2 { grid-template-columns: repeat(2, 1fr); }

.qa-tile {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px; padding: 16px 8px;
    border-radius: var(--radius); text-align: center;
    font-size: 12px; font-weight: 600;
    color: var(--text); text-decoration: none;
    transition: transform 0.1s, box-shadow 0.15s;
    border: 1px solid var(--border);
    background: var(--card-bg);
}
.qa-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text);
}
.qa-tile:active { transform: translateY(0); }
.qa-tile i { font-size: 22px; }

.qa-tile-green i  { color: var(--color-success); }
.qa-tile-blue i   { color: var(--color-info); }
.qa-tile-purple i { color: var(--color-purple); }
.qa-tile-teal i   { color: #14b8a6; }
.qa-tile-amber i  { color: var(--color-warning); }
.qa-tile-orange i { color: #f97316; }

.qa-tile-sm {
    padding: 12px 8px; font-size: 11px;
}
.qa-tile-sm i { font-size: 18px; color: var(--text-secondary); }

.qa-divider {
    height: 1px; background: var(--border);
    margin: 14px 0;
}

.qa-view-all {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px; margin-top: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--green-700); text-decoration: none;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.qa-view-all:hover { background: var(--green-100); }

/* FAB transforms to X when panel open */
.fab-container { position: fixed; bottom: 20px; right: 20px; z-index: 201; }
.fab {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--color-warning); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; box-shadow: var(--shadow-lg);
    border: none; cursor: pointer;
    transition: transform 0.25s, background 0.2s;
}
.fab:hover { background: var(--color-warning-dk); transform: scale(1.05); color: #fff; }
.fab.fab-active { background: var(--text-secondary); transform: rotate(45deg); }
.fab.fab-active:hover { background: var(--text); }

/* Mobile: smaller gap on very small screens */
@media (max-width: 380px) {
    .qa-grid { gap: 8px; }
    .qa-tile { padding: 12px 6px; }
    .qa-tile i { font-size: 20px; }
}


/* ═════════════════════════════════════════════════════════════════
   PRINT STYLES  (single definition — no duplicates)
   ═════════════════════════════════════════════════════════════════ */
@media print {
    .no-print,
    .fab-container,
    .pwa-banner,
    .site-banner,
    .qa-backdrop,
    .print-modal      { display: none !important; }
    #sidebar,
    .sidebar          { display: none !important; }
    #main-content,
    .main-content     { margin-left: 0 !important; padding: 0 !important; }
    .top-bar          { display: none !important; }
    .flash-container  { display: none !important; }
    body              { font-size: 11pt; }
}


/* ═════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═════════════════════════════════════════════════════════════════ */

/* ── Mobile + Tablet (up to 1200px): hamburger slide-out ───────── */
@media (max-width: 1200px) {
    #sidebar {
        width: var(--sidebar-width) !important;
        transform: translateX(-100%) !important;
        transition: transform 0.25s ease;
    }
    #sidebar.collapsed {
        transform: translateX(-100%) !important;
        width: var(--sidebar-width) !important;
    }
    #sidebar.expanded,
    #sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    #sidebar.expanded .sidebar-title,
    #sidebar.mobile-open .sidebar-title { display: inline; }
    #sidebar.expanded .sidebar-nav a span,
    #sidebar.mobile-open .sidebar-nav a span { display: inline; }
    #sidebar.expanded .sidebar-footer a span,
    #sidebar.mobile-open .sidebar-footer a span { display: inline; }

    /* Nav groups in mobile expanded */
    #sidebar.expanded .nav-group-toggle span,
    #sidebar.mobile-open .nav-group-toggle span { display: inline; }
    #sidebar.expanded .nav-chevron,
    #sidebar.mobile-open .nav-chevron { display: inline-block; }
    #sidebar.expanded .nav-group-items-inner a span,
    #sidebar.mobile-open .nav-group-items-inner a span { display: inline; }

    /* Sub-groups in mobile expanded */
    #sidebar.expanded .nav-sub-group-toggle span,
    #sidebar.mobile-open .nav-sub-group-toggle span { display: inline; }
    #sidebar.expanded .nav-chevron-sm,
    #sidebar.mobile-open .nav-chevron-sm { display: inline-block; }

    /* Mobile close button visible */
    .sidebar-close-mobile { display: block; }

    #main-content,
    #main-content.sidebar-collapsed { margin-left: 0 !important; }

    .mobile-hamburger {
        display: flex !important;
        background: none; border: none;
        color: var(--green-700); font-size: 22px;
        cursor: pointer; padding: 4px 8px; margin-right: 8px;
    }
    .sidebar-backdrop.active { display: block; }

    .top-bar { padding-left: 16px; }
    .content-area { padding: 16px; }
    .search-bar { max-width: none; flex: 1; }

    .user-name { display: none; }

    .two-col,
    .detail-grid,
    .admin-columns { grid-template-columns: 1fr; }

    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }

    /* Notif dropdown: full-width on small screens */
    .notif-dropdown { width: calc(100vw - 24px); right: -60px; }
}

/* ── Small Mobile (up to 480px) ────────────────────────────────── */
@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .detail-grid    { grid-template-columns: 1fr; }
}

/* ── Desktop (1201px+): always-expanded sidebar ──────────────── */
@media (min-width: 1201px) {
    .mobile-hamburger  { display: none !important; }
    .sidebar-backdrop  { display: none !important; }
    .sidebar-close-mobile { display: none !important; }

    /* Always expanded — no collapsed state on desktop */
    #sidebar {
        transform: translateX(0) !important;
        width: var(--sidebar-width) !important;
        height: 100dvh; height: 100vh !important;
    }
    #sidebar .sidebar-title { display: inline !important; }
    #sidebar .sidebar-nav a span { display: inline !important; }
    #sidebar .sidebar-footer a span { display: inline !important; }
    #sidebar .nav-group-toggle span { display: inline !important; }
    #sidebar .nav-chevron { display: inline-block !important; }
    #sidebar .nav-group-items-inner a span { display: inline !important; }
    #sidebar .nav-sub-group-toggle span { display: inline !important; }
    #sidebar .nav-chevron-sm { display: inline-block !important; }

    /* Hide sidebar toggle on desktop */
    #sidebar-toggle { display: none !important; }

    #main-content {
        margin-left: var(--sidebar-width) !important;
        transition: margin-left 0.25s ease;
    }
}

/* ── Touch & iOS Optimizations ─────────────────────────────────── */
@media (max-width: 768px) {
    input, select, textarea { font-size: 16px; /* prevents iOS zoom */ }
    .btn, button[type="submit"] { min-height: 44px; }
}

/* ── Safe Area (PWA notch handling) ────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    .sidebar-footer { padding-bottom: env(safe-area-inset-bottom); }
    .fab-container { bottom: calc(20px + env(safe-area-inset-bottom)); }
    .qa-panel { padding-bottom: env(safe-area-inset-bottom); }
}


/* ═══════════════════════════════════════════════════════════════════
   HUB TABS — Reusable tab component (Phase B1+)
   ═══════════════════════════════════════════════════════════════════ */

.hub-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--earth-200, #ddd);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.hub-tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted, #777);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.hub-tab:hover { color: var(--text-body, #333); }
.hub-tab.active {
    color: var(--green-700, #2D5F2D);
    border-bottom-color: var(--green-600, #3A7D44);
    font-weight: 600;
}
.hub-tab .tab-icon { margin-right: 6px; }
.hub-tab .tab-badge {
    display: inline-block;
    background: var(--green-100, #e8f5e9);
    color: var(--green-700, #2D5F2D);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
}

.hub-panel { display: none; }
.hub-panel.active { display: block; }

/* ── Hub stat cards row ──────────────────────── */
.hub-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.hub-stat {
    flex: 1;
    min-width: 120px;
    background: var(--earth-50, #faf8f5);
    border: 1px solid var(--earth-200, #ddd);
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
}
.hub-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green-700, #2D5F2D);
    line-height: 1.2;
}
.hub-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted, #777);
    margin-top: 2px;
}

/* ── Activity timeline cards ─────────────────── */
.timeline-feed { display: flex; flex-direction: column; gap: 0; }
.tl-card {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--earth-100, #eee);
    align-items: flex-start;
}
.tl-card:last-child { border-bottom: none; }
.tl-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    color: #fff;
}
.tl-icon-log { background: #5C6BC0; }
.tl-icon-harvest { background: #43A047; }
.tl-icon-water { background: #29B6F6; }
.tl-icon-soil { background: #8D6E63; }
.tl-icon-photo { background: #AB47BC; }
.tl-icon-rotation { background: #FF7043; }
.tl-body { flex: 1; min-width: 0; }
.tl-meta {
    font-size: 0.78rem;
    color: var(--text-muted, #777);
    margin-bottom: 2px;
}
.tl-summary { font-size: 0.92rem; }

/* ── Soil gauge bars ─────────────────────────── */
.soil-gauge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.soil-gauge-label {
    width: 30px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: right;
}
.soil-gauge-track {
    flex: 1;
    height: 14px;
    background: var(--earth-100, #eee);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
}
.soil-gauge-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.5s ease;
}
.soil-gauge-value {
    font-size: 0.8rem;
    font-weight: 600;
    width: 40px;
}

/* ── Water schedule list ─────────────────────── */
.water-log-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--earth-100, #eee);
    font-size: 0.9rem;
}
.water-log-row:last-child { border-bottom: none; }

@media (max-width: 600px) {
    .hub-tab { padding: 8px 14px; font-size: 0.85rem; }
    .hub-stats { gap: 8px; }
    .hub-stat { min-width: 80px; padding: 8px 10px; }
    .hub-stat-value { font-size: 1.2rem; }
}

/* ── Seed card planting count (Phase B2) ─────── */
.seed-card-plantings {
    font-size: 0.82rem;
    color: var(--green-700, #2D5F2D);
    margin-top: 4px;
}

/* ── Journal collapsible form cards (Phase B3) ── */
.journal-form-card { border: 1px solid var(--earth-200, #ddd); border-radius: 8px; }
.journal-form-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    padding: 10px 16px;
}
.journal-form-toggle::-webkit-details-marker { display: none; }
.journal-form-toggle h3 { margin: 0; font-size: 0.92rem; }
.journal-chevron {
    font-size: 0.75rem;
    color: var(--text-muted, #777);
    transition: transform 0.2s ease;
}
details.journal-form-card[open] .journal-chevron { transform: rotate(180deg); }
details.journal-form-card[open] .journal-form-toggle { border-bottom: 1px solid var(--earth-100, #eee); }

.journal-form-compact { padding: 12px 16px; }
.journal-form-compact .form-row { gap: 8px; margin-bottom: 8px; }
.journal-form-compact .form-group { margin-bottom: 0; }
.journal-form-compact .form-group label { font-size: 0.78rem; margin-bottom: 2px; }
.journal-form-compact input,
.journal-form-compact select,
.journal-form-compact textarea {
    padding: 5px 8px;
    font-size: 0.85rem;
    min-height: auto;
}
/* ── Watering Guide styles (Phase C — from watering.html) ── */
.watering-profiles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.watering-profile-card { background: #f9fafb; border-radius: 8px; padding: 20px; border-left: 4px solid; }
.watering-profile-low { border-color: #d4a574; }
.watering-profile-moderate { border-color: #6b9bd1; }
.watering-profile-high { border-color: #5da9a5; }
.watering-profile-card h3 { margin: 0 0 8px 0; font-size: 1.1rem; }
.profile-desc { color: #666; margin: 0 0 16px 0; font-size: 0.9rem; }
.frequency-table { background: white; border-radius: 6px; padding: 12px; margin: 12px 0; }
.freq-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #eee; }
.freq-row:last-child { border-bottom: none; }
.freq-label { font-size: 0.85rem; color: #666; }
.freq-value { font-weight: 600; color: #333; }
.profile-metrics { display: flex; gap: 16px; margin: 12px 0; font-size: 0.9rem; }
.profile-details { margin: 12px 0; cursor: pointer; }
.profile-details summary { font-weight: 600; padding: 8px 12px; background: white; border-radius: 4px; user-select: none; }
.profile-details ul { margin: 8px 0 0 0; padding-left: 24px; }
.profile-details li { margin: 4px 0; color: #555; font-size: 0.85rem; }
.adjustment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.adjustment-card { background: #f9fafb; padding: 12px; border-radius: 6px; border: 1px solid #e5e7eb; }
.adj-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.adj-factor, .adj-efficiency { background: #3d6b1f; color: white; padding: 4px 10px; border-radius: 12px; font-size: 0.85rem; font-weight: 600; }
.adj-note { margin: 0; font-size: 0.85rem; color: #555; }
.adj-tip { margin: 8px 0 0 0; font-size: 0.8rem; color: #666; font-style: italic; }
.critical-periods-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.critical-plant-card { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 16px; }
.critical-plant-card h3 { margin: 0 0 12px 0; font-size: 1rem; }
.critical-period { margin: 8px 0; padding: 8px 0; border-bottom: 1px solid #fed7aa; }
.critical-period:last-child { border-bottom: none; }
.critical-stage { font-weight: 600; font-size: 0.85rem; color: #9a3412; margin-bottom: 4px; }
.critical-guidance { font-size: 0.85rem; color: #555; }
.troubleshoot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.trouble-card { background: #fef3c7; border: 1px solid #fcd34d; border-radius: 8px; padding: 16px; }
.trouble-card h3 { margin: 0 0 12px 0; font-size: 1rem; color: #92400e; }
.trouble-card p { margin: 8px 0; font-size: 0.85rem; color: #555; }
.trouble-card ul { margin: 8px 0 0 0; padding-left: 20px; }
.trouble-card li { margin: 4px 0; font-size: 0.85rem; color: #555; }
.golden-rules { display: grid; gap: 12px; }
.rule { padding: 12px; background: #f0fdf4; border-left: 3px solid #3d6b1f; border-radius: 4px; font-size: 0.9rem; }
.rule strong { color: #3d6b1f; }


/* ================================================================
   SITE BANNER (MOTD) + QUICK ACTIONS MODAL
   Added by css_patch.py
   ================================================================ */

/* -- Site-wide Banner (MOTD) ---------------------------------------- */
/* Desktop: sticky banner inside content flow */
.site-banner {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 8px 20px; font-size: 0.85rem; font-weight: 500;
    text-align: center; min-height: 36px;
}
/* Mobile: inline bubble, not fixed */
@media (max-width: 1200px) {
    .site-banner {
        position: relative; top: auto; left: auto; right: auto;
        margin: 8px 12px; border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
}
.site-banner-msg { flex: 1; }
.site-banner-msg i { margin-right: 6px; }
.site-banner-close {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: inherit; opacity: 0.7; padding: 0 4px; line-height: 1;
}
.site-banner-close:hover { opacity: 1; }
.site-banner-info    { background: #1e40af; color: #fff; border-bottom: 1px solid #1e3a8a; }
.site-banner-success { background: #166534; color: #fff; border-bottom: 1px solid #14532d; }
.site-banner-warning { background: #92400e; color: #fff; border-bottom: 1px solid #78350f; }
.site-banner-error   { background: #991b1b; color: #fff; border-bottom: 1px solid #7f1d1d; }
.site-banner-danger  { background: #991b1b; color: #fff; border-bottom: 1px solid #7f1d1d; }

/* Banner is now a non-layout-pushing overlay */

/* -- Quick Actions Modal -------------------------------------------- */
.qa-backdrop {
    position: fixed; inset: 0; z-index: 899;
    background: rgba(0,0,0,0.25); backdrop-filter: blur(2px);
}
.qa-modal {
    position: absolute; bottom: 70px; right: 0; z-index: 901;
    width: 300px; background: var(--card-bg, #fff);
    border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    padding: 14px; animation: qaSlideUp 0.15s ease-out;
    max-height: calc(100vh - 120px); overflow-y: auto;
}
@keyframes qaSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.qa-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb; font-size: 0.9rem;
}
.qa-full-link { font-size: 0.75rem; color: var(--green-600); text-decoration: none; }
.qa-full-link:hover { text-decoration: underline; }
.qa-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.qa-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 12px 6px; border-radius: 12px; text-decoration: none;
    font-size: 0.72rem; font-weight: 600; text-align: center;
    transition: transform 0.1s, box-shadow 0.1s;
}
.qa-tile i { font-size: 1.3rem; }
.qa-tile:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }
.qa-tile:active { transform: scale(0.95); }
.qa-tile-green  { background: #dcfce7; color: #166534; }
.qa-tile-blue   { background: #dbeafe; color: #1e40af; }
.qa-tile-purple { background: #f3e8ff; color: #6b21a8; }
.qa-tile-teal   { background: #ccfbf1; color: #115e59; }
.qa-tile-orange { background: #ffedd5; color: #9a3412; }
.qa-tile-amber  { background: #fef3c7; color: #92400e; }

/* FAB as button */
button.fab { border: none; cursor: pointer; outline: none; }

/* QA modal sections */
.qa-divider { height: 1px; background: #e5e7eb; margin: 10px 0; }
.qa-log-section { display: flex; flex-direction: column; gap: 6px; }
.qa-log-label { font-size: 0.75rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.03em; }
.qa-select {
    width: 100%; padding: 6px 10px; font-size: 0.8rem;
    border: 1px solid #d1d5db; border-radius: 8px; background: #fff;
    color: #374151; appearance: auto; cursor: pointer;
}
.qa-select:focus { border-color: var(--green-500); outline: none; box-shadow: 0 0 0 2px rgba(90,154,36,0.15); }
.qa-log-buttons { display: flex; gap: 6px; }
.qa-log-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 7px 0; border: none; border-radius: 8px; font-size: 0.72rem;
    font-weight: 600; cursor: pointer; transition: transform 0.1s, opacity 0.15s;
}
.qa-log-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qa-log-btn:not(:disabled):hover { transform: scale(1.03); }
.qa-log-btn:not(:disabled):active { transform: scale(0.96); }
.qa-log-water   { background: #dbeafe; color: #1e40af; }
.qa-log-observe { background: #f1f5f9; color: #475569; }
.qa-log-fert    { background: #f3e8ff; color: #6b21a8; }
.qa-log-feedback {
    font-size: 0.75rem; text-align: center; padding: 4px 8px;
    border-radius: 6px; font-weight: 500;
}
.qa-log-ok  { background: #dcfce7; color: #166534; }
.qa-log-err { background: #fef2f2; color: #991b1b; }
.qa-print-row {
    display: flex; justify-content: center; gap: 8px;
}
.qa-print-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 8px;
    background: #f1f5f9; color: #475569; text-decoration: none;
    font-size: 0.9rem; transition: transform 0.1s, background 0.15s;
}
.qa-print-btn:hover { background: #e2e8f0; transform: scale(1.08); }
.qa-print-btn:active { transform: scale(0.95); }


/* ── QA Calculator & Converter ─────────────────────────────────── */
.qa-calc-section { margin: 0; }
/* QA calc view header */
.qa-calc-view { padding: 0; }
.qa-calc-header {
    display: flex; align-items: center; gap: 8px;
    padding-bottom: 10px; margin-bottom: 10px;
    border-bottom: 1px solid #e5e7eb; font-size: 0.9rem;
}
.qa-calc-back {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px;
    border: none; background: #f1f5f9; color: #475569;
    cursor: pointer; font-size: 0.8rem; transition: background 0.15s;
}
.qa-calc-back:hover { background: #e2e8f0; }
.qa-bottom-row {
    display: flex; justify-content: center; gap: 8px;
}


.qa-calc-toggle {
    display: flex; gap: 0; margin-bottom: 8px;
    border-radius: 8px; overflow: hidden;
    border: 1px solid #e2e8f0;
}
.qa-calc-tab {
    flex: 1; padding: 6px 0; font-size: 0.72rem; font-weight: 600;
    border: none; cursor: pointer; text-align: center;
    background: #f8fafc; color: #64748b; transition: all 0.15s;
}
.qa-calc-tab:first-child { border-right: 1px solid #e2e8f0; }
.qa-calc-tab.active { background: var(--green-600, #3A7D44); color: #fff; }
.qa-calc-tab i { margin-right: 3px; }
.qa-calc-panel { display: none; }
.qa-calc-panel.active { display: block; }

/* Basic Calculator */
.qa-calc-display {
    background: #1e293b; color: #f1f5f9; font-size: 1.4rem;
    font-family: 'SF Mono', 'Consolas', monospace; text-align: right;
    padding: 10px 12px; border-radius: 8px; margin-bottom: 6px;
    min-height: 24px; overflow: hidden; white-space: nowrap;
}
.qa-calc-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
}
.qa-ck {
    padding: 10px 0; border: none; border-radius: 8px; cursor: pointer;
    font-size: 0.9rem; font-weight: 600; background: #f1f5f9;
    color: #1e293b; transition: background 0.1s;
}
.qa-ck:hover { background: #e2e8f0; }
.qa-ck:active { background: #cbd5e1; }
.qa-ck-fn { background: #e2e8f0; color: #475569; }
.qa-ck-op { background: var(--green-600, #3A7D44); color: #fff; }
.qa-ck-op:hover { background: var(--green-700, #2D5F2D); }
.qa-ck-eq { background: var(--green-700, #2D5F2D); color: #fff; }
.qa-ck-eq:hover { background: var(--green-800, #1a3a1a); }
.qa-ck-zero { grid-column: span 2; }

/* Converter */
.qa-cv-input {
    width: 100%; padding: 8px 10px; font-size: 1.1rem; font-weight: 600;
    border: 1px solid #d1d5db; border-radius: 8px; background: #fff;
    text-align: center; margin-bottom: 6px;
}
.qa-cv-input:focus { border-color: var(--green-500); outline: none; }
.qa-cv-row {
    display: flex; align-items: center; gap: 4px; margin-bottom: 6px;
}
.qa-cv-sel { flex: 1; font-size: 0.78rem; padding: 6px 4px; }
.qa-cv-arrow { color: #94a3b8; font-size: 0.7rem; flex-shrink: 0; }
.qa-cv-result {
    text-align: center; font-size: 0.82rem; font-weight: 600;
    color: var(--green-800, #2d5016); background: #f0fdf4;
    padding: 8px; border-radius: 8px;
}

/* QA print sub-view */
.qa-print-view { padding: 0; }
.qa-print-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.qa-print-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 16px 8px; border-radius: 12px;
    background: #f8fafc; text-decoration: none;
    font-size: 0.75rem; font-weight: 600; color: #475569;
    text-align: center; transition: transform 0.1s, background 0.15s;
}
.qa-print-tile i { font-size: 1.2rem; color: #64748b; }
.qa-print-tile:hover { background: #e2e8f0; transform: scale(1.03); }
.qa-print-tile:active { transform: scale(0.97); }

/* Tool buttons with labels */
.qa-tool-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; flex: 1; padding: 12px 8px; border-radius: 12px;
    background: var(--green-100, #e8f5e9); color: var(--green-700, #2D5F2D);
    border: none; cursor: pointer;
    font-size: 0.72rem; font-weight: 600;
    transition: transform 0.1s, background 0.15s;
}
.qa-tool-btn i { font-size: 1.1rem; }
.qa-tool-btn:hover { background: var(--green-200, #c8e6c9); transform: scale(1.03); }
.qa-tool-btn:active { transform: scale(0.97); }

/* -- Print Preview Modal -------------------------------------------- */
.print-modal {
    position: fixed; inset: 0; z-index: 11000;
    display: flex; flex-direction: column;
    background: #fff;
    animation: printFadeIn 0.15s ease-out;
}
@keyframes printFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.print-modal-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 20px; background: var(--green-800, #2d5016);
    color: #fff; flex-shrink: 0; gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.print-modal-title {
    font-weight: 600; font-size: 1rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.print-modal-actions { display: flex; gap: 8px; flex-shrink: 0; }
.print-modal-actions .btn {
    background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.25);
    font-size: 0.8rem; padding: 5px 12px; border-radius: 6px;
}
.print-modal-actions .btn:hover { background: rgba(255,255,255,0.25); }
.print-modal-frame {
    flex: 1; border: none; width: 100%; background: #f9fafb;
}

/* ── Tools Hub ───────────────────────────────────────────────────── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.tools-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 16px; text-decoration: none;
    color: var(--text-body, #333); transition: transform 0.12s, box-shadow 0.15s;
    position: relative; overflow: hidden;
}
a.tools-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.12));
}
.tools-card-icon {
    flex-shrink: 0; width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}
.tools-icon-green  { background: var(--green-100, #e8f5e9); color: var(--green-800, #2d5016); }
.tools-icon-blue   { background: #dbeafe; color: #1e40af; }
.tools-icon-purple { background: #f3e8ff; color: #6b21a8; }
.tools-icon-amber  { background: #fef3c7; color: #92400e; }
.tools-icon-teal   { background: #ccfbf1; color: #115e59; }
.tools-card-body h3 {
    font-size: 0.95rem; font-weight: 600; margin: 0 0 4px 0;
    color: var(--text-body, #333);
}
.tools-card-body p {
    font-size: 0.82rem; margin: 0;
    color: var(--text-muted, #777); line-height: 1.4;
}
.tools-card-arrow {
    margin-left: auto; color: var(--text-muted, #999); font-size: 0.85rem;
    opacity: 0; transition: opacity 0.15s;
}
a.tools-card:hover .tools-card-arrow { opacity: 1; }
.tools-card-soon {
    opacity: 0.6; cursor: default;
}
.tools-soon-badge {
    position: absolute; top: 10px; right: 10px;
    background: var(--earth-200, #e5e7eb); color: var(--text-muted, #777);
    font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 8px;
}
@media (max-width: 600px) {
    .tools-grid { grid-template-columns: 1fr; }
}


/* -- Tools nav section labels ------------------------------------- */
.nav-section-label {
    display: block;
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.2);
    padding: 0 16px;
    margin: 6px 0 2px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 6px;
    line-height: 1;
}
.sidebar-collapsed .nav-section-label {
    display: none;
}

.sidebar-collapsed .sidebar-logout-btn { display: none; }

/* Page-actions: stack below on mobile */
@media (max-width: 768px) {
    .page-actions { position: static; margin-bottom: 12px; }
}

/* -- Search autocomplete dropdown --------------------------------- */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(var(--top-bar-height) - 2px);
    left: 50%;
    transform: translateX(-50%);
    width: 420px; max-width: calc(100vw - 48px);
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
}
.search-dd-group {
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: #999; padding: 8px 14px 3px;
    border-top: 1px solid #f0f0f0;
}
.search-dd-group:first-child { border-top: none; }
.search-dd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; font-size: 0.88rem;
    color: var(--text-body); text-decoration: none;
    transition: background 0.1s; cursor: pointer;
}
.search-dd-item:hover, .search-dd-active { background: var(--green-100, #e8f5e9); }
.search-dd-label { font-weight: 500; }
.search-dd-sub { font-size: 0.78rem; color: #999; font-style: italic; }
.search-dd-all { border-top: 1px solid #e5e7eb; color: var(--green-700); font-weight: 500; }
@media (max-width: 768px) {
    .search-dropdown { width: calc(100vw - 24px); left: 12px; transform: none; }
}

/* Breadcrumb: compact on mobile */
@media (max-width: 768px) {
    .bc-section { display: none; }
    .topbar-breadcrumb { padding: 4px 16px; }
    .bc-section + .bc-sep { display: none; }
    .bc-parent { max-width: 100px; }
}





/* (removed dangling selectors that broke CSS parsing) */

/* ── Demo Sticker — Auth Modal ─────────────────────────────── */
.auth-modal { position: relative; overflow: visible; }
.demo-sticker {
    position: absolute; top: -14px; right: -14px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff !important; text-decoration: none;
    padding: 8px 16px 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem; font-weight: 700;
    box-shadow: 0 4px 12px rgba(22,163,74,0.35);
    transform: rotate(3deg);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 1px;
    line-height: 1.2;
}
.demo-sticker span {
    font-size: 0.65rem; font-weight: 500; opacity: 0.85;
}
.demo-sticker:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(22,163,74,0.45);
    color: #fff;
}
@media (max-width: 480px) {
    .demo-sticker { top: -12px; right: -6px; font-size: 0.78rem; padding: 6px 12px; }
}

/* Demo sticker arrow bounce */
.demo-sticker-arrow {
    display: inline-block;
    animation: sticker-nudge 1.5s ease-in-out infinite;
    font-size: 1rem;
}
.demo-sticker-sub {
    font-size: 0.62rem; font-weight: 500; opacity: 0.85; letter-spacing: 0.02em;
}
@keyframes sticker-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

/* ── Sidebar Logout — absolute bottom positioning ──────────────── */
aside#sidebar .sidebar-logout-bottom {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 10px 8px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid rgba(255,255,255,0.15) !important;
    background: var(--green-900) !important;
    z-index: 5 !important;
}
aside#sidebar .sidebar-logout-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 8px 12px !important;
    color: rgba(255,255,255,0.7) !important;
    text-decoration: none !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    transition: background 0.15s, color 0.15s !important;
}
aside#sidebar .sidebar-logout-link:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}
aside#sidebar .sidebar-logout-link i {
    width: 28px !important;
    min-width: 28px !important;
    text-align: center !important;
    font-size: 16px !important;
}
/* Collapsed sidebar: icon only, centered */
aside#sidebar.collapsed .sidebar-logout-link span { display: none !important; }
aside#sidebar.collapsed .sidebar-logout-bottom { padding: 8px 4px !important; }
aside#sidebar.collapsed .sidebar-logout-link { justify-content: center !important; padding: 10px !important; }

/* Mobile/tablet expanded */
@media (max-width: 1200px) {
    aside#sidebar.mobile-open .sidebar-logout-link span,
    aside#sidebar.expanded .sidebar-logout-link span { display: inline !important; }
    aside#sidebar.mobile-open .sidebar-logout-bottom,
    aside#sidebar.expanded .sidebar-logout-bottom { padding: 10px 12px !important; }
}
/* Desktop always shows text */
@media (min-width: 1201px) {
    aside#sidebar .sidebar-logout-link span { display: inline !important; }
}

aside#sidebar .sidebar-nav { padding-bottom: 56px !important; }

.bed-card-capacity{padding:0 14px 8px;font-size:.8rem;color:#64748b;display:flex;justify-content:space-between}
.bed-card-capacity-bar{height:6px;background:#e5e7eb;border-radius:3px;overflow:hidden;margin:0 14px 8px}
.bed-card-capacity-fill{height:100%;border-radius:3px}
