/* ============================================================
   ORISE AgriTech — Unified Design System
   Version 2.0 — Full UI/UX Redesign
   ============================================================ */

/* ── 1. Design Tokens ───────────────────────────────────────── */
:root {
    /* Primary Palette — Forest Green */
    --c-primary-900: #052c16;
    --c-primary-800: #064e3b;
    --c-primary-700: #065f46;
    --c-primary-600: #047857;
    --c-primary-500: #059669;
    --c-primary-400: #10b981;
    --c-primary-300: #34d399;
    --c-primary-200: #6ee7b7;
    --c-primary-100: #d1fae5;
    --c-primary-50:  #ecfdf5;

    /* Secondary Palette — Teal */
    --c-teal-700: #0f766e;
    --c-teal-500: #14b8a6;
    --c-teal-300: #5eead4;

    /* Semantic Colors */
    --c-success: #10b981;
    --c-warning: #f59e0b;
    --c-danger:  #ef4444;
    --c-info:    #3b82f6;

    /* Neutral Scale */
    --c-gray-950: #030712;
    --c-gray-900: #111827;
    --c-gray-800: #1f2937;
    --c-gray-700: #374151;
    --c-gray-600: #4b5563;
    --c-gray-500: #6b7280;
    --c-gray-400: #9ca3af;
    --c-gray-300: #d1d5db;
    --c-gray-200: #e5e7eb;
    --c-gray-100: #f3f4f6;
    --c-gray-50:  #f9fafb;

    /* Semantic Aliases */
    --color-bg-sidebar:    var(--c-primary-800);
    --color-bg-main:       #f0fdf4;
    --color-bg-card:       #ffffff;
    --color-primary:       var(--c-primary-700);
    --color-primary-light: var(--c-primary-400);
    --color-primary-dark:  var(--c-primary-900);
    --color-accent:        var(--c-primary-300);
    --color-text-main:     var(--c-gray-900);
    --color-text-muted:    var(--c-gray-500);
    --color-text-inverse:  #ffffff;
    --color-border:        var(--c-gray-200);
    --color-border-focus:  var(--c-primary-400);

    /* Shadows */
    --shadow-xs:  0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow-sm:  0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
    --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
    --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.25);
    --shadow-glow-teal:  0 0 20px rgba(20, 184, 166, 0.2);

    /* Border Radius */
    --r-sm:  6px;
    --r-md:  10px;
    --r-lg:  16px;
    --r-xl:  20px;
    --r-2xl: 28px;
    --r-full: 9999px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Typography */
    --font-base: 'Inter', system-ui, -apple-system, sans-serif;
    --text-xs:   11px;
    --text-sm:   13px;
    --text-base: 15px;
    --text-md:   17px;
    --text-lg:   20px;
    --text-xl:   24px;
    --text-2xl:  28px;
    --text-3xl:  34px;
    --text-4xl:  42px;

    /* Transitions */
    --ease-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-slow:   400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar Widths */
    --nav-w:    260px;
    --nav-w-sm: 68px;
}

/* ── 2. Global Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: var(--font-base);
    font-size: var(--text-base);
    color: var(--color-text-main);
    background-color: var(--color-bg-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a { text-decoration: none; }
p { margin: 0; }

/* ── 3. Layout Shell ────────────────────────────────────────── */
.full-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── 4. Sidebar (Shared Company + Employee) ─────────────────── */
.side-nav {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--nav-w);
    background: var(--color-bg-sidebar);
    background-image:
        radial-gradient(circle at 15% 25%, rgba(52, 211, 153, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 85% 75%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    overflow-y: auto;
    transition: width var(--ease-slow);
    will-change: width;
    z-index: 100;
    scrollbar-width: none;
}
.side-nav::-webkit-scrollbar { display: none; }

/* Collapsed state */
.side-nav.collapsed { width: var(--nav-w-sm); }

/* Main content offset */
.main-content {
    margin-left: var(--nav-w);
    min-height: 100vh;
    width: calc(100% - var(--nav-w));
    transition: margin-left var(--ease-slow), width var(--ease-slow);
    display: flex;
    flex-direction: column;
    background: var(--color-bg-main);
}
.side-nav.collapsed ~ .main-content {
    margin-left: var(--nav-w-sm);
    width: calc(100% - var(--nav-w-sm));
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-4) var(--space-4);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo-wrap { display: flex; align-items: center; overflow: hidden; width: 100%; }
.sidebar-logo-img  { width: 90px; height: auto; max-height: 30px; object-fit: contain; flex-shrink: 0; transition: all var(--ease-normal); }
.sidebar-logo-text {
    font-size: var(--text-md);
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--ease-normal);
}
.side-nav.collapsed .sidebar-logo-text  { opacity: 0; width: 0; pointer-events: none; }
.side-nav.collapsed .sidebar-logo-img   { width: 44px; margin: 0 auto; object-fit: cover; object-position: left; }

/* Collapse Toggle Button */
.sidebar-toggle {
    width: 32px; height: 32px;
    border-radius: var(--r-sm);
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--ease-fast);
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Nav Sections */
.sidebar-nav-section { padding: var(--space-3) var(--space-3); flex: 1; }
.sidebar-nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: var(--space-2) var(--space-3) var(--space-2);
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--ease-normal);
}
.side-nav.collapsed .sidebar-nav-label { opacity: 0; }

/* Nav Items */
.side-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    color: rgba(255,255,255,0.72);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--ease-fast);
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    margin-bottom: 2px;
    text-decoration: none;
}
.side-nav-btn svg { flex-shrink: 0; }
.side-nav-btn .nav-label { opacity: 1; transition: opacity var(--ease-normal); }
.side-nav.collapsed .nav-label { opacity: 0; width: 0; pointer-events: none; }
.side-nav.collapsed .side-nav-btn { justify-content: center; }

.side-nav-btn:hover {
    background: rgba(255,255,255,0.09);
    color: #fff;
}
.side-nav-btn.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 78, 59, 0.5));
    color: #fff;
    border-left: 3px solid var(--c-primary-300);
    font-weight: 600;
}
.side-nav-btn.active svg { color: var(--c-primary-300); }

/* Nav Badge */
.nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--r-full);
    background: var(--c-danger);
    color: #fff;
    line-height: 1.4;
}
.side-nav.collapsed .nav-badge { display: none; }

/* Sidebar Footer / Profile Card */
.sidebar-footer {
    padding: var(--space-3) var(--space-3) var(--space-5);
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.05);
    overflow: hidden;
    text-decoration: none;
}
.sidebar-avatar {
    width: 34px; height: 34px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--c-primary-400), var(--c-primary-600));
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-profile-info { overflow: hidden; opacity: 1; transition: opacity var(--ease-normal); }
.side-nav.collapsed .sidebar-profile-info { opacity: 0; width: 0; pointer-events: none; }
.sidebar-profile-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-profile-role {
    font-size: var(--text-xs);
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

/* Tooltip for collapsed nav */
.side-nav.collapsed .side-nav-btn { position: relative; }
.side-nav.collapsed .side-nav-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--nav-w-sm) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--c-gray-900);
    color: #fff;
    font-size: var(--text-xs);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ease-fast);
    z-index: 200;
    box-shadow: var(--shadow-md);
}
.side-nav.collapsed .side-nav-btn:hover::after { opacity: 1; }

/* ── 5. Top Bar (Header) ────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 var(--space-6);
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-xs);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Breadcrumb */
.breadcrumb-nav { display: flex; align-items: center; gap: 4px; font-size: var(--text-sm); }
.breadcrumb-item { display: flex; align-items: center; gap: 4px; color: var(--color-text-muted); }
.breadcrumb-item a { color: var(--color-text-muted); transition: color var(--ease-fast); }
.breadcrumb-item a:hover { color: var(--c-primary-500); }
.breadcrumb-item.active { color: var(--color-text-main); font-weight: 600; }
.breadcrumb-sep { color: var(--c-gray-300); font-size: 14px; user-select: none; }

/* Topbar Actions */
.topbar-btn {
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    border: 1px solid var(--color-border);
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--ease-fast);
    position: relative;
}
.topbar-btn:hover { background: var(--c-primary-50); color: var(--c-primary-500); border-color: var(--c-primary-200); }

/* Notification badge */
.topbar-badge {
    position: absolute;
    top: -3px; right: -3px;
    width: 16px; height: 16px;
    border-radius: var(--r-full);
    background: var(--c-danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--color-bg-card);
}

/* Topbar User */
.topbar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 10px 5px 6px;
    border-radius: var(--r-md);
    border: 1px solid var(--color-border);
    background: transparent;
    cursor: pointer;
    transition: all var(--ease-fast);
}
.topbar-user:hover { background: var(--c-primary-50); border-color: var(--c-primary-200); }
.topbar-avatar {
    width: 30px; height: 30px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--c-primary-400), var(--c-primary-700));
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
}
.topbar-name { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-main); }
.topbar-datetime { text-align: right; }
.topbar-date { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.3; }
.topbar-time { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-main); line-height: 1.3; }

/* ── 6. Content Area ────────────────────────────────────────── */
.content-container {
    padding: var(--space-6);
    flex: 1;
}

/* ── 7. Page Header ─────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    gap: var(--space-4);
    flex-wrap: wrap;
}
.page-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--c-primary-800), var(--c-primary-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: 4px;
    font-weight: 400;
}
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── 8. Cards ───────────────────────────────────────────────── */
.premium-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--r-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--ease-normal), border-color var(--ease-normal), transform var(--ease-normal);
    position: relative;
    overflow: hidden;
}
.premium-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--c-primary-200);
    transform: translateY(-2px);
}
.premium-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--c-primary-400), var(--c-teal-500));
    opacity: 0;
    transition: opacity var(--ease-normal);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.premium-card:hover::before { opacity: 1; }

/* Stat Card */
.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--r-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: all var(--ease-normal);
    position: relative;
    overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: var(--space-3);
}
.stat-card-icon.green  { background: var(--c-primary-50); color: var(--c-primary-600); }
.stat-card-icon.teal   { background: #f0fdfa; color: var(--c-teal-700); }
.stat-card-icon.amber  { background: #fffbeb; color: #d97706; }
.stat-card-icon.red    { background: #fef2f2; color: #dc2626; }
.stat-card-icon.blue   { background: #eff6ff; color: #2563eb; }
.stat-card-label { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card-value { font-size: var(--text-3xl); font-weight: 800; color: var(--color-text-main); line-height: 1.1; margin: 6px 0 4px; }
.stat-card-trend { font-size: var(--text-xs); color: var(--color-text-muted); display: flex; align-items: center; gap: 4px; }
.trend-up   { color: var(--c-success); }
.trend-down { color: var(--c-danger); }

/* Glass Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
}

/* ── 9. Buttons ─────────────────────────────────────────────── */
.btn-premium {
    background: linear-gradient(135deg, var(--c-primary-500), var(--c-primary-700));
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    padding: 9px 20px;
    font-size: var(--text-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--ease-normal);
    box-shadow: 0 1px 3px rgba(6, 78, 59, 0.3);
    text-decoration: none;
    white-space: nowrap;
}
.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-green), var(--shadow-md);
    color: #fff;
}
.btn-premium:active { transform: translateY(0); }

.btn-premium-outline {
    background: transparent;
    color: var(--c-primary-600);
    border: 1.5px solid var(--c-primary-300);
    border-radius: var(--r-md);
    padding: 8px 18px;
    font-size: var(--text-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--ease-normal);
    text-decoration: none;
    white-space: nowrap;
}
.btn-premium-outline:hover {
    background: var(--c-primary-50);
    border-color: var(--c-primary-500);
    color: var(--c-primary-700);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--c-gray-100);
    color: var(--c-gray-700);
    border: 1px solid var(--color-border);
    border-radius: var(--r-md);
    padding: 9px 18px;
    font-size: var(--text-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--ease-fast);
    text-decoration: none;
    white-space: nowrap;
}
.btn-secondary:hover { background: var(--c-gray-200); color: var(--c-gray-900); }

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: var(--r-md);
    padding: 9px 18px;
    font-size: var(--text-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--ease-fast);
    text-decoration: none;
    white-space: nowrap;
}
.btn-danger:hover { background: #fee2e2; color: #b91c1c; }

.btn-icon-circle {
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--ease-fast);
    flex-shrink: 0;
}
.btn-icon-circle:hover {
    background: var(--c-primary-50);
    color: var(--c-primary-600);
    border-color: var(--c-primary-200);
}
.btn-icon-circle.btn-icon-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-icon-circle.btn-icon-danger:hover { background: #fee2e2; }

/* Icon-only Button Sizes */
.btn-icon-sm { width: 30px; height: 30px; border-radius: var(--r-sm); }
.btn-icon-lg { width: 42px; height: 42px; border-radius: var(--r-md); }

/* ── 10. Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-5); }
.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--c-gray-700);
    margin-bottom: 6px;
}
.form-label .required { color: var(--c-danger); margin-left: 2px; }

.form-control, .form-select, .form-input {
    width: 100%;
    padding: 9px 12px;
    font-size: var(--text-sm);
    font-family: var(--font-base);
    color: var(--color-text-main);
    background: var(--color-bg-card);
    border: 1.5px solid var(--color-border);
    border-radius: var(--r-md);
    transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.form-control::placeholder { color: var(--c-gray-400); }
.form-control:focus, .form-select:focus, .form-input:focus {
    border-color: var(--c-primary-400);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.form-control.is-invalid { border-color: var(--c-danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }

/* Input with Icon */
.input-group-icon {
    position: relative;
}
.input-group-icon .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-gray-400);
    pointer-events: none;
}
.input-group-icon .form-control { padding-left: 38px; }

/* Validation */
.field-error {
    font-size: var(--text-xs);
    color: var(--c-danger);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── 11. Search ─────────────────────────────────────────────── */
.premium-search {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--color-bg-card);
    border: 1.5px solid var(--color-border);
    border-radius: var(--r-full);
    padding: 0 12px;
    transition: all var(--ease-fast);
    min-width: 220px;
}
.premium-search:focus-within {
    border-color: var(--c-primary-400);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.premium-search input {
    border: none; background: transparent;
    padding: 9px 8px;
    font-size: var(--text-sm);
    font-family: var(--font-base);
    width: 100%; outline: none;
    color: var(--color-text-main);
}
.premium-search input::placeholder { color: var(--c-gray-400); }
.premium-search .search-icon { color: var(--c-gray-400); flex-shrink: 0; }
.premium-search button {
    background: transparent; border: none;
    color: var(--c-gray-400); cursor: pointer;
    padding: 4px; border-radius: var(--r-sm);
    display: flex; align-items: center;
    transition: color var(--ease-fast);
}
.premium-search button:hover { color: var(--c-primary-500); }

/* ── 12. Tables ─────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}
.data-table thead th {
    padding: 10px 14px;
    background: var(--c-gray-50);
    border-bottom: 1.5px solid var(--color-border);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--c-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    white-space: nowrap;
}
.data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-gray-100);
    color: var(--color-text-main);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--c-primary-50); }

/* ── 13. Badges / Chips ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.badge-success  { background: var(--c-primary-100); color: var(--c-primary-700); }
.badge-warning  { background: #fef9c3; color: #a16207; }
.badge-danger   { background: #fee2e2; color: #b91c1c; }
.badge-info     { background: #dbeafe; color: #1d4ed8; }
.badge-neutral  { background: var(--c-gray-100); color: var(--c-gray-600); }
.badge-dot::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Status Dot */
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.online  { background: var(--c-success); box-shadow: 0 0 0 2px rgba(16,185,129,0.25); }
.status-dot.offline { background: var(--c-gray-400); }
.status-dot.warning { background: var(--c-warning); box-shadow: 0 0 0 2px rgba(245,158,11,0.25); }
.status-dot.danger  { background: var(--c-danger); box-shadow: 0 0 0 2px rgba(239,68,68,0.25); }
.status-dot.pulse   { animation: pulse-ring 1.5s ease-out infinite; }
@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ── 14. Dividers ───────────────────────────────────────────── */
.hr-1 {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-4) 0;
}

/* ── 15. Avatar ─────────────────────────────────────────────── */
.avatar {
    border-radius: var(--r-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--c-primary-400), var(--c-primary-700));
    flex-shrink: 0;
}
.avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar-md  { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg  { width: 44px; height: 44px; font-size: 16px; }
.avatar-xl  { width: 56px; height: 56px; font-size: 20px; }
.avatar-round { border-radius: 50%; }

/* ── 16. Typography Utilities ───────────────────────────────── */
.text-gradient {
    background: linear-gradient(135deg, var(--c-primary-800), var(--c-primary-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}
.heading-xl  { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.heading-lg  { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.heading-md  { font-size: var(--text-lg); font-weight: 600; line-height: 1.3; }
.text-sm-muted { font-size: var(--text-sm); color: var(--color-text-muted); }
.text-xs-muted { font-size: var(--text-xs); color: var(--color-text-muted); }
.text-label {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
}

/* ── 17. Empty State ────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    text-align: center;
    gap: var(--space-4);
}
.empty-state-icon {
    width: 64px; height: 64px;
    border-radius: var(--r-xl);
    background: var(--c-primary-50);
    color: var(--c-primary-400);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin-bottom: var(--space-2);
}
.empty-state-title { font-size: var(--text-md); font-weight: 700; color: var(--color-text-main); }
.empty-state-desc  { font-size: var(--text-sm); color: var(--color-text-muted); max-width: 320px; }

/* ── 18. Zone / Sensor Specific ─────────────────────────────── */
.zone-status-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.zone-name {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text-main);
    margin: 0;
}
.status-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0;
}

/* Tab Menu */
.tab-menu { display: flex; gap: 6px; background: var(--c-gray-100); border-radius: var(--r-md); padding: 4px; }
.menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--r-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--ease-fast);
    white-space: nowrap;
    background: transparent;
    border: none;
    user-select: none;
}
.menu-btn:hover { color: var(--color-text-main); background: rgba(255,255,255,0.8); }
input[type="radio"]:checked + .menu-btn,
.menu-btn.active {
    background: var(--color-bg-card);
    color: var(--c-primary-700);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}
input[type="radio"][name="menu"] { display: none; }

/* Sensor KPI Grid */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.kpi-item {
    background: var(--c-gray-50);
    border: 1px solid var(--color-border);
    border-radius: var(--r-md);
    padding: 10px 12px;
}
.kpi-label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: var(--text-md); font-weight: 700; color: var(--color-text-main); margin-top: 2px; }

/* Live Pill */
.live-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    background: var(--c-primary-50);
    color: var(--c-primary-700);
    border: 1px solid var(--c-primary-100);
    font-size: var(--text-xs);
    font-weight: 600;
}
.live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--c-success);
    animation: pulse-ring 1.5s ease-out infinite;
}

/* Actuator Toggle */
.actuator-toggle {
    position: relative;
    width: 52px; height: 28px;
    cursor: pointer;
}
.actuator-toggle input { display: none; }
.actuator-toggle-track {
    position: absolute; inset: 0;
    border-radius: var(--r-full);
    background: var(--c-gray-200);
    transition: background var(--ease-fast);
}
.actuator-toggle input:checked + .actuator-toggle-track { background: var(--c-primary-400); }
.actuator-toggle-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform var(--ease-fast);
}
.actuator-toggle input:checked ~ .actuator-toggle-thumb { transform: translateX(24px); }

/* ── 19. Farm / Section / Zone Cards ────────────────────────── */
.farm-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--r-xl);
    padding: var(--space-5);
    transition: all var(--ease-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.farm-card:hover { box-shadow: var(--shadow-lg); border-color: var(--c-primary-200); transform: translateY(-2px); }
.farm-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-3); }
.farm-card-title  { font-size: var(--text-md); font-weight: 700; color: var(--color-text-main); }
.farm-card-footer { display: flex; gap: 8px; margin-top: auto; padding-top: var(--space-4); }
.farm-meta-item   { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--color-text-muted); }
.farm-meta-item svg { color: var(--c-primary-400); }

/* Zone Card */
.zone-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--r-lg);
    padding: var(--space-4);
    transition: all var(--ease-normal);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.zone-card:hover { box-shadow: var(--shadow-md); border-color: var(--c-primary-200); }

/* ── 20. Scheduling Page Specific ───────────────────────────── */
.schedule-banner {
    background: linear-gradient(135deg, var(--c-primary-700), var(--c-primary-500));
    border-radius: var(--r-xl);
    padding: var(--space-5) var(--space-6);
    color: #fff;
    margin-bottom: var(--space-5);
}
.schedule-banner-title  { font-size: var(--text-xl); font-weight: 700; }
.schedule-banner-sub    { font-size: var(--text-sm); opacity: 0.8; margin-top: 4px; }

/* Status Chips */
.status-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    font-size: var(--text-xs);
    font-weight: 700;
    white-space: nowrap;
}
.chip-running { background: var(--c-primary-100); color: var(--c-primary-700); }
.chip-paused  { background: #fef9c3; color: #a16207; }
.chip-saved   { background: var(--c-gray-100); color: var(--c-gray-600); }
.chip-running .chip-dot { animation: pulse-ring 1.5s infinite; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── 21. Auth Pages ─────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; }
.auth-left {
    flex: 1;
    background: linear-gradient(160deg, var(--c-primary-800) 0%, var(--c-primary-600) 60%, var(--c-teal-500) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-10);
    position: relative;
    overflow: hidden;
}
.auth-left::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(52,211,153,0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16,185,129,0.15) 0%, transparent 50%);
}
.auth-right {
    width: 480px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10) var(--space-8);
    background: var(--color-bg-card);
    overflow-y: auto;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { margin-bottom: var(--space-8); }
.auth-title { font-size: var(--text-2xl); font-weight: 800; color: var(--color-text-main); letter-spacing: -0.02em; }
.auth-subtitle { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 6px; }
.auth-form { margin-top: var(--space-8); display: flex; flex-direction: column; gap: var(--space-5); }
.auth-link { color: var(--c-primary-600); font-weight: 600; text-decoration: none; font-size: var(--text-sm); transition: color var(--ease-fast); }
.auth-link:hover { color: var(--c-primary-800); }

/* ── 22. Misc Utilities ─────────────────────────────────────── */
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full  { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--c-gray-100) 25%, var(--c-gray-200) 50%, var(--c-gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shine 1.4s ease-in-out infinite;
    border-radius: var(--r-sm);
}
@keyframes skeleton-shine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Toast */
.toast-container-custom {
    position: fixed; top: 24px; right: 24px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast-custom {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    font-size: var(--text-sm);
    min-width: 300px; max-width: 420px;
    pointer-events: auto;
    animation: toast-in 0.25s ease-out;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.toast-custom.toast-success { border-left: 4px solid var(--c-success); }
.toast-custom.toast-error   { border-left: 4px solid var(--c-danger); }
.toast-custom.toast-warning { border-left: 4px solid var(--c-warning); }
.toast-custom-icon  { flex-shrink: 0; margin-top: 1px; }
.toast-custom-title { font-weight: 700; color: var(--color-text-main); }
.toast-custom-body  { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── 23. Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    :root { --nav-w: 220px; }
    .auth-left { display: none; }
    .auth-right { width: 100%; }
}
@media (max-width: 768px) {
    .side-nav { transform: translateX(-100%); width: var(--nav-w); }
    .side-nav.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    .content-container { padding: var(--space-4); }
    .page-header { flex-direction: column; align-items: flex-start; }
    .topbar { padding: 0 var(--space-4); }
}

/* ── 24. Bootstrap Override Harmonizer ──────────────────────── */
.btn:focus, .btn:focus-visible { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); outline: none; }
.form-control:focus { border-color: var(--c-primary-400) !important; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important; }
.form-select:focus  { border-color: var(--c-primary-400) !important; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important; }
.modal-content { border-radius: var(--r-xl); border: none; box-shadow: var(--shadow-xl); }
.modal-header  { border-bottom: 1px solid var(--color-border); padding: var(--space-5) var(--space-6); }
.modal-footer  { border-top: 1px solid var(--color-border); padding: var(--space-4) var(--space-6); }
.modal-body    { padding: var(--space-5) var(--space-6); }
.toast { border-radius: var(--r-lg); }
