/* ═══════════════════════════════════════════════════════════
   Mi Plataforma Personal — Design System
   Dark navy + white + green (#57cc98) · Poppins · Visual
   ═══════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    /* Brand – Dark navy blue */
    --brand-dark: #0f1923;
    --brand: #162231;
    --brand-light: #1e2d3f;
    --brand-end: #111d2a;

    /* Accent – Green */
    --gold: #57cc98;
    --gold-hover: #45b584;
    --gold-muted: rgba(87, 204, 152, 0.15);

    /* Functional greens */
    --green-action: #57cc98;
    --green-action-hover: #45b584;

    /* Module colors */
    --color-ideas: #f59e0b;
    --color-notas: #3b82f6;
    --color-tareas: #57cc98;
    --color-enlaces: #8b5cf6;
    --color-inventario: #f97316;
    --color-contabilidad: #06b6d4;
    --color-tableros: #ec4899;

    /* Surfaces */
    --bg: #f4f6f8;
    --surface: #FFFFFF;
    --surface-alt: #f0f2f5;
    --surface-hover: #eaedf1;

    /* Borders */
    --border: #dde1e6;
    --border-light: #e8ecf0;

    /* Text */
    --text: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-inverse: #FFFFFF;

    /* Accent link */
    --accent: #57cc98;
    --accent-hover: #45b584;
    --accent-light: rgba(87, 204, 152, 0.08);

    /* Status */
    --success: #009688;
    --success-light: #e6f7f5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #3b82f6;
    --info-light: #eff6ff;

    /* Focus */
    --focus-ring: #57cc98;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.14);

    /* Shape */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 999px;

    /* Spacing (8pt base) */
    --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;

    /* Layout */
    --header-height: 64px;
    --sidebar-width: 240px;

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


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

::selection {
    background: rgba(87, 204, 152, 0.25);
    color: var(--text);
}

/* ─── Base ─── */
body {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

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


/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5c9d0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0a5ad; }


/* ─── Environment accents ─── */
body[data-env="local"] {
    --env-accent: #57cc98;
    --env-surface: rgba(87, 204, 152, 0.08);
    --env-border: rgba(87, 204, 152, 0.24);
}

body[data-env="shared-dev"] {
    --env-accent: #f59e0b;
    --env-surface: rgba(245, 158, 11, 0.08);
    --env-border: rgba(245, 158, 11, 0.24);
}

body[data-env="production"] {
    --env-accent: #ef4444;
    --env-surface: rgba(239, 68, 68, 0.08);
    --env-border: rgba(239, 68, 68, 0.24);
}


/* ─── Keyframes ─── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════
   HEADER
   ═══════════════════════════════════════ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--brand-dark);
    display: flex;
    align-items: center;
    padding: 0 var(--space-8);
    z-index: 200;
    box-shadow: 0 2px 12px rgba(15, 25, 35, 0.35);
}

.header-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.header-logo .logo-accent {
    color: var(--green-action);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

.header-env-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: var(--env-accent, var(--green-action));
    color: var(--text-inverse);
    border: none;
    font-family: inherit;
}

.header-env-badge--clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-env-badge--clickable:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.65);
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    text-decoration: none;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-inverse);
}

.header-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: var(--space-2);
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--green-action);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.header-username {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 400;
}


/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--brand);
    padding: var(--space-5) 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: width var(--duration-normal) var(--ease-smooth);
}

.sidebar-logo {
    display: none;
}

.nav-section {
    margin-bottom: var(--space-2);
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    padding: var(--space-4) var(--space-6) var(--space-2);
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 11px var(--space-6);
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 400;
    transition: all var(--duration-fast) ease;
    cursor: pointer;
    position: relative;
    border-left: 3px solid transparent;
}

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

.nav-link.active {
    background: rgba(87, 204, 152, 0.1);
    color: var(--green-action);
    border-left-color: var(--green-action);
    font-weight: 500;
}

.nav-link .icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-link .icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
}

.nav-link.active .icon svg {
    stroke: var(--green-action);
}

.nav-link .badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

.nav-link.active .badge {
    background: rgba(87, 204, 152, 0.15);
    color: var(--green-action);
}

.sidebar-user {
    margin-top: auto;
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--green-action);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    padding: 5px var(--space-3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.78rem;
    text-decoration: none;
    transition: all var(--duration-fast) ease;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 500;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ff6b6b;
    border-color: rgba(239, 68, 68, 0.2);
}


/* ═══════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════ */
.main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    flex: 1;
    padding: var(--space-8) var(--space-10);
    min-height: calc(100vh - var(--header-height));
    animation: fadeIn var(--duration-normal) ease;
}

.page-header {
    margin-bottom: var(--space-8);
    animation: fadeInUp var(--duration-normal) ease;
}

.page-header h1 {
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-header h1 svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.75;
    color: var(--green-action);
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: var(--space-1);
    font-weight: 400;
}


/* ─── Runtime banner ─── */
.runtime-banner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--env-border, var(--border-light));
    border-radius: var(--radius);
    background: var(--env-surface, var(--surface-alt));
    animation: fadeInUp var(--duration-normal) ease 0.1s both;
}

.runtime-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 6px var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--env-accent, var(--green-action));
    color: var(--text-inverse);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.runtime-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.runtime-copy strong {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.runtime-copy span {
    color: var(--text-muted);
    font-size: 0.82rem;
    word-break: break-word;
}

.runtime-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}


/* ═══════════════════════════════════════
   STATS GRID (colorful icons)
   ═══════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    animation: fadeInUp var(--duration-normal) ease both;
}

.stat-card:nth-child(1) { animation-delay: 0.03s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.09s; }
.stat-card:nth-child(4) { animation-delay: 0.12s; }
.stat-card:nth-child(5) { animation-delay: 0.15s; }
.stat-card:nth-child(6) { animation-delay: 0.18s; }
.stat-card:nth-child(7) { animation-delay: 0.21s; }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
}

.stat-card .icon-big {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

/* Each module gets its own icon color */
.stat-card:nth-child(1) .icon-big { background: rgba(245, 158, 11, 0.12); color: var(--color-ideas); }
.stat-card:nth-child(2) .icon-big { background: rgba(59, 130, 246, 0.12); color: var(--color-notas); }
.stat-card:nth-child(3) .icon-big { background: rgba(87, 204, 152, 0.12); color: var(--color-tareas); }
.stat-card:nth-child(4) .icon-big { background: rgba(139, 92, 246, 0.12); color: var(--color-enlaces); }
.stat-card:nth-child(5) .icon-big { background: rgba(249, 115, 22, 0.12); color: var(--color-inventario); }
.stat-card:nth-child(6) .icon-big { background: rgba(6, 182, 212, 0.12); color: var(--color-contabilidad); }
.stat-card:nth-child(7) .icon-big { background: rgba(236, 72, 153, 0.12); color: var(--color-tableros); }

.stat-card .icon-big svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.75;
}

.stat-card .label {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: var(--space-1);
    color: var(--text);
    letter-spacing: -0.03em;
}


/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.card-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.card-header h2 svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
    color: var(--green-action);
}

.card-header a {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--green-action);
}

.card-header a:hover {
    color: var(--green-action-hover);
}


/* ═══════════════════════════════════════
   TABLES
   ═══════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    background: var(--surface-alt);
}

td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.92rem;
}

tr:hover td { background: var(--surface-hover); }


/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px var(--space-5);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
}

.btn svg { width: 18px; height: 18px; stroke-width: 1.75; }

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

.btn-primary:hover {
    background: var(--brand-light);
    border-color: var(--brand-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--surface-alt);
    border-color: var(--border);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--surface-alt);
    color: var(--text);
}

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

.btn-gold:hover {
    background: var(--green-action-hover);
    border-color: var(--green-action-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(87, 204, 152, 0.3);
}

.btn-sm { padding: 5px 12px; font-size: 0.82rem; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}


/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */
.form-group { margin-bottom: var(--space-5); }

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 11px var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.form-control:focus {
    border-color: var(--green-action);
    box-shadow: 0 0 0 3px rgba(87, 204, 152, 0.15);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--green-action);
    cursor: pointer;
}


/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 25, 35, 0.5);
    backdrop-filter: blur(4px);
    z-index: 300;
    justify-content: center;
    align-items: center;
}

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

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease-out;
}

.modal h2 {
    margin: 0;
    padding: var(--space-5) var(--space-6);
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: var(--brand-dark);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal form { padding: var(--space-6); }

.modal-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-light);
}


/* ═══════════════════════════════════════
   TAGS
   ═══════════════════════════════════════ */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    background: var(--surface-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    margin: 2px;
    font-weight: 500;
}


/* ═══════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 56px var(--space-8);
    color: var(--text-muted);
}

.empty-state .icon-huge {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: var(--surface-alt);
    color: var(--text-muted);
    margin: 0 auto var(--space-5);
}

.empty-state .icon-huge svg { width: 32px; height: 32px; stroke-width: 1.5; }
.empty-state p { margin-bottom: var(--space-5); font-size: 0.95rem; }


/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-4));
    right: var(--space-6);
    z-index: 400;
}

.toast {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-6);
    margin-bottom: var(--space-2);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.92rem;
    color: var(--text);
    transition: opacity 0.3s, transform 0.3s;
}

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


/* ═══════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════ */
.search-bar {
    position: relative;
    margin-bottom: var(--space-6);
    animation: fadeInUp var(--duration-normal) ease 0.1s both;
}

.search-bar input {
    width: 100%;
    padding: 14px var(--space-5) 14px 48px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar input:focus {
    border-color: var(--green-action);
    box-shadow: 0 0 0 3px rgba(87, 204, 152, 0.12);
}

.search-bar .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: var(--space-1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 150;
    box-shadow: var(--shadow-xl);
    display: none;
}

.search-results.active { display: block; }

.search-result-item {
    padding: var(--space-3) var(--space-5);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s ease;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-alt); }

.search-result-item .result-type {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--green-action);
    margin-bottom: 2px;
    font-weight: 600;
}

.search-result-item .result-title {
    font-size: 0.92rem;
    color: var(--text);
}


/* ═══════════════════════════════════════
   ACTIVITY LIST
   ═══════════════════════════════════════ */
.activity-item {
    display: flex;
    align-items: start;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border-light);
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: rgba(87, 204, 152, 0.1);
    color: var(--green-action);
    flex-shrink: 0;
}

.activity-icon svg { width: 20px; height: 20px; stroke-width: 1.75; }

.activity-text { flex: 1; min-width: 0; }

.activity-text strong {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.activity-text small {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 3px;
}


/* ═══════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════ */
.alert {
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: var(--space-5);
    font-size: 0.92rem;
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}

.alert svg { width: 22px; height: 22px; stroke-width: 1.75; flex-shrink: 0; margin-top: 1px; }

.alert-danger { background: var(--danger-light); border-color: rgba(239,68,68,0.2); color: var(--danger); }
.alert-success { background: var(--success-light); border-color: rgba(0,150,136,0.2); color: var(--success); }
.alert-warning { background: var(--warning-light); border-color: rgba(245,158,11,0.2); color: var(--warning); }


/* ═══════════════════════════════════════
   PRIORITY / INFRA / FINANCE
   ═══════════════════════════════════════ */
.priority-high { border-left: 4px solid var(--warning) !important; }
.priority-urgent { border-left: 4px solid var(--danger) !important; }

.btn-infra {
    background: #fff;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    font-size: 0.92rem;
}

.btn-infra:hover {
    background: var(--surface-alt);
    border-color: var(--border);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-infra svg { width: 20px; height: 20px; stroke-width: 1.75; }

.finance-cell { text-align: center; padding: var(--space-4); }

.finance-cell .finance-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.finance-cell .finance-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: var(--space-1);
}


/* ═══════════════════════════════════════
   WELCOME BANNER (dashboard)
   ═══════════════════════════════════════ */
.welcome-banner {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-light) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-10) var(--space-8);
    margin-bottom: var(--space-8);
    color: #fff;
    position: relative;
    overflow: hidden;
    animation: fadeInUp var(--duration-normal) ease;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%; right: -5%;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(87, 204, 152, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -40%; left: 15%;
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-banner h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    position: relative;
    color: #fff;
    background: none;
    padding: 0;
    border-radius: 0;
}

.welcome-banner p {
    opacity: 0.65;
    font-size: 0.95rem;
    position: relative;
}


/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        flex-direction: row;
        overflow-x: auto;
        padding: var(--space-2);
        background: var(--brand);
    }

    body { flex-direction: column; }

    .sidebar-logo { display: none; }
    .nav-section-title { display: none; }
    .sidebar-user { display: none; }

    .nav-section {
        display: flex;
        gap: var(--space-1);
    }

    .nav-link {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: var(--space-2) var(--space-3);
        white-space: nowrap;
        font-size: 0.85rem;
    }

    .nav-link.active {
        border-bottom-color: var(--green-action);
        border-left-color: transparent;
    }

    .main {
        margin-left: 0;
        margin-top: var(--header-height);
        padding: var(--space-5);
    }

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

    .runtime-banner { flex-direction: column; align-items: flex-start; }

    .runtime-actions { margin-left: 0; width: 100%; }
    .runtime-actions .btn { width: 100%; justify-content: center; }

    .app-header { padding: 0 var(--space-4); }
    .header-username { display: none; }

    div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}
