*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --bg: #f0f2f7; --surface: #ffffff; --surface2: #f7f8fc;
      --border: #e4e8f0; --text: #1a1d2e; --text2: #6b7280; --text3: #9ca3af;
      --accent: #6c63ff; --accent2: #48cfad; --accent3: #f7971e;
      --danger: #ef4444; --shadow: 0 2px 12px rgba(0,0,0,0.07);
      --shadow-lg: 0 8px 32px rgba(0,0,0,0.12); --radius: 14px; --radius-sm: 8px;
    }
    .dark {
      --bg: #0f1117; --surface: #1a1d2e; --surface2: #232638; --border: #2e3247;
      --text: #e8eaf6; --text2: #9ba3c4; --text3: #6b7280;
      --shadow: 0 2px 12px rgba(0,0,0,0.3); --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    }
    body { font-family: 'Sora', sans-serif; background: var(--bg); color: var(--text); transition: background 0.3s, color 0.3s; min-height: 100vh; }
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

    /* ── LOGIN PAGE ─────────────────────────────────────── */
    .login-page {
      min-height: 100vh; display: flex; align-items: center; justify-content: center;
      background: #f0f1ff; padding: 16px;
    }
    .login-card {
      background: #fff; border-radius: 24px; box-shadow: 0 20px 60px rgba(108,99,255,0.15);
      display: flex; overflow: hidden; width: 100%; max-width: 860px; min-height: 520px;
      animation: fadeUp 0.4s ease;
    }
    @keyframes fadeUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }

    /* Left panel */
    .login-left {
      width: 42%; position: relative; overflow: hidden;
      background: linear-gradient(135deg, #5a4fcf 0%, #9b59f5 50%, #6c63ff 100%);
      padding: 36px 32px; display: flex; flex-direction: column; justify-content: space-between;
      flex-shrink: 0;
    }
    .login-left-bg {
      position: absolute; inset: 0; background-size: cover; background-position: center;
      opacity: 0.35;
    }
    .login-left-overlay {
      position: absolute; inset: 0;
      background: linear-gradient(160deg, rgba(90,79,207,0.7) 0%, rgba(108,99,255,0.85) 100%);
    }
    .login-left-content { position: relative; z-index: 2; }
    .login-logo {
      width: 42px; height: 42px; background: rgba(255,255,255,0.2);
      border-radius: 14px; display: flex; align-items: center; justify-content: center;
      font-size: 22px; margin-bottom: 32px; backdrop-filter: blur(10px);
      border: 1px solid rgba(255,255,255,0.3);
    }
    .login-tagline {
      font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.7);
      text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px;
    }
    .login-headline {
      font-size: clamp(20px, 3vw, 26px); font-weight: 700; color: #fff;
      line-height: 1.35; margin-bottom: 20px;
    }
    .login-verse {
      font-size: 12px; color: rgba(255,255,255,0.6); font-style: italic;
      border-left: 2px solid rgba(255,255,255,0.3); padding-left: 12px;
      margin-top: auto;
    }
    .login-verse strong { color: rgba(255,255,255,0.9); font-style: normal; font-size: 11px; display: block; margin-bottom: 2px; }

    /* Right panel */
    .login-right {
      flex: 1; padding: 44px 40px; display: flex; flex-direction: column; justify-content: center;
    }
    .login-brand-dot { font-size: 28px; color: var(--accent); margin-bottom: 12px; line-height: 1; }
    .login-title { font-size: 26px; font-weight: 700; color: #1a1d2e; margin-bottom: 6px; }
    .login-sub { font-size: 13px; color: #6b7280; margin-bottom: 28px; }

    .login-form-group { margin-bottom: 16px; }
    .login-label { font-size: 12px; font-weight: 600; color: #374151; display: block; margin-bottom: 6px; }
    .login-input {
      width: 100%; padding: 11px 14px; border: 1.5px solid #e5e7eb;
      border-radius: 10px; font-family: 'Sora',sans-serif; font-size: 13px;
      color: #1a1d2e; background: #fff; outline: none; transition: all 0.2s;
    }
    .login-input:focus { border-color: #6c63ff; box-shadow: 0 0 0 3px rgba(108,99,255,0.12); }
    .login-input-wrap { position: relative; }
    .login-eye {
      position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
      background: none; border: none; cursor: pointer; color: #9ca3af; font-size: 15px;
      display: flex; align-items: center;
    }
    .login-btn {
      width: 100%; padding: 12px; background: #6c63ff; color: #fff;
      border: none; border-radius: 10px; font-family: 'Sora',sans-serif;
      font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s;
      margin-top: 4px;
    }
    .login-btn:hover { background: #5a52e8; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(108,99,255,0.35); }
    .login-divider {
      display: flex; align-items: center; gap: 10px; margin: 18px 0;
      font-size: 11px; color: #9ca3af;
    }
    .login-divider::before, .login-divider::after { content:''; flex:1; height:1px; background:#e5e7eb; }
    .google-btn {
      width: 100%; padding: 11px; background: #fff; border: 1.5px solid #e5e7eb;
      border-radius: 10px; font-family: 'Sora',sans-serif; font-size: 13px; font-weight: 600;
      color: #374151; cursor: pointer; transition: all 0.2s;
      display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .google-btn:hover { background: #f9fafb; border-color: #d1d5db; }
    .google-icon { width: 18px; height: 18px; }
    .login-toggle { margin-top: 20px; text-align: center; font-size: 13px; color: #6b7280; }
    .login-toggle a { color: #6c63ff; font-weight: 600; cursor: pointer; text-decoration: none; }
    .login-error { background: #fee2e2; color: #dc2626; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
    .login-success { background: #d1fae5; color: #065f46; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }

    /* Image upload in login settings */
    .img-upload-box {
      border: 2px dashed #e5e7eb; border-radius: 12px; padding: 16px;
      text-align: center; cursor: pointer; transition: all 0.2s; margin-top: 8px;
      font-size: 12px; color: #9ca3af;
    }
    .img-upload-box:hover { border-color: #6c63ff; color: #6c63ff; }
    .img-preview { max-height: 80px; border-radius: 8px; margin-top: 8px; }

    /* ── MAIN APP ────────────────────────────────────────── */
    .navbar {
      position: sticky; top: 0; z-index: 100; background: var(--surface);
      border-bottom: 1px solid var(--border); padding: 0 24px; height: 60px;
      display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow);
    }
    .navbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
    .brand-icon { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #a78bfa); display: flex; align-items: center; justify-content: center; font-size: 16px; }
    .navbar-right { display: flex; align-items: center; gap: 10px; }
    .user-chip {
      display: flex; align-items: center; gap: 8px;
      background: var(--surface2); border: 1px solid var(--border);
      border-radius: 99px; padding: 5px 14px 5px 5px;
      font-size: 13px; font-weight: 600; color: var(--text);
    }
    .user-avatar {
      width: 28px; height: 28px; border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), #a78bfa);
      display: flex; align-items: center; justify-content: center;
      font-size: 13px; color: #fff; font-weight: 700; overflow: hidden;
    }
    .user-avatar img { width: 100%; height: 100%; object-fit: cover; }

    .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; }
    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:hover { background: #5a52e8; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(108,99,255,0.35); }
    .btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
    .btn-secondary:hover { background: var(--border); }
    .btn-ghost { background: transparent; color: var(--text2); padding: 8px 10px; }
    .btn-ghost:hover { background: var(--surface2); color: var(--text); }
    .btn-danger { background: #fee2e2; color: var(--danger); }
    .btn-danger:hover { background: var(--danger); color: #fff; }
    .btn-success { background: #d1fae5; color: #059669; }
    .btn-success:hover { background: #059669; color: #fff; }
    .btn-sm { padding: 5px 10px; font-size: 12px; }

    .hero { position: relative; margin: 16px; border-radius: 20px; overflow: hidden; height: 600px; background: linear-gradient(135deg, #1a1d2e 0%, #2e3247 100%); }
    .hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity 0.5s; }
    .hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.55) 100%); }
    .hero-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
    .hero-welcome { font-size: 13px; color: rgba(255,255,255,0.75); font-weight: 500; margin-bottom: 2px; }
    .hero-time { font-size: clamp(42px, 7vw, 68px); font-weight: 700; color: #fff; letter-spacing: -2px; text-shadow: 0 2px 20px rgba(0,0,0,0.4); font-variant-numeric: tabular-nums; }
    .hero-date { font-size: 15px; color: rgba(255,255,255,0.85); text-transform: capitalize; font-weight: 500; letter-spacing: 0.5px; }
    .hero-actions { position: absolute; bottom: 14px; right: 16px; z-index: 3; display: flex; gap: 8px; }
    .hero-btn { background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.25); color: #fff; font-size: 12px; font-family: 'Sora',sans-serif; font-weight: 500; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 5px; }
    .hero-btn:hover { background: rgba(255,255,255,0.25); }

    .main { padding: 0 16px 32px; }
    .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
    .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); }
    .stat-label { font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
    .stat-value { font-size: 32px; font-weight: 700; color: var(--text); }
    .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }

    .toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; box-shadow: var(--shadow); flex-wrap: wrap; }
    .toolbar-tabs { display: flex; gap: 4px; }
    .tab-btn { padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; font-family: 'Sora',sans-serif; border: none; cursor: pointer; transition: all 0.2s; background: transparent; color: var(--text2); }
    .tab-btn.active { background: var(--accent); color: #fff; }
    .tab-btn:not(.active):hover { background: var(--surface2); color: var(--text); }
    .divider { width: 1px; height: 24px; background: var(--border); }
    .filter-group { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
    .filter-label { font-size: 12px; color: var(--text2); font-weight: 500; display: flex; align-items: center; gap: 5px; }

    select, input[type="text"], input[type="date"], input[type="number"], input[type="email"], input[type="password"], textarea { background: var(--surface2); border: 1px solid var(--border); color: var(--text); font-family: 'Sora', sans-serif; font-size: 13px; border-radius: var(--radius-sm); padding: 7px 12px; outline: none; transition: border-color 0.2s; }
    select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.1); }
    select { cursor: pointer; }

    .table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
    .table-scroll { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; min-width: 900px; }
    thead th { background: var(--surface2); padding: 12px 14px; font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.7px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
    tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
    tbody tr:last-child { border-bottom: none; }
    tbody tr:hover { background: var(--surface2); }
    tbody td { padding: 12px 14px; font-size: 13px; vertical-align: middle; }
    .task-desc { font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
    .star-icon { color: #f59e0b; font-size: 14px; }

    .badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
    .badge-entregada { background: #d1fae5; color: #065f46; }
    .badge-proceso { background: #fef3c7; color: #92400e; }
    .badge-revision { background: #ede9fe; color: #4c1d95; }
    .badge-no-iniciada { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
    .badge-cancelada { background: #fee2e2; color: #991b1b; }
    .badge-urgente { background: #fee2e2; color: #dc2626; }
    .badge-alta { background: #fef3c7; color: #d97706; }
    .badge-media { background: #e0f2fe; color: #0369a1; }
    .badge-baja { background: #f0fdf4; color: #16a34a; }
    .days-chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
    .days-overdue { color: #ef4444; } .days-soon { color: #f7971e; } .days-ok { color: #48cfad; }
    .action-btns { display: flex; align-items: center; gap: 4px; }
    .icon-btn { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; transition: all 0.2s; background: transparent; color: var(--text2); font-size: 14px; }
    .icon-btn:hover { background: var(--surface2); color: var(--text); }
    .icon-btn.del:hover { background: #fee2e2; color: #ef4444; }
    .icon-btn.arch:hover { background: #d1fae5; color: #059669; }

    .modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn 0.2s ease; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    .modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; animation: slideUp 0.25s ease; }
    .modal-header { padding: 22px 24px 0; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); z-index: 1; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
    .modal-title { font-size: 18px; font-weight: 700; }
    .modal-body { padding: 20px 24px 24px; }
    .modal-footer { padding: 0 24px 24px; display: flex; justify-content: flex-end; gap: 10px; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .form-group { display: flex; flex-direction: column; gap: 6px; }
    .form-group.full { grid-column: span 2; }
    .form-label { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
    .form-group input, .form-group select, .form-group textarea { width: 100%; }
    textarea { resize: vertical; min-height: 70px; }

    .cotiz-modal { max-width: 780px; }
    .section-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 14px; }
    .honorario-row { display: grid; grid-template-columns: 2fr 80px 140px 1fr 1fr 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
    .honorario-row input, .honorario-row select { font-size: 12px; padding: 6px 10px; }
    .total-box { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-top: 12px; }
    .total-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
    .total-row.big { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; font-size: 16px; font-weight: 700; }
    .total-row.big span:last-child { color: #48cfad; }
    .task-check-list { max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
    .task-check-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; font-size: 13px; }
    .task-check-item:last-child { border-bottom: none; }
    .task-check-item:hover { background: var(--surface2); }
    .task-check-item input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
    .task-check-client { font-size: 11px; color: var(--text3); margin-left: auto; }
    .empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
    .empty-icon { font-size: 48px; margin-bottom: 12px; }
    .empty-state p { font-size: 14px; }
    .toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
    .toast { background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); animation: slideUp 0.25s ease; display: flex; align-items: center; gap: 8px; }
    .upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s; color: var(--text2); font-size: 13px; }
    .upload-zone:hover { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,0.04); }
    .logo-preview { max-height: 60px; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--border); padding: 4px; }

    /* SETTINGS PANEL */
    .settings-modal { max-width: 500px; }
    .setting-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
    .setting-row:last-child { border-bottom: none; }
    .setting-info { display: flex; flex-direction: column; gap: 2px; }
    .setting-name { font-weight: 600; font-size: 13px; }
    .setting-desc { font-size: 11px; color: var(--text2); }

    .dark .badge-entregada { background: #064e3b; color: #6ee7b7; }
    .dark .badge-proceso { background: #78350f; color: #fde68a; }
    .dark .badge-revision { background: #3b0764; color: #c4b5fd; }
    .dark .badge-urgente { background: #7f1d1d; color: #fca5a5; }
    .dark .badge-alta { background: #78350f; color: #fde68a; }
    .dark .badge-media { background: #0c4a6e; color: #7dd3fc; }
    .dark .badge-baja { background: #14532d; color: #86efac; }
    .dark .badge-cancelada { background: #7f1d1d; color: #fca5a5; }
    .dark .btn-danger { background: #7f1d1d; color: #fca5a5; }
    .dark .btn-success { background: #064e3b; color: #6ee7b7; }

    @media (max-width: 700px) {
      .login-card { flex-direction: column; max-width: 420px; }
      .login-left { width: 100%; min-height: 180px; padding: 24px; }
      .login-right { padding: 28px 24px; }
      .stats-grid { grid-template-columns: 1fr; }
      .form-grid { grid-template-columns: 1fr; }
      .form-group.full { grid-column: span 1; }
    }