/* ══════════════════════════════════════════════
   PTAR System — Midnight Navy with Luminous Accents
   No es negro: es azul profundo con detalles claros
   ══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Core — Azul profundo en vez de negro puro */
    --bg-deep: #0D1B2A;
    --bg-surface: #132237;
    --bg-card: #17293D;
    --bg-card-hover: #1C3350;
    --bg-elevated: #213B55;

    /* Accent — Aguamarina luminosa */
    --accent: #00E5B8;
    --accent-glow: rgba(0, 229, 184, 0.18);
    --accent-muted: #00BF9A;
    --accent-subtle: rgba(0, 229, 184, 0.07);
    --accent-strong: #00FFD0;

    /* Semantic con mas brillo */
    --success: #3DDBA4;
    --warning: #FFD166;
    --danger: #FF6B6B;
    --info: #74B9FF;

    /* Text — mas contraste, no gris muerto */
    --text-primary: #EDF2F7;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #0D1B2A;

    /* Borders — mas visibles */
    --border: rgba(148, 163, 184, 0.12);
    --border-accent: rgba(0, 229, 184, 0.3);
    --border-light: rgba(148, 163, 184, 0.2);

    /* Type */
    --font-main: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    /* Sidebar */
    --sidebar-width: 264px;
}

/* ── RESET & BASE ──────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-strong);
}

input,
select,
textarea,
button {
    font-family: inherit;
    font-size: inherit;
}

/* ── SCROLLBAR ─────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ── LAYOUT ────────────────────────────────── */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* ── SIDEBAR ───────────────────────────────── */
.sidebar {
    background: linear-gradient(180deg, #101E30 0%, #0D1B2A 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem 1.3rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    width: 80px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #00887A);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: var(--text-inverse);
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(0, 229, 184, 0.25);
}

.sidebar-brand-text h1 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.sidebar-brand-text span {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.8rem 0;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.62rem;
    color: var(--accent-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 1.1rem 1.3rem 0.35rem;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0.58rem 1.3rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.18s;
    border-left: 3px solid transparent;
    cursor: pointer;
    margin: 1px 0;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(0, 229, 184, 0.06);
    border-left-color: rgba(0, 229, 184, 0.3);
}

.nav-link.active {
    color: var(--accent);
    background: rgba(0, 229, 184, 0.1);
    border-left-color: var(--accent);
    font-weight: 500;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}

.nav-link:hover svg {
    opacity: 0.85;
}

.nav-link.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1.3rem;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    border: 2px solid var(--border-accent);
}

.user-info-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-info-role {
    font-size: 0.68rem;
    color: var(--accent-muted);
}

.btn-logout {
    margin-top: 0.8rem;
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.18s;
    letter-spacing: 0.02em;
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 107, 107, 0.06);
}

/* ── MAIN CONTENT ──────────────────────────── */
.main-content {
    grid-column: 2;
    padding: 1.5rem 2rem;
    max-width: 1600px;
    overflow-x: hidden;
}

/* ── PAGE HEADER ───────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-actions {
    display: flex;
    gap: 8px;
}

/* ── BUTTONS — mucho mas visibles ──────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-light);
    transition: all 0.18s;
    background: var(--bg-elevated);
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-muted));
    color: var(--text-inverse);
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 229, 184, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    box-shadow: 0 4px 18px rgba(0, 229, 184, 0.35);
    transform: translateY(-1px);
}

.btn-danger {
    border-color: rgba(255, 107, 107, 0.4);
    color: var(--danger);
    background: rgba(255, 107, 107, 0.08);
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: var(--danger);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.74rem;
    border-radius: 6px;
    min-width: 62px;
    justify-content: center;
}

/* Contenedor de acciones en tabla — botones en linea */
.action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

/* Boton Editar — azul claro */
.btn-edit {
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid rgba(116, 185, 255, 0.3);
    color: var(--info);
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    font-size: 0.74rem;
    border-radius: 6px;
    min-width: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-edit:hover {
    background: rgba(116, 185, 255, 0.2);
    border-color: var(--info);
    color: #A5D8FF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(116, 185, 255, 0.15);
}

/* Boton Eliminar — rojo, mismo tamano que Editar */
.btn-del {
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.25);
    color: var(--danger);
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    font-size: 0.74rem;
    border-radius: 6px;
    min-width: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-del:hover {
    background: rgba(255, 107, 107, 0.18);
    border-color: var(--danger);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.15);
}

/* ── KPI GRID — con mas presencia ─────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 14px;
    margin-bottom: 1.8rem;
}

.kpi-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-surface));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.3rem;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}

.kpi-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 229, 184, 0.08);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
    font-weight: 500;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.kpi-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.kpi-trend.up {
    color: var(--success);
    background: rgba(61, 219, 164, 0.12);
}

.kpi-trend.down {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.12);
}

.kpi-accent .kpi-value {
    color: var(--accent);
}

.kpi-warn .kpi-value {
    color: var(--warning);
}

.kpi-danger .kpi-value {
    color: var(--danger);
}

/* ── PROGRESS BAR ──────────────────────────── */
.progress-bar {
    height: 5px;
    border-radius: 3px;
    background: rgba(148, 163, 184, 0.1);
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    transition: width 0.8s ease;
}

/* ── CARDS & SECTIONS ──────────────────────── */
.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.8rem 0 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-light), transparent);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.3rem;
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 14px;
    margin-bottom: 1.5rem;
}

/* ── TABLES ────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

table.dt {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

table.dt thead {
    background: var(--bg-surface);
}

table.dt th {
    padding: 0.75rem 1rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-surface);
}

table.dt td {
    padding: 0.68rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}

table.dt tbody tr {
    transition: all 0.12s;
}

table.dt tbody tr:hover {
    background: rgba(0, 229, 184, 0.04);
}

table.dt tbody tr:hover td {
    color: var(--text-primary);
}

/* ── BADGES — mas definidos ───────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.badge-ok {
    background: rgba(61, 219, 164, 0.14);
    color: var(--success);
    border: 1px solid rgba(61, 219, 164, 0.2);
}

.badge-warn {
    background: rgba(255, 209, 102, 0.14);
    color: var(--warning);
    border: 1px solid rgba(255, 209, 102, 0.2);
}

.badge-danger {
    background: rgba(255, 107, 107, 0.14);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.badge-info {
    background: rgba(116, 185, 255, 0.14);
    color: var(--info);
    border: 1px solid rgba(116, 185, 255, 0.2);
}

.badge-prev {
    background: rgba(167, 139, 250, 0.14);
    color: #A78BFA;
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.badge-corr {
    background: rgba(251, 146, 60, 0.14);
    color: #FB923C;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

/* ── STATUS DOTS ───────────────────────────── */
.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 7px;
}

.dot-ok {
    background: var(--success);
    box-shadow: 0 0 8px rgba(61, 219, 164, 0.5);
}

.dot-warn {
    background: var(--warning);
    box-shadow: 0 0 8px rgba(255, 209, 102, 0.5);
}

.dot-off {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

/* ── PLANT CARDS ───────────────────────────── */
.plant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
}

.plant-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    cursor: pointer;
    transition: all 0.22s;
}

.plant-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 229, 184, 0.08);
}

.plant-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.plant-stat {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── FORMS ─────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.62rem 0.9rem;
    background: var(--bg-deep);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.87rem;
    transition: all 0.18s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(13, 27, 42, 0.8);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

/* ── MODAL — mas presencia visual ─────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 15, 25, 0.8);
    backdrop-filter: blur(6px);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: linear-gradient(160deg, #1A2E44, var(--bg-card));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.6rem;
    animation: modalIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 229, 184, 0.06);
}

@keyframes modalIn {
    from {
        transform: translateY(24px) scale(0.96);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.3rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-close:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(255, 107, 107, 0.1);
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ── TABS — resaltados ─────────────────────── */
.tab-bar {
    display: flex;
    gap: 3px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 1.4rem;
    overflow-x: auto;
    border: 1px solid var(--border);
}

.tab-btn {
    padding: 0.52rem 1.05rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-muted));
    color: var(--text-inverse);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 229, 184, 0.2);
}

.tab-panel {
    display: none;
}

.tab-panel.visible {
    display: block;
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── TIMELINE ──────────────────────────────── */
.timeline {
    padding-left: 26px;
    border-left: 2px solid var(--border-light);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.3rem;
    padding-left: 18px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2.5px solid var(--bg-card);
    box-shadow: 0 0 6px rgba(0, 229, 184, 0.3);
}

.timeline-item.danger::before {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(255, 107, 107, 0.3);
}

.timeline-item.warn::before {
    background: var(--warning);
    box-shadow: 0 0 6px rgba(255, 209, 102, 0.3);
}

.timeline-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.timeline-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 3px;
}

.timeline-loc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── TOAST ─────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    min-width: 290px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.toast button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

/* ── LOGIN PAGE ────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0A1628, var(--bg-deep), #0D2137);
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: linear-gradient(160deg, var(--bg-card), var(--bg-surface));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--accent), #00887A);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-inverse);
    font-weight: 700;
    margin-bottom: 14px;
    box-shadow: 0 6px 20px rgba(0, 229, 184, 0.25);
}

.login-brand h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.login-brand p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-error {
    display: none;
    padding: 0.65rem 0.9rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.login-error.show {
    display: block;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-muted));
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(0, 229, 184, 0.25);
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    box-shadow: 0 6px 20px rgba(0, 229, 184, 0.35);
    transform: translateY(-1px);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── HAMBURGER (mobile) ────────────────────── */
.hamburger {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
}

/* ── RESPONSIVE ────────────────────────────── */
@media (min-width: 2500px) {
    html {
        font-size: 18px;
    }

    .main-content {
        padding: 2rem 3rem;
        max-width: 2200px;
    }

    .kpi-grid {
        grid-template-columns: repeat(8, 1fr);
    }

    .kpi-value {
        font-size: 2.2rem;
    }

    .charts-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .plant-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1920px) and (max-width: 2499px) {
    html {
        font-size: 16px;
    }

    .kpi-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        grid-column: 1;
        padding: 1rem;
        padding-top: 3.5rem;
    }

    .hamburger {
        display: flex;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .plant-grid {
        grid-template-columns: 1fr;
    }

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

    .modal {
        width: 95%;
        padding: 1.2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tab-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }
}

/* ── CHART CONTAINERS ──────────────────────── */
.chart-container {
    position: relative;
    width: 100%;
    height: 260px;
}

@media (min-width: 2500px) {
    .chart-container {
        height: 360px;
    }
}

/* ── LOADING SKELETON ──────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── EMPTY STATE ───────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.85rem;
}