/* ============================
       CSS VARIABLES
    ============================ */
    :root {
      --brand:        #bbc13b;
      --brand-dark:   #9ea832;
      --brand-dim:    rgba(187,193,59,0.13);
      --brand-glow:   rgba(187,193,59,0.07);
      --bg:           #0e0f0a;
      --surface-1:    #161710;
      --surface-2:    #1e2012;
      --surface-3:    #232516;
      --text-primary: #e8e9d8;
      --text-sec:     #8a8c70;
      --text-muted:   #4e5040;
      --border:       rgba(187,193,59,0.10);
      --border-h:     rgba(187,193,59,0.22);
      --red:          #ef4444;
      --red-dim:      rgba(239,68,68,0.12);
      --orange:       #f97316;
      --sidebar-w:    260px;
      --r:            8px;
      --r-lg:         12px;
    }

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

    html, body {
      height: 100%;
      font-family: 'DM Sans', sans-serif;
      background: var(--bg);
      color: var(--text-primary);
      font-size: 14px;
      line-height: 1.5;
    }

    /* ============================
       SCROLLBARS
    ============================ */
    ::-webkit-scrollbar { width: 5px; height: 5px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--border-h); }

    /* ============================
       LOGIN SCREEN
    ============================ */
    #login-screen {
      position: fixed; inset: 0;
      display: flex; align-items: center; justify-content: center;
      background-color: var(--bg);
      background-image:
        linear-gradient(rgba(187,193,59,0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(187,193,59,0.055) 1px, transparent 1px);
      background-size: 44px 44px;
      z-index: 900;
    }
    #login-screen::before {
      content: '';
      position: absolute; top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      width: 720px; height: 720px;
      background: radial-gradient(circle, rgba(187,193,59,0.09) 0%, transparent 65%);
      pointer-events: none;
    }

    .login-card {
      position: relative;
      background: var(--surface-1);
      border: 1px solid var(--border);
      border-top: 3px solid var(--brand);
      border-radius: var(--r-lg);
      padding: 48px 44px 40px;
      width: 100%; max-width: 420px;
      box-shadow: 0 32px 72px rgba(0,0,0,0.45), 0 0 0 1px rgba(187,193,59,0.04);
    }

    .login-logo {
      display: flex; align-items: center; gap: 10px;
      justify-content: center;
      margin-bottom: 10px;
    }
    .login-subtitle {
      text-align: center;
      font-size: 13px;
      color: var(--text-muted);
      margin-bottom: 32px;
      letter-spacing: 0.3px;
    }

    /* ============================
       LOGO COMPONENTS
    ============================ */
    .logo-mark {
      width: 34px; height: 34px;
      background: transparent;
      border-radius: 6px;
      display: flex; align-items: center; justify-content: center;
      font-family: 'Bebas Neue', cursive;
      font-size: 21px; color: #0e0f0a; line-height: 1;
      flex-shrink: 0;
    }
    .logo-wordmark {
      font-family: 'Bebas Neue', cursive;
      font-size: 26px; letter-spacing: 3px;
      color: var(--text-primary);
    }
    .logo-wordmark .hl { color: var(--brand); }
    .app-logo-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

    /* ============================
       FORM ELEMENTS
    ============================ */
    .form-group { margin-bottom: 16px; }
    .form-group label {
      display: block;
      font-size: 11px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 1px;
      color: var(--text-sec); margin-bottom: 6px;
    }
    .form-input {
      width: 100%;
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--r);
      padding: 10px 13px;
      color: var(--text-primary);
      font-family: 'DM Sans', sans-serif; font-size: 14px;
      transition: border-color 0.18s, box-shadow 0.18s;
      outline: none;
      -webkit-appearance: none;
    }
    .form-input:focus {
      border-color: var(--brand);
      box-shadow: 0 0 0 3px var(--brand-dim);
    }
    .form-input::placeholder { color: var(--text-muted); }
    select.form-input { cursor: pointer; }
    textarea.form-input { resize: vertical; min-height: 80px; }
    .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

    .btn-login {
      width: 100%; padding: 12px;
      background: var(--brand); color: #0e0f0a;
      border: none; border-radius: var(--r);
      font-family: 'DM Sans', sans-serif;
      font-size: 14px; font-weight: 600; letter-spacing: 1px;
      cursor: pointer; transition: background 0.18s, transform 0.1s;
      margin-top: 6px;
    }
    .btn-login:hover { background: var(--brand-dark); }
    .btn-login:active { transform: scale(0.98); }
    .btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

    .login-divider {
      display: flex; align-items: center; gap: 10px;
      margin: 14px 0; color: var(--text-muted); font-size: 12px;
    }
    .login-divider::before, .login-divider::after {
      content: ''; flex: 1; height: 1px; background: var(--border);
    }
    .btn-google {
      width: 100%; padding: 11px; border-radius: var(--r);
      background: var(--surface-2); border: 1px solid var(--border-h);
      color: var(--text-primary); font-family: 'DM Sans', sans-serif;
      font-size: 14px; font-weight: 500; cursor: pointer;
      display: flex; align-items: center; justify-content: center; gap: 10px;
      transition: background 0.15s, border-color 0.15s;
    }
    .btn-google:hover { background: var(--surface-3); border-color: rgba(187,193,59,0.35); }
    .btn-google:disabled { opacity: 0.6; cursor: not-allowed; }

    .login-error {
      background: rgba(239,68,68,0.09);
      border: 1px solid rgba(239,68,68,0.25);
      border-radius: var(--r);
      padding: 10px 13px;
      color: #f87171; font-size: 13px;
      margin-top: 12px; display: none;
    }

    /* ============================
       APP LAYOUT
    ============================ */
    #app-screen {
      display: none; height: 100vh; overflow: hidden;
    }
    #app-screen.active { display: flex; }

    /* ============================
       SIDEBAR
    ============================ */
    #sidebar {
      width: var(--sidebar-w); min-width: var(--sidebar-w);
      background: var(--surface-1);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column;
      height: 100vh; overflow: hidden;
    }

    .sidebar-header {
      padding: 18px 18px 15px;
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; gap: 9px;
    }
    .sidebar-header .logo-wordmark { font-size: 22px; }

    .sidebar-nav { padding: 10px 8px 6px; }
    .nav-section-label {
      font-size: 10px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 1.2px;
      color: var(--text-muted);
      padding: 8px 10px 3px;
    }

    .nav-item {
      display: flex; align-items: center; gap: 9px;
      padding: 8px 11px; border-radius: var(--r);
      cursor: pointer; color: var(--text-sec);
      font-size: 13.5px; font-weight: 500;
      transition: background 0.13s, color 0.13s;
      margin-bottom: 1px; user-select: none;
    }
    .nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
    .nav-item.active { background: var(--brand-dim); color: var(--brand); }
    .nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.75; }
    .nav-item.active .nav-icon { opacity: 1; }
    .nav-badge {
      margin-left: auto;
      background: var(--surface-3);
      color: var(--text-muted);
      font-family: 'JetBrains Mono', monospace; font-size: 10px;
      padding: 2px 6px; border-radius: 10px; line-height: 1.4;
    }
    .nav-item.active .nav-badge { background: var(--brand-dim); color: var(--brand); }

    .sidebar-clients-label {
      display: flex; align-items: center; justify-content: space-between;
      padding: 8px 18px 4px;
      font-size: 10px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 1.2px;
      color: var(--text-muted);
    }
    .sidebar-clients { flex: 1; overflow-y: auto; padding: 2px 8px 6px; }
    .client-nav-item {
      display: flex; align-items: center; gap: 7px;
      padding: 6px 11px; border-radius: var(--r);
      cursor: pointer; color: var(--text-muted);
      font-size: 12.5px; font-weight: 400;
      transition: background 0.13s, color 0.13s;
      margin-bottom: 1px; white-space: nowrap;
      overflow: hidden; text-overflow: ellipsis;
    }
    .client-nav-item:hover { background: var(--surface-2); color: var(--text-sec); }
    .client-dot {
      width: 5px; height: 5px; border-radius: 50%;
      background: var(--brand); opacity: 0.5; flex-shrink: 0;
    }

    .sidebar-footer {
      padding: 11px 14px;
      border-top: 1px solid var(--border);
      display: flex; align-items: center; gap: 9px;
    }
    .user-avatar {
      width: 30px; height: 30px; border-radius: 50%;
      background: var(--brand-dim);
      border: 1px solid var(--border-h);
      display: flex; align-items: center; justify-content: center;
      font-size: 11px; font-weight: 700; color: var(--brand);
      flex-shrink: 0; letter-spacing: 0.5px;
    }
    .user-info { flex: 1; min-width: 0; }
    .user-name {
      font-size: 12.5px; font-weight: 500;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .user-role {
      font-size: 10.5px; color: var(--text-muted);
      text-transform: capitalize;
    }
    .logout-btn {
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); padding: 5px; border-radius: 5px;
      display: flex; align-items: center;
      transition: color 0.15s, background 0.15s;
    }
    .logout-btn:hover { color: var(--red); background: var(--red-dim); }

    /* ============================
       MAIN CONTENT
    ============================ */
    #main-content { flex: 1; overflow-y: auto; background: var(--bg); }

    .view { display: none; padding: 28px 30px; animation: fadeUp 0.18s ease; }
    .view.active { display: block; }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(5px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .view-header {
      display: flex; align-items: flex-start;
      justify-content: space-between; margin-bottom: 24px;
    }
    .view-title {
      font-family: 'Bebas Neue', cursive;
      font-size: 30px; letter-spacing: 1px;
      color: var(--text-primary); line-height: 1;
    }
    .view-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

    /* ============================
       BUTTONS
    ============================ */
    .btn {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 8px 15px; border-radius: var(--r);
      font-family: 'DM Sans', sans-serif;
      font-size: 13px; font-weight: 500;
      cursor: pointer; transition: all 0.15s;
      border: none; white-space: nowrap; line-height: 1;
    }
    .btn-brand { background: var(--brand); color: #0e0f0a; }
    .btn-brand:hover { background: var(--brand-dark); }
    .btn-ghost {
      background: var(--surface-2); color: var(--text-sec);
      border: 1px solid var(--border);
    }
    .btn-ghost:hover { background: var(--surface-3); color: var(--text-primary); border-color: var(--border-h); }
    .btn-danger { background: var(--red-dim); color: #f87171; border: 1px solid rgba(239,68,68,0.22); }
    .btn-danger:hover { background: rgba(239,68,68,0.2); }
    .btn-icon {
      display: inline-flex; align-items: center; justify-content: center;
      padding: 6px; border-radius: var(--r);
      background: var(--surface-2); border: 1px solid var(--border);
      color: var(--text-muted); cursor: pointer;
      transition: all 0.15s;
    }
    .btn-icon:hover { background: var(--surface-3); color: var(--text-primary); border-color: var(--border-h); }
    .btn-icon.danger:hover { background: var(--red-dim); color: #f87171; border-color: rgba(239,68,68,0.22); }

    /* ============================
       STAT CARDS
    ============================ */
    .stat-cards {
      display: grid; grid-template-columns: repeat(4, 1fr);
      gap: 14px; margin-bottom: 22px;
    }
    .stat-card {
      background: var(--surface-1);
      border: 1px solid var(--border);
      border-radius: var(--r-lg);
      padding: 18px 20px;
      position: relative; overflow: hidden;
      transition: border-color 0.18s, transform 0.18s;
    }
    .stat-card:hover { border-color: var(--border-h); transform: translateY(-1px); }
    .stat-card::after {
      content: '';
      position: absolute; top: -1px; right: -1px;
      width: 80px; height: 80px;
      background: radial-gradient(circle at top right, var(--brand-glow) 0%, transparent 70%);
      pointer-events: none;
    }
    .stat-label {
      font-size: 10.5px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 1px;
      color: var(--text-muted); margin-bottom: 10px;
    }
    .stat-value {
      font-family: 'JetBrains Mono', monospace;
      font-size: 34px; font-weight: 500;
      color: var(--text-primary); line-height: 1;
    }
    .stat-card.s-overdue .stat-value { color: var(--red); }
    .stat-card.s-done .stat-value { color: var(--brand); }
    .stat-card.s-progress .stat-value { color: #60a5fa; }

    /* ============================
       FILTER BAR
    ============================ */
    .filter-bar {
      display: flex; align-items: center;
      gap: 8px; margin-bottom: 14px; flex-wrap: wrap;
    }
    .filter-tabs {
      display: flex;
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r); padding: 3px; gap: 2px;
    }
    .filter-tab {
      padding: 5px 13px; border-radius: 5px;
      cursor: pointer; font-size: 12.5px; font-weight: 500;
      color: var(--text-sec);
      transition: all 0.13s; border: none;
      background: none; font-family: 'DM Sans', sans-serif;
    }
    .filter-tab:hover { color: var(--text-primary); background: var(--surface-2); }
    .filter-tab.active { background: var(--brand); color: #0e0f0a; }

    .filter-sel {
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r); padding: 6px 11px;
      color: var(--text-sec); font-family: 'DM Sans', sans-serif;
      font-size: 12.5px; cursor: pointer; outline: none;
      transition: border-color 0.15s; -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234e5040' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: right 9px center;
      padding-right: 28px;
    }
    .filter-sel:focus { border-color: var(--brand); }
    .filter-sel option { background: var(--surface-2); color: var(--text-primary); }

    .search-wrap { position: relative; flex: 1; min-width: 180px; }
    .search-icon {
      position: absolute; left: 10px; top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted); pointer-events: none;
    }
    .search-input {
      width: 100%;
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r); padding: 6px 11px 6px 32px;
      color: var(--text-primary); font-family: 'DM Sans', sans-serif;
      font-size: 13px; outline: none;
      transition: border-color 0.18s;
    }
    .search-input:focus { border-color: var(--brand); }
    .search-input::placeholder { color: var(--text-muted); }

    /* ============================
       TABLE
    ============================ */
    .table-wrap {
      background: var(--surface-1);
      border: 1px solid var(--border);
      border-radius: var(--r-lg); overflow: hidden;
    }
    table { width: 100%; border-collapse: collapse; }
    thead th {
      padding: 11px 15px; text-align: left;
      font-size: 10.5px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 0.9px;
      color: var(--text-muted);
      background: var(--surface-2);
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }
    thead th:first-child { width: 46px; }
    thead th:last-child { width: 80px; }

    tbody tr {
      border-bottom: 1px solid var(--border);
      transition: background 0.1s;
    }
    tbody tr:last-child { border-bottom: none; }
    tbody tr:hover { background: rgba(255,255,255,0.018); }
    tbody tr.row-done { opacity: 0.5; }
    tbody tr.row-overdue { background: rgba(239,68,68,0.025); }
    tbody tr.row-selected { background: rgba(187,193,59,0.07) !important; }
    tbody td { padding: 12px 15px; vertical-align: middle; }

    .task-name { font-weight: 500; color: var(--text-primary); }
    .task-name.struck { text-decoration: line-through; color: var(--text-muted); }
    .task-notes {
      font-size: 11.5px; color: var(--text-muted);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      max-width: 400px; margin-top: 1px;
    }

    .badge {
      display: inline-flex; align-items: center;
      padding: 2px 8px; border-radius: 20px;
      font-size: 10.5px; font-weight: 600;
      text-transform: uppercase; letter-spacing: 0.5px;
      white-space: nowrap;
    }
    .badge-high   { background: rgba(239,68,68,0.13);   color: #f87171; }
    .badge-medium { background: rgba(249,115,22,0.13);  color: #fb923c; }
    .badge-low    { background: rgba(187,193,59,0.15);  color: var(--brand); }

    .due-date {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11.5px; color: var(--text-sec);
      white-space: nowrap;
    }
    .due-date.overdue { color: var(--red); }

    .row-actions {
      display: flex; gap: 4px;
      opacity: 0; transition: opacity 0.13s;
    }
    tbody tr:hover .row-actions { opacity: 1; }
    .act-btn {
      background: none; border: none; cursor: pointer;
      padding: 4px 6px; border-radius: 5px;
      color: var(--text-muted); transition: all 0.13s;
      display: flex; align-items: center;
    }
    .act-btn:hover { background: var(--surface-3); color: var(--text-primary); }
    .act-btn.del:hover { background: var(--red-dim); color: var(--red); }

    /* Checkbox */
    .cb {
      width: 15px; height: 15px;
      border: 1.5px solid var(--border-h);
      border-radius: 4px; background: transparent;
      cursor: pointer; appearance: none; -webkit-appearance: none;
      transition: all 0.15s; position: relative; display: block;
    }
    .cb:checked { background: var(--brand); border-color: var(--brand); }
    .cb:checked::after {
      content: ''; position: absolute;
      left: 4px; top: 1px;
      width: 5px; height: 8px;
      border: 1.5px solid #0e0f0a;
      border-top: none; border-left: none;
      transform: rotate(45deg);
    }
    .cb:hover:not(:checked) { border-color: var(--brand); }
    .cb:disabled { opacity: 0.4; cursor: default; }

    /* ============================
       CLIENTS GRID
    ============================ */
    .cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
      gap: 14px;
    }
    .client-card {
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 18px 20px;
      transition: border-color 0.15s, transform 0.15s;
    }
    .client-card:hover { border-color: var(--border-h); transform: translateY(-1px); }
    .client-card-head {
      display: flex; align-items: flex-start;
      justify-content: space-between; margin-bottom: 10px;
    }
    .client-card-info { display: flex; align-items: center; gap: 11px; }
    .client-avatar {
      width: 38px; height: 38px; border-radius: var(--r);
      background: var(--brand-dim); border: 1px solid var(--border-h);
      display: flex; align-items: center; justify-content: center;
      font-size: 15px; font-weight: 700; color: var(--brand);
      flex-shrink: 0;
    }
    .client-name { font-weight: 600; font-size: 14.5px; color: var(--text-primary); }
    .client-email { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
    .client-notes { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
    .client-stats {
      display: flex; gap: 0;
      margin-top: 12px; padding-top: 12px;
      border-top: 1px solid var(--border);
    }
    .c-stat { flex: 1; text-align: center; }
    .c-stat + .c-stat { border-left: 1px solid var(--border); }
    .c-stat-val {
      font-family: 'JetBrains Mono', monospace;
      font-size: 20px; font-weight: 500; color: var(--text-primary);
    }
    .c-stat-val.green { color: var(--brand); }
    .c-stat-label { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
    .client-card-actions { display: flex; gap: 5px; }

    /* ============================
       ROLE BADGES
    ============================ */
    .role-admin  { background: rgba(187,193,59,0.14); color: var(--brand); }
    .role-staff  { background: rgba(99,102,241,0.14); color: #818cf8; }
    .role-client { background: rgba(20,184,166,0.14); color: #2dd4bf; }

    /* ============================
       EMPTY STATE
    ============================ */
    .empty-state {
      text-align: center; padding: 60px 24px;
      color: var(--text-muted);
    }
    .empty-icon { font-size: 36px; opacity: 0.35; margin-bottom: 12px; }
    .empty-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
    .empty-sub { font-size: 12px; opacity: 0.7; }

    /* ============================
       MODALS
    ============================ */
    .modal-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.65);
      backdrop-filter: blur(5px);
      z-index: 500; display: none;
      align-items: center; justify-content: center;
      padding: 20px;
    }
    .modal-overlay.open { display: flex; animation: fadeUp 0.15s ease; }

    .modal {
      background: var(--surface-1);
      border: 1px solid var(--border);
      border-top: 3px solid var(--brand);
      border-radius: var(--r-lg);
      width: 100%; max-width: 500px;
      max-height: 90vh; overflow-y: auto;
      box-shadow: 0 28px 72px rgba(0,0,0,0.55);
    }
    .modal.sm { max-width: 380px; }

    .modal-head {
      padding: 18px 22px 14px;
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
    }
    .modal-title {
      font-family: 'Bebas Neue', cursive;
      font-size: 21px; letter-spacing: 1px;
    }
    .modal-close {
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); font-size: 17px; line-height: 1;
      padding: 3px 5px; border-radius: 4px;
      transition: color 0.13s; font-family: monospace;
    }
    .modal-close:hover { color: var(--text-primary); }

    .modal-body { padding: 18px 22px; }
    .modal-foot {
      padding: 14px 22px;
      border-top: 1px solid var(--border);
      display: flex; justify-content: flex-end; gap: 8px;
    }
    .confirm-msg { color: var(--text-sec); line-height: 1.65; font-size: 13.5px; }

    /* ============================
       TOASTS
    ============================ */
    #toasts {
      position: fixed; bottom: 22px; right: 22px;
      z-index: 9999; display: flex; flex-direction: column;
      gap: 8px; pointer-events: none;
    }
    .toast {
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-left: 3px solid var(--brand);
      border-radius: var(--r);
      padding: 11px 15px;
      font-size: 13px; color: var(--text-primary);
      box-shadow: 0 10px 28px rgba(0,0,0,0.35);
      min-width: 230px; max-width: 320px;
      pointer-events: all;
      animation: slideIn 0.22s ease forwards;
    }
    .toast.t-err  { border-left-color: var(--red); }
    .toast.t-warn { border-left-color: var(--orange); }
    .toast-head { font-weight: 600; margin-bottom: 2px; }
    .toast-msg  { color: var(--text-sec); font-size: 12px; }

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

    /* ============================
       SUBTASKS
    ============================ */
    .expand-btn {
      background: none; border: none; cursor: pointer;
      color: var(--text-sec); padding: 3px; border-radius: 4px;
      display: flex; align-items: center; flex-shrink: 0;
      transition: color 0.13s, background 0.13s, transform 0.18s;
    }
    .expand-btn:hover { color: var(--brand); background: var(--brand-dim); }
    .expand-btn.open { transform: rotate(90deg); color: var(--brand); }

    .subtask-progress {
      display: inline-flex; align-items: center;
      background: var(--surface-3);
      color: var(--text-muted);
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px; padding: 1px 6px; border-radius: 10px;
      margin-left: 6px; vertical-align: middle;
      white-space: nowrap;
    }
    .subtask-progress.all-done { background: var(--brand-dim); color: var(--brand); }

    tr.subtask-group td { padding: 0; border-bottom: none; }
    .subtask-list {
      padding: 4px 0 6px 60px;
      background: rgba(0,0,0,0.12);
      border-bottom: 1px solid var(--border);
    }
    .subtask-item {
      display: flex; align-items: center; gap: 8px;
      padding: 5px 12px 5px 0;
      border-radius: 5px;
    }
    .subtask-item:hover { background: rgba(255,255,255,0.02); }
    .subtask-name {
      flex: 1; font-size: 13px; color: var(--text-sec);
    }
    .subtask-name.struck { text-decoration: line-through; color: var(--text-muted); }
    .subtask-del {
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); padding: 3px 5px; border-radius: 4px;
      opacity: 0; transition: all 0.13s; display: flex; align-items: center;
    }
    .subtask-item:hover .subtask-del { opacity: 1; }
    .subtask-del:hover { color: var(--red); background: var(--red-dim); }

    .add-subtask-row {
      display: flex; align-items: center; gap: 7px;
      padding: 4px 0;
    }
    .add-subtask-input {
      flex: 1; background: var(--surface-2);
      border: 1px solid var(--border); border-radius: 5px;
      padding: 5px 10px; color: var(--text-primary);
      font-family: 'DM Sans', sans-serif; font-size: 12.5px;
      outline: none; transition: border-color 0.15s;
    }
    .add-subtask-input:focus { border-color: var(--brand); }
    .add-subtask-input::placeholder { color: var(--text-muted); }
    .add-subtask-btn {
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); font-size: 12px;
      padding: 4px 8px; border-radius: 4px;
      transition: all 0.13s; white-space: nowrap;
      font-family: 'DM Sans', sans-serif;
    }
    .add-subtask-btn:hover { color: var(--brand); background: var(--brand-dim); }

    /* ============================
       TASK DETAIL VIEW
    ============================ */
    .back-btn {
      display: inline-flex; align-items: center; gap: 7px;
      background: none; border: none; cursor: pointer;
      color: var(--text-sec); font-family: 'DM Sans', sans-serif;
      font-size: 13px; padding: 6px 0; margin-bottom: 22px;
      transition: color 0.13s;
    }
    .back-btn:hover { color: var(--text-primary); }
    .task-detail-title {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 34px; letter-spacing: 0.5px;
      color: var(--text-primary); line-height: 1.1; margin-bottom: 14px;
    }
    .task-detail-title.struck { text-decoration: line-through; color: var(--text-muted); }
    .task-detail-meta {
      display: flex; flex-wrap: wrap; gap: 8px;
      align-items: center; margin-bottom: 20px;
    }
    .task-detail-meta-item {
      display: flex; align-items: center; gap: 5px;
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: 6px; padding: 5px 11px;
      font-size: 12.5px; color: var(--text-sec);
    }
    .task-detail-meta-item .lbl { color: var(--text-muted); margin-right: 2px; }
    .task-detail-meta-item.overdue { border-color: var(--red); color: var(--red); }
    .task-detail-notes {
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--r); padding: 14px 16px;
      color: var(--text-sec); font-size: 13.5px; line-height: 1.65;
      margin-bottom: 26px; white-space: pre-wrap;
    }
    .checklist-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 10px;
    }
    .checklist-title {
      font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--text-muted);
    }
    .checklist-count {
      font-size: 12px; color: var(--text-muted);
      font-family: 'JetBrains Mono', monospace;
    }
    .checklist-wrap {
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r); overflow: hidden;
    }
    .checklist-item {
      display: flex; align-items: center; gap: 12px;
      padding: 13px 16px; border-bottom: 1px solid var(--border);
      transition: background 0.13s;
    }
    .checklist-item:last-child { border-bottom: none; }
    .checklist-item:hover { background: var(--surface-2); }
    .checklist-item .cb { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--brand); cursor: pointer; }
    .checklist-item-name {
      flex: 1; font-size: 14px; color: var(--text-primary); transition: color 0.13s;
    }
    .checklist-item-name.struck { text-decoration: line-through; color: var(--text-muted); }
    .checklist-item-del {
      background: none; border: none; cursor: pointer; color: var(--text-muted);
      padding: 4px; border-radius: 4px; opacity: 0; transition: all 0.13s;
      display: flex; align-items: center;
    }
    .checklist-item:hover .checklist-item-del { opacity: 1; }
    .checklist-item-del:hover { color: var(--red); background: var(--red-dim); }
    .checklist-add-row {
      display: flex; align-items: center; gap: 8px;
      padding: 10px 16px; background: var(--surface-2);
      border-top: 1px solid var(--border);
    }
    .checklist-add-input {
      flex: 1; background: var(--surface-3); border: 1px solid var(--border);
      border-radius: 6px; padding: 8px 12px; color: var(--text-primary);
      font-family: 'DM Sans', sans-serif; font-size: 13px;
      outline: none; transition: border-color 0.15s;
    }
    .checklist-add-input:focus { border-color: var(--brand); }
    .checklist-add-input::placeholder { color: var(--text-muted); }
    .checklist-add-btn {
      background: var(--brand); color: #0e0f0a; border: none; cursor: pointer;
      padding: 8px 16px; border-radius: 6px; font-family: 'DM Sans', sans-serif;
      font-size: 13px; font-weight: 600; transition: background 0.13s; white-space: nowrap;
    }
    .checklist-add-btn:hover { background: var(--brand-dark); }
    .task-name-btn {
      background: none; border: none; cursor: pointer; padding: 0;
      text-align: left; font-family: inherit; display: flex;
      align-items: center; gap: 6px; flex-wrap: wrap;
    }
    .task-name-btn:hover .task-name { color: var(--brand); }
    .task-name-btn .task-name {
      text-decoration: underline;
      text-decoration-color: rgba(187,193,59,0.25);
      text-underline-offset: 2px;
      transition: color 0.13s;
    }

    /* ============================
       MOBILE HEADER
    ============================ */
    #mobile-header {
      display: none;
      position: fixed; top: 0; left: 0; right: 0;
      height: 54px; z-index: 700;
      background: var(--surface-1);
      border-bottom: 1px solid var(--border);
      align-items: center; justify-content: space-between;
      padding: 0 14px; gap: 12px;
    }
    .hamburger-btn {
      background: none; border: none; cursor: pointer;
      color: var(--text-sec); padding: 6px; border-radius: var(--r);
      display: flex; align-items: center;
      transition: color 0.13s, background 0.13s;
    }
    .hamburger-btn:hover { color: var(--text-primary); background: var(--surface-2); }
    .mobile-logo { display: flex; align-items: center; gap: 7px; }

    /* Sidebar overlay */
    #sidebar-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,0.55); z-index: 750;
    }
    #sidebar-overlay.open { display: block; }

    /* ============================
       RESPONSIVE
    ============================ */
    @media (max-width: 960px) {
      .stat-cards { grid-template-columns: repeat(2, 1fr); }
    }

    @media (max-width: 768px) {
      #mobile-header { display: flex; }

      #app-screen { flex-direction: column; }

      #sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        z-index: 800; height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
        box-shadow: 4px 0 24px rgba(0,0,0,0.45);
      }
      #sidebar.open { transform: translateX(0); }

      #main-content { padding-top: 54px; }

      .view { padding: 20px 16px; }
      .view-header { flex-wrap: wrap; gap: 10px; }
      .view-title { font-size: 26px; }

      .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }

      /* Hide less important table columns on mobile (drag, client, due, assigned) */
      thead th:nth-child(1),
      thead th:nth-child(5),
      thead th:nth-child(8),
      thead th:nth-child(9),
      tbody td:nth-child(1),
      tbody td:nth-child(5),
      tbody td:nth-child(8),
      tbody td:nth-child(9) { display: none; }

      /* Always show row actions on mobile */
      .row-actions { opacity: 1; }

      .filter-bar { gap: 6px; }
      .filter-tabs { flex-wrap: wrap; }

      .task-detail-title { font-size: 26px; }
    }

    @media (max-width: 480px) {
      .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
      .stat-value { font-size: 26px; }
      .view { padding: 16px 14px; }
      .form-row { grid-template-columns: 1fr; }
      .login-card { padding: 32px 22px 28px; margin: 0 12px; }
      .filter-tabs { width: 100%; }
      .filter-tab { flex: 1; text-align: center; padding: 5px 6px; font-size: 11.5px; }
      .filter-sel { font-size: 12px; }
      #toasts { bottom: 14px; right: 14px; left: 14px; }
      .toast { min-width: 0; max-width: 100%; }
    }

    /* ============================
       STATUS BADGES
    ============================ */
    .badge-not-started { background: rgba(78,80,64,0.35);    color: var(--text-muted); }
    .badge-in-progress { background: rgba(96,165,250,0.14);  color: #60a5fa; }
    .badge-in-review   { background: rgba(245,158,11,0.14);  color: #fbbf24; }
    .badge-done        { background: rgba(74,222,128,0.14);  color: #4ade80; }
    .badge-active      { background: rgba(187,193,59,0.15);  color: var(--brand); }
    .badge-prospect    { background: rgba(96,165,250,0.14);  color: #60a5fa; }
    .badge-inactive    { background: rgba(78,80,64,0.35);    color: var(--text-muted); }

    /* ============================
       TAG CHIPS
    ============================ */
    .tags-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
    .tag-chip {
      padding: 2px 10px; border-radius: 20px;
      font-size: 11px; font-weight: 600;
      background: var(--brand-dim); color: var(--brand);
      border: 1px solid rgba(187,193,59,0.2);
      letter-spacing: 0.3px;
    }
    .tag-chip-rm {
      background: none; border: none; cursor: pointer;
      color: inherit; opacity: 0.6; margin-left: 3px; font-size: 11px;
      line-height: 1; padding: 0;
    }
    .tag-chip-rm:hover { opacity: 1; }

    /* ============================
       PROGRESS BAR
    ============================ */
    .progress-bar-wrap {
      background: var(--surface-3); border-radius: 10px;
      height: 4px; overflow: hidden; margin-top: 10px;
    }
    .progress-bar-fill {
      height: 100%; background: var(--brand); border-radius: 10px;
      transition: width 0.35s ease;
    }
    .progress-pct {
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px; color: var(--text-muted); margin-top: 4px;
    }

    /* ============================
       COMMENTS
    ============================ */
    .comments-section { margin-top: 30px; }
    .comments-header {
      font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--text-muted);
      margin-bottom: 12px;
    }
    .comment-list { margin-bottom: 12px; }
    .comment-item {
      display: flex; gap: 10px;
      padding: 12px 0; border-bottom: 1px solid var(--border);
    }
    .comment-item:first-child { border-top: 1px solid var(--border); }
    .comment-avatar {
      width: 28px; height: 28px; border-radius: 50%;
      background: var(--brand-dim); border: 1px solid var(--border-h);
      color: var(--brand); font-size: 10px; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .comment-body { flex: 1; }
    .comment-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
    .comment-author { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
    .comment-time   { font-size: 11px; color: var(--text-muted); }
    .comment-text   { font-size: 13.5px; color: var(--text-sec); line-height: 1.55; }
    .comment-del {
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); padding: 2px 5px; border-radius: 4px;
      opacity: 0; transition: all 0.13s; font-size: 12px; flex-shrink: 0;
    }
    .comment-item:hover .comment-del { opacity: 1; }
    .comment-del:hover { color: var(--red); background: var(--red-dim); }
    .comment-add-row {
      display: flex; gap: 8px; align-items: flex-end;
    }
    .comment-input {
      flex: 1; background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--r); padding: 10px 13px;
      color: var(--text-primary); font-family: 'DM Sans', sans-serif;
      font-size: 13px; outline: none; transition: border-color 0.15s;
      resize: none; min-height: 40px;
    }
    .comment-input:focus { border-color: var(--brand); }
    .comment-input::placeholder { color: var(--text-muted); }
    .comment-submit {
      background: var(--brand); color: #0e0f0a; border: none;
      padding: 9px 16px; border-radius: var(--r); cursor: pointer;
      font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
      transition: background 0.13s; white-space: nowrap;
    }
    .comment-submit:hover { background: var(--brand-dark); }

    /* ============================
       FILE ATTACHMENTS
    ============================ */
    .attachments-section { margin-top: 26px; }
    .attachments-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 10px;
    }
    .attachments-title {
      font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--text-muted);
    }
    .attachment-item {
      display: flex; align-items: center; gap: 11px;
      padding: 10px 14px; background: var(--surface-2);
      border: 1px solid var(--border); border-radius: var(--r);
      margin-bottom: 6px; transition: border-color 0.13s;
    }
    .attachment-item:hover { border-color: var(--border-h); }
    .attachment-icon {
      width: 32px; height: 32px; border-radius: 6px;
      background: var(--surface-3); display: flex; align-items: center;
      justify-content: center; flex-shrink: 0; font-size: 16px;
    }
    .attachment-name {
      flex: 1; font-size: 13px; font-weight: 500;
      color: var(--text-primary); white-space: nowrap;
      overflow: hidden; text-overflow: ellipsis;
    }
    .attachment-name a { color: inherit; text-decoration: none; }
    .attachment-name a:hover { color: var(--brand); }
    .attachment-by { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
    .attachment-del {
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); padding: 4px; border-radius: 4px;
      opacity: 0; transition: all 0.13s; display: flex; align-items: center;
    }
    .attachment-item:hover .attachment-del { opacity: 1; }
    .attachment-del:hover { color: var(--red); background: var(--red-dim); }
    .btn-drive {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 7px 14px; border-radius: var(--r);
      white-space: nowrap;
      background: var(--surface-2); border: 1px solid var(--border);
      color: var(--text-sec); font-family: 'DM Sans', sans-serif;
      font-size: 12.5px; font-weight: 500; cursor: pointer;
      transition: all 0.15s;
    }
    .btn-drive:hover { background: var(--surface-3); border-color: var(--border-h); color: var(--text-primary); }
    .btn-drive.connected { border-color: #4285F4; color: #60a5fa; }
    .drive-status {
      font-size: 11px; color: var(--text-muted); margin-top: 4px;
      text-align: center;
    }

    /* ============================
       BULK ACTION TOOLBAR
    ============================ */
    #bulk-toolbar {
      display: none; align-items: center; gap: 10px;
      padding: 10px 16px; margin-bottom: 10px;
      background: var(--surface-2); border: 1px solid var(--border-h);
      border-radius: var(--r); flex-wrap: wrap;
    }
    #bulk-toolbar.active { display: flex; }
    .bulk-count {
      font-size: 12.5px; font-weight: 600; color: var(--brand);
      font-family: 'JetBrains Mono', monospace;
    }
    .bulk-sep { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }

    /* ============================
       DRAGGABLE CARDS
    ============================ */
    .client-card[draggable] { cursor: grab; }
    .client-card[draggable]:active { cursor: grabbing; }
    .client-card.drag-over {
      border-color: var(--brand) !important;
      box-shadow: 0 0 0 2px var(--brand-dim);
    }
    .client-card.dragging { opacity: 0.4; }

    /* ============================
       TIME TRACKING
    ============================ */
    .time-section { margin-top: 28px; }
    .time-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 12px;
    }
    .time-title {
      font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--text-muted);
    }
    .time-total {
      font-family: 'JetBrains Mono', monospace;
      font-size: 12.5px; color: var(--brand);
      background: var(--brand-dim); border: 1px solid rgba(187,193,59,0.2);
      padding: 3px 10px; border-radius: 20px;
    }
    .time-entry {
      display: flex; align-items: center; gap: 12px;
      padding: 10px 14px; background: var(--surface-2);
      border: 1px solid var(--border); border-radius: var(--r);
      margin-bottom: 6px; transition: border-color 0.13s;
    }
    .time-entry:hover { border-color: var(--border-h); }
    .time-mins {
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px; font-weight: 600; color: var(--brand);
      white-space: nowrap; min-width: 52px;
    }
    .time-desc { flex: 1; font-size: 13px; color: var(--text-sec); }
    .time-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
    .time-del {
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); padding: 4px; border-radius: 4px;
      opacity: 0; transition: all 0.13s; display: flex; align-items: center;
    }
    .time-entry:hover .time-del { opacity: 1; }
    .time-del:hover { color: var(--red); background: var(--red-dim); }
    .time-log-row {
      display: flex; gap: 8px; align-items: center; margin-top: 10px;
      flex-wrap: wrap;
    }
    .time-h-input {
      width: 70px; background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--r); padding: 8px 10px; color: var(--text-primary);
      font-family: 'JetBrains Mono', monospace; font-size: 13px; outline: none;
      transition: border-color 0.15s; text-align: center;
    }
    .time-h-input:focus { border-color: var(--brand); }

    /* ============================
       CLIENT LOGO
    ============================ */
    .client-logo-img {
      width: 38px; height: 38px; border-radius: var(--r);
      object-fit: contain; background: var(--surface-3);
      border: 1px solid var(--border); display: block;
    }
    .client-logo-img-lg {
      width: 56px; height: 56px; border-radius: var(--r);
      object-fit: contain; background: var(--surface-3);
      border: 1px solid var(--border); display: block;
    }

    /* ============================
       CONTACT LIST
    ============================ */
    .contact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 8px; }
    .contact-item {
      display: flex; flex-direction: column; align-items: center;
      padding: 20px 14px 14px; background: var(--surface-2);
      border: 1px solid var(--border); border-radius: var(--r);
      transition: border-color 0.13s; position: relative; text-align: center; gap: 0;
    }
    .contact-item:hover { border-color: var(--border-h); }
    .contact-avatar {
      width: 34px; height: 34px; border-radius: 50%;
      background: var(--brand-dim); border: 1px solid var(--border-h);
      color: var(--brand); font-size: 11px; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .contact-info { width: 100%; min-width: 0; margin-top: 10px; }
    .contact-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
    .contact-title { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
    .contact-links { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; align-items: center; }
    .contact-link {
      display: flex; align-items: center; gap: 4px;
      font-size: 11.5px; color: var(--text-sec);
      text-decoration: none;
    }
    .contact-link:hover { color: var(--brand); }
    .contact-actions {
      position: absolute; top: 6px; right: 6px;
      display: flex; gap: 2px; opacity: 0; transition: opacity 0.13s;
    }
    .contact-item:hover .contact-actions { opacity: 1; }
    .contact-edit, .contact-del {
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); padding: 4px; border-radius: 4px;
      display: flex; align-items: center;
    }
    .contact-edit:hover { color: var(--brand); background: var(--brand-dim); }
    .contact-del:hover { color: var(--red); background: var(--red-dim); }

    /* ============================
       PROFILE SETTINGS MODAL
    ============================ */
    .profile-avatar-lg {
      width: 64px; height: 64px; border-radius: 50%;
      background: var(--brand-dim); border: 2px solid var(--border-h);
      color: var(--brand); font-size: 22px; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
      margin: 0 auto 16px; letter-spacing: 1px;
    }

    /* ============================
       CLIENT DETAIL VIEW
    ============================ */
    .client-detail-head {
      display: flex; align-items: flex-start; gap: 16px;
      margin-bottom: 24px; flex-wrap: wrap;
    }
    .client-detail-avatar {
      width: 56px; height: 56px; border-radius: var(--r);
      background: var(--brand-dim); border: 1px solid var(--border-h);
      display: flex; align-items: center; justify-content: center;
      font-size: 24px; font-weight: 700; color: var(--brand); flex-shrink: 0;
    }
    .client-detail-info { flex: 1; }
    .client-detail-name {
      font-family: 'Bebas Neue', cursive;
      font-size: 34px; letter-spacing: 0.5px; line-height: 1; color: var(--text-primary);
      margin-bottom: 6px;
    }
    .client-detail-contacts {
      display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
    }
    .client-contact-chip {
      display: flex; align-items: center; gap: 5px;
      font-size: 12.5px; color: var(--text-sec);
    }
    /* Client info row: [notes + website] | DNS */
    .client-info-row {
      display: flex; gap: 16px; align-items: stretch; margin-bottom: 24px;
    }
    .client-info-left {
      flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px;
    }
    .notes-card {
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 16px 18px; min-width: 0;
    }
    .notes-card-head {
      display: flex; align-items: center; gap: 7px;
      font-size: 11px; font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 12px;
    }
    .notes-card-body {
      color: var(--text-sec); font-size: 13.5px; line-height: 1.65;
      white-space: pre-wrap; word-break: break-word;
    }

    /* DNS Info Card */
    .dns-info-card {
      flex: 1 1 0; min-width: 0;
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 16px 18px;
    }
    .dns-info-head {
      display: flex; align-items: center; gap: 7px;
      font-size: 11px; font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.9px; color: var(--text-muted); margin-bottom: 14px;
      flex-wrap: wrap;
    }
    .dns-scan-btn { line-height: 1; }
    .dns-info-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 10px 16px;
    }
    .dns-info-item { min-width: 0; }
    .dns-info-item.dns-info-wide { grid-column: 1 / -1; }
    .dns-info-label {
      font-size: 10.5px; font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.7px; color: var(--text-muted); margin-bottom: 3px;
    }
    .dns-info-val { font-size: 13px; color: var(--text-primary); word-break: break-word; }
    .dns-sitemap-val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* Modal section divider */
    .modal-section-divider {
      font-size: 10.5px; font-weight: 600; text-transform: uppercase;
      letter-spacing: 1px; color: var(--text-muted);
      border-top: 1px solid var(--border);
      padding-top: 16px; margin: 4px 0 16px;
    }

    /* Client detail grouped docs */
    .client-doc-group { margin-bottom: 16px; }
    .client-doc-group-label {
      font-size: 10.5px; font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.8px; color: var(--text-muted);
      margin-bottom: 6px;
    }

    .client-stats-row {
      display: grid; grid-template-columns: repeat(3, 1fr);
      gap: 12px; margin-bottom: 28px;
    }
    .client-stat-card {
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 16px 18px;
    }
    .client-stat-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.9px; color: var(--text-muted); margin-bottom: 8px; }
    .client-stat-value { font-family: 'JetBrains Mono', monospace; font-size: 30px; font-weight: 500; color: var(--text-primary); line-height: 1; }
    .client-stat-value.green { color: var(--brand); }

    /* ============================
       TIME RANGE FILTER BAR
    ============================ */
    .time-range-bar {
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      padding: 10px 14px; margin-bottom: 16px;
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--r); font-size: 12.5px; color: var(--text-sec);
    }
    .time-range-bar label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
    .time-range-input {
      background: var(--surface-3); border: 1px solid var(--border);
      border-radius: 5px; padding: 5px 9px; color: var(--text-primary);
      font-family: 'DM Sans', sans-serif; font-size: 12.5px; outline: none;
      transition: border-color 0.15s; cursor: pointer;
    }
    .time-range-input:focus { border-color: var(--brand); }
    .time-range-total {
      margin-left: auto; font-family: 'JetBrains Mono', monospace;
      font-size: 13px; font-weight: 600; color: var(--brand);
      background: var(--brand-dim); border: 1px solid rgba(187,193,59,0.2);
      padding: 3px 11px; border-radius: 20px;
    }
    .time-range-clear {
      background: none; border: none; cursor: pointer; color: var(--text-muted);
      font-family: 'DM Sans', sans-serif; font-size: 12px; padding: 0;
      transition: color 0.13s;
    }
    .time-range-clear:hover { color: var(--text-primary); }

    /* ============================
       DOCUMENTS LIST
    ============================ */
    .doc-item {
      display: flex; align-items: center; gap: 11px;
      padding: 10px 14px; background: var(--surface-2);
      border: 1px solid var(--border); border-radius: var(--r);
      margin-bottom: 6px; transition: border-color 0.13s;
    }
    .doc-item:hover { border-color: var(--border-h); }
    .doc-icon {
      width: 32px; height: 32px; border-radius: 6px;
      background: var(--surface-3); display: flex; align-items: center;
      justify-content: center; flex-shrink: 0; font-size: 16px;
    }
    .doc-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); min-width: 0; }
    .doc-name a { color: inherit; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
    .doc-name a:hover { color: var(--brand); }
    .doc-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

    /* ============================
       USER CARDS (rich users page)
    ============================ */
    .user-card {
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 18px 20px;
      transition: border-color 0.15s;
    }
    .user-card:hover { border-color: var(--border-h); }
    .user-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
    .user-card-avatar {
      width: 48px; height: 48px; border-radius: 50%;
      background: var(--brand-dim); border: 2px solid var(--border-h);
      display: flex; align-items: center; justify-content: center;
      font-size: 17px; font-weight: 700; color: var(--brand); flex-shrink: 0;
    }
    .user-card-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
    .user-card-title { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
    .user-card-stats {
      display: grid; grid-template-columns: repeat(3, 1fr);
      gap: 0; border-top: 1px solid var(--border); padding-top: 14px;
    }
    .user-stat { text-align: center; }
    .user-stat + .user-stat { border-left: 1px solid var(--border); }
    .user-stat-val {
      font-family: 'JetBrains Mono', monospace;
      font-size: 20px; font-weight: 500; color: var(--text-primary); line-height: 1;
    }
    .user-stat-val.green { color: var(--brand); }
    .user-stat-lbl { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; }
    .user-card-contact { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
    .user-contact-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sec); }

    /* ============================
       TASKS VIEW MODE TOGGLE + CLIENT PICKER
    ============================ */
    .view-mode-toggle {
      display: flex; background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r); padding: 3px; gap: 2px; margin-bottom: 20px;
      width: fit-content;
    }
    .view-mode-btn {
      padding: 7px 18px; border-radius: 5px;
      cursor: pointer; font-size: 13px; font-weight: 500;
      color: var(--text-sec); border: none; background: none;
      font-family: 'DM Sans', sans-serif; transition: all 0.13s;
      display: flex; align-items: center; gap: 6px;
    }
    .view-mode-btn:hover { color: var(--text-primary); background: var(--surface-2); }
    .view-mode-btn.active { background: var(--brand); color: #0e0f0a; }

    .client-picker-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
      gap: 12px; margin-bottom: 22px;
    }
    .client-picker-card {
      background: var(--surface-1); border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 14px 16px;
      cursor: pointer; transition: border-color 0.15s, transform 0.15s;
      display: flex; align-items: center; gap: 11px;
    }
    .client-picker-card:hover { border-color: var(--brand); transform: translateY(-1px); }
    .client-picker-name { font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
    .client-picker-count { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

    .tasks-breadcrumb {
      display: flex; align-items: center; gap: 8px;
      margin-bottom: 16px; padding: 10px 14px;
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--r); flex-wrap: wrap;
    }
    .tasks-breadcrumb-btn {
      background: none; border: none; cursor: pointer;
      color: var(--text-sec); font-family: 'DM Sans', sans-serif;
      font-size: 13px; display: flex; align-items: center; gap: 5px;
      padding: 0; transition: color 0.13s;
    }
    .tasks-breadcrumb-btn:hover { color: var(--brand); }

    /* ============================
       TASK TABLE SORT + DRAG
    ============================ */
    thead th.sortable { cursor: pointer; user-select: none; }
    thead th.sortable:hover { color: var(--text-primary); }
    thead th.th-sorted { color: var(--brand); }
    .sort-arr { margin-left: 3px; font-size: 9px; opacity: 0.7; }
    .task-drag-handle {
      cursor: grab; color: var(--text-muted); padding: 2px 4px;
      display: flex; align-items: center; border-radius: 3px;
      opacity: 0; transition: opacity 0.13s;
    }
    .task-drag-handle:active { cursor: grabbing; }
    tbody tr:hover .task-drag-handle { opacity: 0.5; }
    tbody tr.task-dragging { opacity: 0.35; }
    tbody tr.task-drag-over td { border-top: 2px solid var(--brand) !important; }

    /* ============================
       RECURRING TASKS
    ============================ */
    .recurring-chip {
      display: inline-flex; align-items: center; gap: 3px;
      font-size: 10px; padding: 1px 7px; border-radius: 20px;
      background: rgba(139,92,246,0.13); color: #a78bfa;
      border: 1px solid rgba(139,92,246,0.2);
      font-weight: 600; letter-spacing: 0.3px; vertical-align: middle;
      margin-left: 4px;
    }

    /* ============================
       TASK TEMPLATES
    ============================ */
    .template-item {
      display: flex; align-items: center; gap: 12px;
      padding: 11px 14px; background: var(--surface-2);
      border: 1px solid var(--border); border-radius: var(--r);
      cursor: pointer; transition: border-color 0.13s, background 0.13s;
      margin-bottom: 6px;
    }
    .template-item:hover { border-color: var(--brand); background: var(--brand-glow); }
    .template-name { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
    .template-meta { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
    .template-del {
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); padding: 4px; border-radius: 4px;
      opacity: 0; transition: all 0.13s; display: flex; align-items: center;
    }
    .template-item:hover .template-del { opacity: 1; }
    .template-del:hover { color: var(--red); background: var(--red-dim); }

    /* ============================
       CONTACT CARDS REDESIGN
    ============================ */
    .contact-item[draggable="true"] { cursor: grab; }
    .contact-item[draggable="true"]:active { cursor: grabbing; }
    .contact-item.contact-dragging { opacity: 0.35; }
    .contact-item.contact-drag-over { border-color: var(--brand) !important; box-shadow: 0 0 0 2px var(--brand-dim); }
    .contact-photo {
      width: 60px; height: 60px; border-radius: 50%;
      object-fit: cover; border: 2px solid var(--border-h);
      display: block; flex-shrink: 0;
    }
    .contact-avatar-icon {
      width: 60px; height: 60px; border-radius: 50%;
      background: var(--surface-3); border: 2px solid var(--border-h);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; color: var(--text-muted);
    }

/* ============================
   DOCUMENT LIBRARY
============================ */
.documents-actions-bar {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.documents-actions-left { display:flex; gap:8px; flex-wrap:wrap; }

.documents-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.documents-search {
  flex: 1;
  min-width: 240px;
}
.documents-category-input {
  min-width: 220px;
}
.documents-stats {
  margin-bottom: 18px;
}
.document-category-section {
  margin-bottom: 22px;
}
.document-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.document-category-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 24px;
  letter-spacing: 0.7px;
  color: var(--text-primary);
  line-height: 1;
}
.document-category-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.document-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  transition: border-color 0.15s, transform 0.15s;
}
.document-card:hover {
  border-color: var(--border-h);
  transform: translateY(-1px);
}
.document-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.document-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.document-card-actions {
  display: flex;
  gap: 5px;
}
.document-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
}
.document-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.document-card-notes {
  font-size: 12.5px;
  color: var(--text-sec);
  line-height: 1.55;
  margin-bottom: 10px;
}
.document-card-notes.muted {
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .documents-toolbar {
    align-items: stretch;
  }
  .documents-search,
  .documents-category-input {
    min-width: 100%;
    width: 100%;
  }
  .document-grid {
    grid-template-columns: 1fr;
  }
}


.documents-filter-select {
  min-width: 180px;
}
.documents-client-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.document-client-pill {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-sec);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.document-client-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-h);
}
.document-client-pill.active {
  background: var(--brand-dim);
  border-color: rgba(187,193,59,0.28);
  color: var(--brand);
}
.document-client-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.document-category-block + .document-category-block {
  margin-top: 18px;
}
.document-card.pinned,
.doc-item.pinned {
  border-color: rgba(187,193,59,0.32);
  box-shadow: 0 0 0 1px rgba(187,193,59,0.08);
}
.document-pin-chip {
  color: var(--brand);
}
.category-manager-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.category-manager-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13px;
}
@media (max-width: 768px) {
  .documents-filter-select {
    min-width: 100%;
    width: 100%;
  }
}


/* ============================
   DOCUMENT DRAWER
============================ */
.document-drawer-overlay {
  position: fixed !important; inset: 0; background: rgba(0,0,0,0.45); z-index: 840; display: none;
}
.document-drawer-overlay.open { display: block; }
.document-drawer {
  position: fixed !important; top: 0; right: 0; width: min(460px, 92vw); height: 100vh;
  background: var(--surface-1); border-left: 1px solid var(--border-h); z-index: 850;
  transform: translateX(100%); transition: transform 0.22s ease; display: flex; flex-direction: column;
  box-shadow: -12px 0 32px rgba(0,0,0,0.35);
}
.document-drawer.open { transform: translateX(0); }
.document-drawer-head {
  display:flex; align-items:center; justify-content:space-between; padding:18px 20px 14px;
  border-bottom:1px solid var(--border);
}
.document-drawer-content { padding: 18px 20px 24px; overflow-y: auto; display:flex; flex-direction:column; gap:16px; }
.document-drawer-empty { color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.document-drawer-header { display:flex; gap:12px; align-items:flex-start; }
.document-drawer-icon {
  width:44px; height:44px; border-radius:10px; background: var(--surface-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; font-size:22px; flex-shrink:0;
}
.document-drawer-title { font-size: 20px; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.document-drawer-sub { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.document-drawer-actions { display:flex; gap:8px; flex-wrap:wrap; }
.document-drawer-grid { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.document-drawer-section {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px;
}
.document-drawer-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px;
}
.document-drawer-text { font-size: 13px; color: var(--text-sec); line-height: 1.6; word-break: break-word; }
.document-drawer-url a { color: var(--brand); text-decoration: none; word-break: break-all; font-size: 12.5px; }
.document-drawer-url a:hover { text-decoration: underline; }
.document-card { cursor: pointer; }
@media (max-width: 768px) {
  .documents-actions-bar { align-items:stretch; }
  .documents-actions-left { width:100%; }
  .documents-actions-left .btn, .documents-actions-bar > .btn { flex:1; justify-content:center; }
  .document-drawer { width: 100vw; }
  .document-drawer-grid { grid-template-columns: 1fr; }
}

.drive-actions-row { display:flex; gap:8px; align-items:stretch; }
.drive-connect-btn { min-width: 148px; justify-content:center; }
@media (max-width: 640px) { .drive-actions-row { flex-direction:column; } .drive-connect-btn { min-width: 0; width:100%; } }
