/* FarmManager - Custom CSS - Compact Version */

/* Color Variables */
:root {
    --earth-50: #f7f6f2;
    --earth-100: #ebe7de;
    --earth-200: #d5cbb8;
    --earth-300: #beab8d;
    --earth-400: #a78562;
    --earth-500: #956942;
    --earth-600: #7a5336;
    --earth-700: #61422d;
    --earth-800: #503627;
    --earth-900: #432e23;

    --farm-50: #f4f8f4;
    --farm-100: #e3ece3;
    --farm-200: #c5d9c5;
    --farm-300: #9ebf9e;
    --farm-400: #6d9f6d;
    --farm-500: #4a7c43;
    --farm-600: #3d6437;
    --farm-700: #33502f;
    --farm-800: #2b4228;
    --farm-900: #253623;

    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-700: #b91c1c;

    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-200: #fde68a;
    --amber-600: #d97706;
    --amber-700: #b45309;

    --green-500: #22c55e;
    --green-600: #16a34a;

    --surface-0: #ffffff;
    --surface-50: #fbfaf7;
    --surface-100: #f4f1ea;
    --border-soft: rgba(149, 105, 66, 0.14);
    --shadow-soft: 0 8px 24px rgba(33, 24, 16, 0.06);
    --shadow-strong: 0 14px 36px rgba(33, 24, 16, 0.12);
    --radius-card: 1rem;
    --radius-control: 0.8rem;
    --control-height: 2.875rem;
}

/* Base */
* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(circle at top, rgba(197, 217, 197, 0.18), transparent 28rem),
        linear-gradient(180deg, #f7f6f2 0%, #f2f2ee 100%);
    color: var(--gray-900);
    margin: 0;
    min-height: 100vh;
    font-size: 1rem;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch-friendly defaults */
@media (max-width: 767px) {
    body {
        font-size: 1rem;
        padding-bottom: 5rem;
    }

    /* Bottom Navigation */
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--earth-100);
        padding: 0.5rem;
        gap: 0.25rem;
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }

    .bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.375rem;
        color: var(--earth-400);
        text-decoration: none;
        font-size: 0.65rem;
        gap: 0.125rem;
        border-radius: 0.5rem;
        min-height: 3rem;
    }

    .bottom-nav a i {
        font-size: 1.25rem;
    }

    .bottom-nav a.active {
        color: var(--farm-600);
        background: var(--farm-50);
    }

    .btn {
        min-height: 46px;
        min-width: 46px;
    }

    .btn-icon {
        min-height: 42px;
        min-width: 42px;
    }

    .form-input,
    .form-select {
        min-height: 46px;
        font-size: 0.95rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .page-header .btn {
        width: 100%;
    }

    .modal {
        max-width: calc(100% - 1rem);
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .table-container {
        margin: 0 -0.5rem;
        border-radius: 0;
    }

    .grid {
        gap: 0.5rem;
    }

    .card {
        border-radius: 0.875rem;
    }

    .navbar-content {
        padding: 0 0.375rem;
    }

    .nav-links {
        max-height: calc(100vh - 3rem);
        overflow-y: auto;
    }

    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
    }

    .toast {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
}

/* Navigation */
.navbar {
    background-color: var(--farm-700);
    color: white;
}

@media (max-width: 767px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .nav-links {
        display: none !important;
    }

    .navbar-user {
        display: none;
    }

    .nav-dropdown-menu {
        position: static;
        background: var(--farm-800);
        box-shadow: none;
        padding-left: 1rem;
    }
}

.navbar-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
    padding: 0 0.75rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: bold;
    font-size: 1.1rem;
    min-width: 0;
}

.navbar-brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
}

.navbar-brand-logo {
    width: 3.75rem;
    height: 3.75rem;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 1rem;
    box-shadow: 0 10px 22px rgba(33, 24, 16, 0.18);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-center-action {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.navbar-bug-button {
    width: 2.3rem;
    height: 2.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.24);
    background: rgba(255,255,255,0.12);
    color: white;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.navbar-bug-button:hover {
    background: rgba(255,255,255,0.2);
}

.navbar-bug-button i {
    font-size: 1rem;
}

.navbar-user {
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.user-email {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
}

.navbar-toggle {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: block;
    border-radius: 0.65rem;
}

@media (min-width: 768px) {
    .navbar-toggle {
        display: none;
    }
}

.nav-links {
    display: none;
    flex-direction: column;
    padding: 0.25rem 0;
    margin: 0;
    list-style: none;
    background: var(--farm-700);
}

.nav-links li::marker {
    display: none;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
        flex-direction: row;
        gap: 0.25rem;
        padding-bottom: 0;
        background: transparent;
    }
    .nav-dropdown-menu {
        display: none;
    }
    .nav-dropdown-menu.show {
        display: block !important;
    }
}

.nav-links.active {
    display: flex !important;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
    border-radius: 0.6rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-link.active {
    background: rgba(255,255,255,0.25);
    color: white;
    font-weight: 600;
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-right .nav-dropdown-menu {
    left: auto;
    right: 0;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
    border-radius: 0.6rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.92rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.nav-dropdown-toggle:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-dropdown-toggle.active {
    background: rgba(255,255,255,0.25);
    color: white;
    font-weight: 600;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: var(--farm-800);
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 0.25rem 0;
}

.nav-dropdown-menu.show {
    display: block !important;
}

.nav-dropdown-menu .nav-link {
    font-size: 0.92rem;
    padding: 0.5rem 0.75rem;
}

.navbar-user .nav-dropdown-toggle {
    color: rgba(255,255,255,0.92);
}

.navbar-user .nav-dropdown-toggle:hover,
.navbar-user .nav-dropdown-toggle.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* Main Content */
.main-content {
    max-width: 84rem;
    margin: 0 auto;
    padding: 0.875rem 0.875rem 5.5rem;
}

@media (min-width: 768px) {
    .main-content {
        padding: 1.25rem 1.25rem 2rem;
    }
}

/* Buttons */
.btn {
    touch-action: manipulation;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--control-height);
    padding: 0.72rem 0.95rem;
    border-radius: var(--radius-control);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, transform 0.18s;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn i {
    font-size: 1rem;
    flex-shrink: 0;
}

.btn-primary {
    background-color: var(--farm-600);
    color: white;
    box-shadow: 0 8px 18px rgba(61, 100, 55, 0.2);
}

.btn-primary:hover {
    background-color: var(--farm-700);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--surface-0);
    color: var(--earth-600);
    border: 1px solid var(--earth-200);
}

.btn-secondary:hover {
    background-color: var(--surface-50);
    color: var(--earth-700);
}

.btn-sm {
    min-height: 2.25rem;
    padding: 0.48rem 0.72rem;
    font-size: 0.82rem;
    border-radius: 0.7rem;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: var(--surface-50);
    border: 1px solid var(--earth-100);
    color: var(--earth-500);
    cursor: pointer;
    border-radius: 0.75rem;
    transition: all 0.15s;
}

.btn-icon:hover {
    color: var(--earth-700);
    background-color: var(--surface-100);
}

.btn-icon.btn-sm {
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.65rem;
}

.btn-danger {
    color: var(--red-500);
    border-color: var(--red-100);
    background-color: var(--red-50);
}

.btn-danger:hover {
    background-color: var(--red-100);
}

.btn-success {
    background-color: #eaf6ea;
    color: var(--green-600);
    border-color: rgba(34, 197, 94, 0.16);
}

.btn-success:hover {
    background-color: #dff1df;
}

.btn-warning {
    background-color: var(--amber-50);
    color: var(--amber-700);
    border-color: var(--amber-200);
}

.btn-warning:hover {
    background-color: var(--amber-100);
}

/* Cards */
.card {
    background-color: var(--surface-0);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
    padding: 1rem;
}

.card-hover:hover {
    box-shadow: var(--shadow-strong);
    transform: translateY(-2px);
    transition: all 0.2s;
}

@media (min-width: 768px) {
    .card {
        padding: 1.25rem;
    }
}

.card-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--earth-50);
}

.card-body {
    padding: 0.75rem;
}

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

.form-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--earth-600);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.form-input,
.form-select {
    width: 100%;
    min-height: var(--control-height);
    padding: 0.72rem 0.85rem;
    border: 1px solid var(--earth-200);
    border-radius: var(--radius-control);
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
    background: var(--surface-0);
    color: var(--earth-800);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--farm-500);
    box-shadow: 0 0 0 2px rgba(74, 124, 67, 0.1);
}

.form-group.has-error .form-input,
.form-group.has-error .form-select {
    border-color: var(--red-500);
    background: var(--red-50);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}

.form-group.has-error .form-label {
    color: var(--red-700);
}

.field-error {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--red-700);
    line-height: 1.35;
}

input[type="date"].form-input,
input[type="time"].form-input {
    font-size: 0.9rem;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    color: var(--farm-600);
    border-radius: 0.25rem;
    border: var(--earth-300);
}

/* Grid */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 640px) {
    .grid-cols-3,
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.col-span-full {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Filter Row - mobile friendly */
.filter-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.filter-row .form-select {
    width: 140px;
    flex-shrink: 0;
}

.filter-row .btn {
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-row .form-select {
        width: 100%;
    }

    .filter-row .btn {
        width: 100%;
    }
}

/* Page header actions - mobile friendly */
.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
    }

    .page-header-actions .btn-text {
        display: none;
    }
}

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }

/* Spacing */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Typography */
.text-xs { font-size: 0.85rem; }
.text-sm { font-size: 0.95rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.75rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: monospace; }

.text-center { text-align: center; }
.tracking-tight { letter-spacing: -0.025em; }

.text-white { color: white; }
.text-gray-900 { color: var(--gray-900); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-earth-300 { color: var(--earth-300); }
.text-earth-400 { color: var(--earth-400); }
.text-earth-500 { color: var(--earth-500); }
.text-earth-600 { color: var(--earth-600); }
.text-earth-700 { color: var(--earth-700); }
.text-earth-800 { color: var(--earth-800); }
.text-farm-600 { color: var(--farm-600); }
.text-farm-700 { color: var(--farm-700); }
.text-green-600 { color: var(--green-600); }
.text-red-500 { color: var(--red-500); }
.text-red-600 { color: var(--red-600); }
.text-red-700 { color: var(--red-700); }
.text-amber-600 { color: var(--amber-600); }

.bg-white { background-color: white; }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-earth-50 { background-color: var(--earth-50); }
.bg-earth-100 { background-color: var(--earth-100); }
.bg-farm-50 { background-color: var(--farm-50); }
.bg-farm-100 { background-color: var(--farm-100); }
.bg-farm-600 { background-color: var(--farm-600); }
.bg-farm-700 { background-color: var(--farm-700); }
.bg-red-50 { background-color: var(--red-50); }
.bg-red-100 { background-color: var(--red-100); }
.bg-amber-50 { background-color: var(--amber-50); }
.bg-amber-100 { background-color: var(--amber-100); }
.bg-green-600 { background-color: var(--green-600); }

.bg-earth-50\/50 { background-color: rgba(247, 246, 242, 0.5); }
.bg-earth-50\/60 { background-color: rgba(247, 246, 242, 0.6); }
.bg-farm-50\/50 { background-color: rgba(244, 248, 244, 0.5); }

/* Borders */
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-style: solid; }
.border-earth-50 { border-color: var(--earth-50); }
.border-earth-100 { border-color: var(--earth-100); }
.border-earth-200 { border-color: var(--earth-200); }
.border-farm-200 { border-color: var(--farm-200); }
.border-red-200 { border-color: var(--red-200); }
.border-amber-200 { border-color: var(--amber-200); }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow-card { box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.shadow-elevated { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* Width/Height */
.w-full { width: 100%; }
.w-10 { width: 2.5rem; }
.w-11 { width: 2.75rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-28 { width: 7rem; }
.h-10 { height: 2.5rem; }
.h-11 { height: 2.75rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-28 { height: 7rem; }
.h-screen { height: 100vh; }
.max-w-md { max-width: 28rem; }
.max-w-7xl { max-width: 80rem; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-full { top: 100%; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 0.9rem;
}

@media (max-width: 767px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: white;
    border-radius: 1rem;
    width: 100%;
    max-width: min(36rem, calc(100vw - 1.8rem));
    padding: 1.15rem;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--border-soft);
    animation: modal-in 0.15s ease-out;
}

@media (max-width: 767px) {
    .modal {
        max-width: 100%;
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        border-radius: 1rem 1rem 0 0;
    }

    .modal-mobile-friendly {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 0.75rem 0.75rem 0 0;
        animation: slide-up 0.2s ease-out;
    }
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.modal-body {
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-footer .btn {
    min-width: 8rem;
}

.worker-modal {
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
}

.worker-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.worker-field-wide {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .worker-form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        min-width: 0;
    }
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.toast {
    display: flex;
    align-items: center;
    padding: 0.7rem 0.95rem;
    border-radius: 0.8rem;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-strong);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-info { background-color: var(--earth-700); }
.toast-success { background-color: var(--farm-600); }
.toast-error { background-color: var(--red-600); }

/* Tables */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.table th,
.table td {
    padding: 0.7rem 0.8rem;
    text-align: left;
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    color: var(--earth-600);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.table tbody tr {
    border-top: 1px solid var(--earth-100);
}

.table tbody tr:hover {
    background-color: rgba(247, 246, 242, 0.5);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.24rem 0.5rem;
    font-size: 0.76rem;
    border-radius: 9999px;
    font-weight: 600;
}

.badge-live {
    background-color: var(--earth-50);
    color: var(--earth-400);
}

.badge-success {
    background-color: var(--farm-100);
    color: var(--farm-700);
}

.badge-warning {
    background-color: var(--amber-100);
    color: var(--amber-700);
}

.badge-danger {
    background-color: var(--red-100);
    color: var(--red-700);
}

/* Utility */
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transition-all { transition: all 0.2s; }
.transition-colors { transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.transition-transform { transition: transform 0.2s; }
.duration-200 { transition-duration: 0.2s; }
.duration-300 { transition-duration: 0.3s; }

/* Icons */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-lg { font-size: 1.5rem; }
.icon-xl { font-size: 1.75rem; }
.icon-2xl { font-size: 2rem; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--earth-400);
}

.empty-state-icon {
    width: 3.5rem;
    height: 3.5rem;
    background-color: var(--earth-50);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.5rem;
    color: var(--earth-300);
}

/* Page Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--earth-800);
    line-height: 1.15;
    margin: 0;
}

.page-subtitle {
    font-size: 0.88rem;
    color: var(--earth-500);
    margin-top: 0.2rem;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 1.85rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }
}

/* Stat Cards */
.stat-card {
    background-color: white;
    border-radius: 0.9rem;
    padding: 0.95rem;
    box-shadow: var(--shadow-soft);
}

.stat-icon {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-value {
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-top: 0.25rem;
}

.stat-label {
    font-size: 0.76rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.responsive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.responsive-toolbar > * {
    min-width: 0;
}

.stack-on-mobile {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .stack-on-mobile {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .stack-on-mobile .form-input,
    .stack-on-mobile .form-select {
        width: 100% !important;
    }
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Animations */
.animate-fade-in {
    animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* List */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.375rem;
    border-bottom: 1px solid rgba(235, 231, 222, 0.5);
    transition: background-color 0.15s;
    margin: 0 -0.375rem;
    border-radius: 0.375rem;
}

.list-item:hover {
    background-color: rgba(247, 246, 242, 0.5);
}

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

/* Alert */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid;
    font-size: 0.9rem;
}

.alert-info {
    background-color: var(--farm-50);
    border-color: var(--farm-200);
    color: var(--farm-700);
}

.alert-warning {
    background-color: var(--amber-50);
    border-color: var(--amber-200);
    color: var(--amber-700);
}

.alert-danger {
    background-color: var(--red-50);
    border-color: var(--red-200);
    color: var(--red-700);
}

/* Tab */
.tabs {
    display: flex;
    gap: 0.35rem;
    background-color: rgba(235, 231, 222, 0.55);
    padding: 0.35rem;
    border-radius: 0.9rem;
    width: 100%;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.tab {
    flex: 1 0 auto;
    min-height: 2.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 0.7rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--earth-600);
    cursor: pointer;
    border: none;
    background: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.tab:hover {
    background-color: white;
}

.tab.active {
    background-color: white;
    color: var(--earth-800);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Weather Widget */
.weather-widget {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.weather-stat {
    text-align: center;
    padding: 0.5rem;
    background-color: rgba(247, 246, 242, 0.5);
    border-radius: 0.5rem;
}

.weather-stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--earth-700);
}

.weather-stat-label {
    font-size: 0.65rem;
    color: var(--earth-400);
}

/* Recording button animation */
.recording {
    animation: pulse-recording 1s ease-in-out infinite;
}

.recording-icon {
    animation: pulse-icon 1s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

@keyframes pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
