/* ============================================================
   IndustriaMG — Diseño moderno minimalista
   Paleta: Naranja (#f97316) · Cambiar a celeste: sustituir
   #f97316 → #06b6d4  y  #ea580c → #0891b2  en :root
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta principal — Naranja */
    --primary:         #f97316;
    --primary-dark:    #ea580c;
    --primary-light:   #fff7ed;
    --primary-glow:    rgba(249,115,22,.15);

    /* Semáforo */
    --success:         #10b981;
    --success-light:   #ecfdf5;
    --warning:         #f59e0b;
    --warning-light:   #fffbeb;
    --danger:          #ef4444;
    --danger-light:    #fef2f2;
    --info:            #06b6d4;
    --info-light:      #ecfeff;

    /* Layout */
    --sidebar-bg:      #ffffff;
    --sidebar-hover:   #f8fafc;
    --sidebar-active-bg: #fff7ed;
    --sidebar-text:    #64748b;
    --sidebar-width:   248px;

    --topbar-bg:       #ffffff;
    --topbar-height:   58px;
    --topbar-border:   #f1f5f9;

    --body-bg:         #f8fafc;
    --card-bg:         #ffffff;
    --card-border:     #f1f5f9;
    --card-shadow:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --card-shadow-md:  0 4px 16px rgba(0,0,0,.08);

    --text-primary:    #0f172a;
    --text-secondary:  #64748b;
    --text-muted:      #94a3b8;
    --border:          #e2e8f0;

    /* Forma */
    --radius:          10px;
    --radius-sm:       7px;
    --radius-xs:       5px;
    --radius-full:     999px;

    --font:            'Inter', -apple-system, sans-serif;
    --transition:      .18s cubic-bezier(.4,0,.2,1);
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font);
    background: var(--body-bg);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: -.01em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, select, textarea, button { font-family: var(--font); font-size: .875rem; }

/* ============================================================
   SIDEBAR — oscuro con acento naranja
   ============================================================ */
.sidebar, .main-wrapper { transition: width .2s ease, min-width .2s ease, margin-left .2s ease; }
html.sidebar-collapsed .sidebar      { width: 64px; min-width: 64px; overflow: hidden; }
html.sidebar-collapsed .main-wrapper { margin-left: 64px; }
html.sidebar-collapsed .sidebar-logo { justify-content: center; padding: 14px 0; }
html.sidebar-collapsed .sidebar-logo > div { display: none; }
html.sidebar-collapsed .nav-section  { display: none; }
html.sidebar-collapsed .nav-item span:not(.nav-icon) { display: none; }
html.sidebar-collapsed .nav-item     { justify-content: center; padding: 10px 0; }
html.sidebar-collapsed .sidebar-footer { justify-content: center; padding: 12px 0; }
html.sidebar-collapsed .sidebar-footer > div:last-child { display: none; }

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 200;
    overflow: hidden;
    border-right: 1px solid #e2e8f0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: var(--topbar-height);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.sidebar-logo .logo-icon {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-weight: 800; font-size: .9rem; color: #fff;
    box-shadow: 0 4px 12px rgba(249,115,22,.4);
}
.sidebar-logo .logo-text {
    font-size: .95rem; font-weight: 700;
    color: #0f172a; letter-spacing: -.02em;
    white-space: nowrap;
}
.sidebar-logo .logo-sub {
    font-size: .65rem; color: var(--sidebar-text);
    white-space: nowrap; font-weight: 400;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-section {
    padding: 10px 10px 4px;
    font-size: .6rem; font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase; letter-spacing: 1px;
    margin-top: 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    color: var(--sidebar-text);
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    border-left: 2px solid transparent;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    font-size: .82rem; font-weight: 500;
}
.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--primary);
}
.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}
.nav-item .nav-icon {
    font-size: .95rem; width: 18px; text-align: center; flex-shrink: 0;
    opacity: .7;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: .58rem; font-weight: 700;
    padding: 2px 6px; border-radius: var(--radius-full);
    min-width: 18px; text-align: center;
}

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
}
.sidebar-footer .user-avatar {
    width: 32px; height: 32px; border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: .82rem; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(249,115,22,.35);
}
.sidebar-footer .user-name  { font-size: .8rem; color: #0f172a; font-weight: 600; white-space: nowrap; }
.sidebar-footer .user-role  { font-size: .68rem; color: var(--sidebar-text); white-space: nowrap; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* TOPBAR */
.topbar {
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex; align-items: center;
    padding: 0 24px; gap: 12px;
    position: sticky; top: 0; z-index: 100;
    flex-shrink: 0;
}
.topbar-title {
    font-size: 1rem; font-weight: 700;
    color: var(--text-primary); letter-spacing: -.02em;
}
.topbar-breadcrumb {
    font-size: .75rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px; margin-top: 1px;
}
.topbar-breadcrumb span { color: var(--text-muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.topbar-btn {
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: .95rem;
    transition: background var(--transition), color var(--transition);
    position: relative;
}
.topbar-btn:hover { background: var(--body-bg); color: var(--text-primary); }
.topbar-btn .badge {
    position: absolute; top: -3px; right: -3px;
    background: var(--danger); color: #fff;
    font-size: .55rem; font-weight: 700;
    width: 15px; height: 15px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* CONTENT */
.content { flex: 1; padding: 22px 24px; overflow-y: auto; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.card-title {
    font-size: .88rem; font-weight: 600;
    color: var(--text-primary); letter-spacing: -.01em;
}
.card-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.card-body { padding: 20px; }

/* KPI CARDS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex; align-items: flex-start; gap: 14px;
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover { box-shadow: var(--card-shadow-md); transform: translateY(-1px); }
.kpi-icon {
    width: 44px; height: 44px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.kpi-icon.blue   { background: linear-gradient(135deg,#dbeafe,#eff6ff); color: #3b82f6; }
.kpi-icon.green  { background: linear-gradient(135deg,#d1fae5,#ecfdf5); color: var(--success); }
.kpi-icon.orange { background: linear-gradient(135deg,#fed7aa,#fff7ed); color: var(--primary); }
.kpi-icon.red    { background: linear-gradient(135deg,#fecaca,#fef2f2); color: var(--danger); }
.kpi-icon.cyan   { background: linear-gradient(135deg,#a5f3fc,#ecfeff); color: var(--info); }
.kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; letter-spacing: -.03em; }
.kpi-label { font-size: .72rem; color: var(--text-secondary); margin-top: 3px; font-weight: 500; }
.kpi-sub   { font-size: .68rem; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
thead th {
    background: #fafafa;
    color: var(--text-muted);
    font-weight: 600; font-size: .68rem;
    text-transform: uppercase; letter-spacing: .6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap; text-align: left;
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #fafafa; }
tbody td { padding: 10px 14px; color: var(--text-primary); vertical-align: middle; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: var(--radius-full);
    font-size: .68rem; font-weight: 600; white-space: nowrap;
    letter-spacing: .02em;
}
.badge::before {
    content: '';
    width: 5px; height: 5px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}

.badge-fabricacion { background: #dbeafe; color: #2563eb; }
.badge-pruebas     { background: #fef3c7; color: #d97706; }
.badge-entrega     { background: #d1fae5; color: #059669; }
.badge-completado  { background: #f0fdf4; color: #16a34a; }
.badge-cancelado   { background: #f8fafc; color: #94a3b8; }
.badge-retrasado   { background: #fef2f2; color: #dc2626; }

.badge-pendiente   { background: #fef3c7; color: #d97706; }
.badge-aprobada    { background: #d1fae5; color: #059669; }
.badge-rechazada   { background: #fef2f2; color: #dc2626; }
.badge-procesada   { background: #dbeafe; color: #2563eb; }

/* Alias semánticos usados por módulos */
.badge-success     { background: #d1fae5; color: #059669; }
.badge-warning     { background: #fef3c7; color: #d97706; }
.badge-danger      { background: #fef2f2; color: #dc2626; }
.badge-primary     { background: #dbeafe; color: #2563eb; }
.badge-secondary   { background: #f1f5f9; color: #64748b; }
/* Estados OC */
.badge-emitida          { background: #fef3c7; color: #d97706; }
.badge-enviada          { background: #dbeafe; color: #2563eb; }
.badge-recibida_parcial { background: #fed7aa; color: #c2410c; }
.badge-recibida         { background: #d1fae5; color: #059669; }
.badge-anulada          { background: #fef2f2; color: #dc2626; }
/* Estados recepción */
.badge-conforme         { background: #d1fae5; color: #059669; }
.badge-disconforme      { background: #fef3c7; color: #d97706; }
.badge-devuelto         { background: #fef2f2; color: #dc2626; }

.badge-activo      { background: #d1fae5; color: #059669; }
.badge-inactivo    { background: #f8fafc; color: #94a3b8; }
.badge-prospecto   { background: #ede9fe; color: #7c3aed; }

.badge-alta        { background: #fef2f2; color: #dc2626; }
.badge-urgente     { background: linear-gradient(135deg,#fce7f3,#fdf2f8); color: #be185d; }
.badge-normal      { background: #f1f5f9; color: #64748b; }
.badge-baja        { background: #f8fafc; color: #94a3b8; }

.badge-entrada     { background: #d1fae5; color: #059669; }
.badge-salida      { background: #fef2f2; color: #dc2626; }
.badge-ajuste      { background: #fef3c7; color: #d97706; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: .8rem; font-weight: 600; cursor: pointer;
    border: none; letter-spacing: -.01em;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(249,115,22,.3);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(249,115,22,.4);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success); color: #fff;
    box-shadow: 0 2px 8px rgba(16,185,129,.25);
}
.btn-success:hover { background: #059669; transform: translateY(-1px); }

.btn-danger {
    background: var(--danger); color: #fff;
    box-shadow: 0 2px 8px rgba(239,68,68,.25);
}
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }

.btn-warning {
    background: var(--warning); color: #fff;
    box-shadow: 0 2px 8px rgba(245,158,11,.25);
}
.btn-warning:hover { background: #d97706; transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--body-bg);
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.btn-sm  { padding: 6px 12px; font-size: .75rem; }
.btn-xs  { padding: 3px 9px;  font-size: .7rem; }
.btn-icon {
    width: 32px; height: 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; margin-bottom: 6px;
    font-size: .75rem; font-weight: 600;
    color: var(--text-secondary); letter-spacing: .01em;
}
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-primary);
    font-size: .83rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control::placeholder { color: var(--text-muted); }
.form-row { display: grid; gap: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2394a3b8' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

/* ============================================================
   TOOLBAR / FILTERS
   ============================================================ */
.toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 0 0 16px; flex-wrap: wrap;
}
.toolbar-left  { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.search-box { position: relative; }
.search-box input { width: 230px; padding-left: 34px; }
.search-box .icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: .82rem; pointer-events: none;
}

/* ============================================================
   PROJECT CARDS
   ============================================================ */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.project-card {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    cursor: pointer;
}
.project-card:hover {
    box-shadow: var(--card-shadow-md);
    transform: translateY(-2px);
    border-color: #e2e8f0;
}
.project-card.retrasado {
    border-left: 3px solid var(--danger);
}
.project-card.retrasado:hover { border-color: var(--danger); }

.project-card-header {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--card-border);
    display: flex; align-items: flex-start; gap: 10px;
}
.project-code {
    font-size: .65rem; font-weight: 700;
    color: var(--primary); letter-spacing: .5px;
    text-transform: uppercase;
}
.project-name {
    font-size: .88rem; font-weight: 700;
    color: var(--text-primary); margin-top: 2px;
    line-height: 1.3; letter-spacing: -.01em;
}
.project-client {
    font-size: .73rem; color: var(--text-secondary);
    margin-top: 4px; display: flex; align-items: center; gap: 4px;
}

.project-card-body { padding: 14px 18px; }
.project-meta {
    display: flex; gap: 14px; margin-bottom: 12px; flex-wrap: wrap;
}
.project-meta-item { display: flex; flex-direction: column; gap: 2px; }
.project-meta-label { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 500; }
.project-meta-value { font-size: .8rem; font-weight: 600; color: var(--text-primary); }

.progress-bar-wrap {
    margin: 6px 0 3px;
    height: 5px; background: #f1f5f9;
    border-radius: var(--radius-full); overflow: hidden;
}
.progress-bar-fill {
    height: 100%; border-radius: var(--radius-full);
    background: var(--primary);
    transition: width .5s cubic-bezier(.4,0,.2,1);
}
.progress-bar-fill.green  { background: var(--success); }
.progress-bar-fill.orange { background: var(--warning); }
.progress-bar-fill.red    { background: var(--danger); }
.progress-label { font-size: .68rem; color: var(--text-muted); text-align: right; font-weight: 500; }

.project-card-footer {
    padding: 10px 18px;
    background: #fafafa;
    border-top: 1px solid var(--card-border);
    display: flex; align-items: center; gap: 8px;
}
.alert-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .68rem; color: var(--danger); font-weight: 600;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 0; margin-bottom: 18px;
}
.tab,
.tab-btn {
    padding: 10px 18px;
    font-size: .8rem; font-weight: 500; color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
    background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover, .tab-btn:hover { color: var(--text-primary); }
.tab.active, .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15,23,42,.5);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; pointer-events: none;
    transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.05);
    width: 100%; max-width: 580px;
    max-height: 90vh; overflow-y: auto;
    transform: translateY(-12px) scale(.98);
    transition: transform .2s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1100px; }
.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--card-border);
    display: flex; align-items: center; gap: 10px;
}
.modal-title { font-size: .95rem; font-weight: 700; flex: 1; letter-spacing: -.02em; }
.modal-close {
    width: 28px; height: 28px; border: none; background: transparent;
    cursor: pointer; border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: .9rem;
    transition: background var(--transition);
}
.modal-close:hover { background: var(--body-bg); color: var(--text-primary); }
.modal-body { padding: 22px; }
.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--card-border);
    display: flex; justify-content: flex-end; gap: 8px;
    background: #fafafa;
    border-radius: 0 0 14px 14px;
}

/* ============================================================
   ALERTS & TOAST
   ============================================================ */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: .82rem; margin-bottom: 12px;
    display: flex; align-items: flex-start; gap: 8px;
    border: 1px solid transparent;
}
.alert-danger  { background: var(--danger-light);  color: #991b1b; border-color: #fecaca; }
.alert-success { background: var(--success-light); color: #065f46; border-color: #a7f3d0; }
.alert-warning { background: var(--warning-light); color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--info-light);    color: #155e75; border-color: #a5f3fc; }

.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--text-primary); color: #fff;
    padding: 11px 16px; border-radius: var(--radius);
    font-size: .82rem; min-width: 260px; max-width: 340px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    animation: toastIn .22s cubic-bezier(.4,0,.2,1);
    font-weight: 500;
}
.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }
.toast.warning { background: #92400e; }
@keyframes toastIn {
    from { transform: translateX(16px) scale(.96); opacity: 0; }
    to   { transform: translateX(0)   scale(1);    opacity: 1; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.text-primary  { color: var(--primary); }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm       { font-size: .78rem; }
.text-xs       { font-size: .68rem; }

.d-flex        { display: flex; }
.align-center  { align-items: center; }
.gap-1         { gap: 6px; }
.gap-2         { gap: 12px; }
.mt-1          { margin-top: 8px; }
.mt-2          { margin-top: 14px; }
.mb-1          { margin-bottom: 8px; }
.mb-2          { margin-bottom: 14px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

.empty-state {
    padding: 52px 20px; text-align: center; color: var(--text-muted);
}
.empty-state .icon { font-size: 2.8rem; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: .85rem; }

.loading {
    display: flex; align-items: center; justify-content: center;
    padding: 48px; color: var(--text-muted); gap: 10px; font-size: .83rem;
}
.spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Cost bars */
.cost-bar { display: flex; flex-direction: column; gap: 4px; }
.cost-row { display: flex; align-items: center; gap: 10px; font-size: .75rem; }
.cost-row-label { width: 80px; color: var(--text-secondary); flex-shrink: 0; font-weight: 500; }
.cost-row-bar { flex: 1; height: 8px; background: #f1f5f9; border-radius: var(--radius-full); overflow: hidden; }
.cost-row-fill { height: 100%; border-radius: var(--radius-full); }
.cost-row-fill.estimado { background: var(--primary); }
.cost-row-fill.real     { background: var(--warning); }
.cost-row-value { width: 90px; text-align: right; font-weight: 600; color: var(--text-primary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { width: 58px; }
    .sidebar .logo-text, .sidebar .logo-sub,
    .nav-item span:not(.nav-icon), .nav-section,
    .sidebar-footer .user-name, .sidebar-footer .user-role,
    .nav-badge { display: none; }
    .nav-item { justify-content: center; padding: 10px; border-left: none; border-radius: var(--radius-sm); }
    .main-wrapper { margin-left: 58px; }
    .project-grid { grid-template-columns: 1fr; }
    .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; }
    .content { padding: 14px; }
}
