/* ═══════════════════════════════════════════════════════════════════
   STRICT 2-FONT LOCKDOWN: ADMIN PANEL & ALL COMPONENTS
   Primary:   'OffBit-DotBold', monospace  (Headings, Titles, Buttons, Tabs, Badges)
   Secondary: 'OffBit-Dot', monospace      (Body, Inputs, Code, Meta, Tables, Logs)
   ═══════════════════════════════════════════════════════════════════ */

/* Global Reset & Base Font Inheritance */
*, *::before, *::after {
  font-family: inherit;
  letter-spacing: normal;
}

html, body {
  font-family: var(--font-secondary) !important;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 1. Primary Font Lockdown: 'OffBit-DotBold' */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
b, strong, th,
.font-bold,
.brand, .brand span, .brand-title, .brand-name,
.auth-brand-title, .auth-brand-subtitle,
.modal-title, .settings-header, .settings-section-title, .picker-header-title,
.tab, .nav-tab,
button, .btn, .btn-unified, .btn-card, .btn-div-item, .btn-text, .btn-broadcast, .btn-save-wa,
.btn-block-dev, .btn-delete-dev, .btn-back-home, .context-cancel-btn,
.badge, .badge-admin, .badge-division, .badge-banned,
.user-email, .org-view-title,
.stat-value, .dash-stat-number, .stat-title, .stat-label,
.task-title, .kanban-col-title, .kanban-col h3,
.syllabus-header, .syllabus-title, .syllabus-cat-title,
.toolbar-title, .task-board-title,
.user-filter, .user-filter-btn, .user-filter.active,
.log-user, .log-action-badge,
.switch-label, .form-label, .prompt-label {
  font-family: var(--font-primary) !important;
  font-weight: 700;
}

/* 2. Secondary Font Lockdown: 'OffBit-Dot' */
p, span, a, label, li, td, dd, dt,
input, textarea, select, option, optgroup,
code, kbd, samp, pre, .CodeMirror, .CodeMirror-scroll, .CodeMirror-lines,
.auth-status-msg, .status-bar, .user-meta, .log-meta, .activity-log-item, .log-time-type,
.task-meta, .task-desc, .task-checklist, .kanban-task-desc, .task-log-entry,
.syllabus-desc, .syllabus-item,
.path-bar, .path-link, .path-separator, .file-name, .file-item,
.org-sidebar-desc, .announcement-input, .search-input, .search-users-input,
.prompt-input, .auth-input, .form-input, .form-textarea, .form-select,
.toast, .toast-msg, .toast-container,
.custom-modal, .custom-modal-msg, .custom-prompt-input,
.api-keys-card, .api-keys-table, #apiKeyRevealText {
  font-family: var(--font-secondary) !important;
  font-weight: 400;
}

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

.main-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
    
    /* Auth Overlay */
    #authOverlay {
      position: fixed; top: 0; left: 0; right: 0; bottom: 0;
      background: var(--c1); z-index: 99999;
      display: flex; align-items: center; justify-content: center; flex-direction: column;
    }
    #authOverlay.hidden { display: none !important; }
    
    .spinner {
      width: 40px; height: 40px; border: 3px solid var(--border-light);
      border-top-color: var(--c4); border-radius: 50%;
      animation: spin 1s linear infinite; margin-bottom: 20px;
    }
    @keyframes spin { 100% { transform: rotate(360deg); } }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes authLogoFloat { 0% { transform: translateY(0); } 50% { transform: translateY(-8px); } 100% { transform: translateY(0); } }

    /* Bottom Dock */
    .bottom-dock {
      position: fixed; bottom: 0; left: 0; right: 0; height: calc(60px + env(safe-area-inset-bottom, 0px));
      background: var(--c1); border-top: 1.5px solid var(--c3);
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 24px env(safe-area-inset-bottom, 0px) 24px; z-index: 100; gap: 16px;
    }
    .brand { display: flex; align-items: center; }
    .btn-back-home {
      display: flex; align-items: center; justify-content: center;
      width: 32px; height: 32px; background: color-mix(in srgb, var(--c3) 5%, transparent);
      color: var(--c3); text-decoration: none; border: 1.5px solid var(--c3);
      transition: 0.2s;
    }
    .btn-back-home:hover { background: var(--c3); color: var(--c1); transform: translateX(-2px); }
    
    .content-area {
      display: flex;
      flex: 1;
      height: calc(100dvh - 60px - env(safe-area-inset-bottom, 0px));
      overflow: hidden;
    }

    /* Main Area */
    .main-panel {
      flex: 1; display: flex; flex-direction: column; background: var(--c1);
    }

    .toolbar { padding: 16px 24px; border-bottom: 1.5px solid var(--c3); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

    .btn-unified {
      background: var(--c2);
      color: var(--c3);
      border: 1.5px solid var(--c3);
      padding: 9px 18px;
      border-radius: var(--radius-pill);
      cursor: pointer;
      font-family: var(--font-primary);
      font-size: 14px;
      font-weight: 700;
      line-height: 1.2;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      justify-content: center;
      min-height: 38px;
      box-sizing: border-box;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
      box-shadow: none;
      user-select: none;
      text-decoration: none;
      white-space: nowrap;
    }
    .btn-unified:hover { background: var(--c3); color: var(--c1); border-color: var(--c3); }
    .btn-unified:active { transform: scale(0.98); }
    .btn-unified:focus-visible { outline: 2px solid var(--c4); outline-offset: 2px; }
    .btn-unified.primary { background: var(--c3); color: var(--c1); border: 1.5px solid var(--c3); font-weight: 700; border-radius: var(--radius-pill); box-shadow: none; }
    .btn-unified.primary:hover { background: var(--c4); color: var(--c1); border-color: var(--c4); transform: none; box-shadow: none; }
    .btn-unified.primary:active { transform: scale(0.98); }
    .btn-unified.danger { background: transparent; color: var(--c4); border: 1.5px solid var(--c4); }
    .btn-unified.danger:hover { background: var(--c4); color: var(--c1); border-color: var(--c4); }
    .btn-unified.danger-fill { background: var(--c4); color: var(--c1); border: 1.5px solid var(--c4); font-weight: 700; }
    .btn-unified.danger-fill:hover { background: color-mix(in srgb, var(--c4) 85%, black); border-color: var(--c4); }
    .btn-unified.warning { background: transparent; color: var(--c4); border: 1.5px solid var(--c4); }
    .btn-unified.warning:hover { background: var(--c4); color: var(--c1); border-color: var(--c4); }
    .btn-unified.muted { background: var(--c1); color: var(--c3); border: 1.5px solid var(--border-medium); }
    .btn-unified.muted:hover { background: var(--c2); border-color: var(--c3); }
    .btn-unified.sm { padding: 6px 14px; font-size: 13px; min-height: 32px; font-weight: 700; }
    .btn-unified.xs { padding: 4px 10px; font-size: 12px; min-height: 26px; font-weight: 700; }
    .btn-unified.btn-loading { pointer-events: none; opacity: 0.85; }

    .btn-text {
      background: transparent;
      color: var(--c3);
      border: 1.5px solid transparent;
      border-radius: 6px;
      padding: 6px 10px;
      font-family: var(--font-primary);
      font-size: 13px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
      opacity: 0.75;
      line-height: 1;
    }
    .btn-text:hover {
      opacity: 1;
      background: var(--border-light);
      border-color: var(--border-medium);
      color: var(--c4);
    }
    .btn-text:active { transform: scale(0.96); }

    .toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

    .path-bar {
      padding: 10px 20px;
      background: var(--bg-surface, var(--c2));
      border-bottom: 1.5px solid var(--border-light, var(--c3));
      display: flex;
      align-items: center;
      gap: 6px;
      overflow-x: auto;
      white-space: nowrap;
      scrollbar-width: thin;
      -webkit-overflow-scrolling: touch;
      font-family: var(--font-primary, sans-serif);
      box-sizing: border-box;
      min-height: 44px;
    }
    .path-bar::-webkit-scrollbar {
      height: 4px;
    }
    .path-bar::-webkit-scrollbar-thumb {
      background: var(--border-medium);
      border-radius: 4px;
    }
    .path-link {
      cursor: pointer;
      color: var(--text-main);
      font-weight: 600;
      font-size: 13px;
      padding: 5px 10px;
      border-radius: 6px;
      background: color-mix(in srgb, var(--c3) 14%, transparent);
      border: 1px solid color-mix(in srgb, var(--c3) 25%, transparent);
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: background 0.15s, color 0.15s, border-color 0.15s;
      touch-action: manipulation;
      user-select: none;
      -webkit-user-select: none;
    }
    .path-link:hover, .path-link:active {
      background: color-mix(in srgb, var(--accent) 18%, transparent);
      color: var(--accent);
      border-color: var(--accent);
    }
    .path-current {
      font-size: 13px;
      font-weight: 700;
      color: var(--accent);
      padding: 5px 10px;
      border-radius: 6px;
      background: color-mix(in srgb, var(--accent) 14%, transparent);
      border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
      display: inline-flex;
      align-items: center;
      cursor: default;
      user-select: none;
      -webkit-user-select: none;
    }
    .path-separator {
      margin: 0 4px;
      color: var(--text-muted);
      opacity: 0.6;
      font-size: 13px;
      user-select: none;
      -webkit-user-select: none;
    }

    .file-browser {
      flex: 1;
      overflow-y: auto;
      padding: 12px 18px;
      list-style: none;
      max-width: 1400px;
      margin: 0 auto;
      width: 100%;
      box-sizing: border-box;
      -webkit-overflow-scrolling: touch;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .file-item {
      display: flex;
      align-items: center;
      padding: 10px 14px;
      min-height: 48px;
      border: 1.5px solid var(--border-light, var(--c3));
      border-radius: 8px;
      background: var(--bg-card, var(--c1));
      transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
      font-family: var(--font-primary, sans-serif);
      font-size: 14px;
      cursor: pointer;
      user-select: none;
      -webkit-user-select: none;
      touch-action: manipulation;
      position: relative;
      gap: 10px;
    }
    .file-item:hover {
      background: color-mix(in srgb, var(--accent) 7%, var(--bg-card, var(--c1)));
      border-color: color-mix(in srgb, var(--accent) 40%, var(--border-light, var(--c3)));
    }
    .file-item:active {
      transform: scale(0.99);
    }
    .file-item.selected {
      background: color-mix(in srgb, var(--accent) 15%, var(--bg-card, var(--c1))) !important;
      border-color: var(--accent) !important;
      box-shadow: 0 0 0 1px var(--accent);
    }
    .file-item.file-item-parent {
      border-style: dashed !important;
      background: color-mix(in srgb, var(--accent) 5%, var(--bg-card, var(--c1)));
    }
    .file-item.file-item-parent:hover {
      border-color: var(--accent) !important;
      background: color-mix(in srgb, var(--accent) 12%, var(--bg-card, var(--c1)));
    }
    .file-icon {
      font-size: 20px;
      width: 28px;
      height: 28px;
      min-width: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .file-name {
      flex: 1;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-weight: 500;
      color: var(--text-main);
      font-size: 14px;
    }
    .file-actions {
      display: flex;
      gap: 4px;
      align-items: center;
      justify-content: flex-end;
      margin-left: auto;
      flex-shrink: 0;
    }
    .file-checkbox-wrap {
      width: 38px;
      height: 38px;
      min-width: 38px;
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      touch-action: manipulation;
      z-index: 2;
      border-radius: 6px;
      flex-shrink: 0;
      transition: background 0.15s;
    }
    .file-checkbox-wrap:hover {
      background: color-mix(in srgb, var(--c3) 15%, transparent);
    }
    .file-checkbox {
      width: 18px;
      height: 18px;
      cursor: pointer;
      accent-color: var(--accent);
      margin: 0;
    }
    .btn-actions {
      width: 38px;
      height: 38px;
      min-width: 38px;
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: none;
      cursor: pointer;
      border-radius: 6px;
      color: var(--text-muted);
      transition: background 0.15s, color 0.15s;
      touch-action: manipulation;
      z-index: 2;
      padding: 0;
      flex-shrink: 0;
    }
    .btn-actions:hover, .btn-actions:active {
      background: color-mix(in srgb, var(--c3) 20%, transparent);
      color: var(--text-main);
    }
    .file-browser:not(.grid-mode) .file-actions {
      opacity: 0;
      transition: opacity 0.15s;
    }
    .file-browser:not(.grid-mode) .file-item:hover .file-actions,
    .file-browser:not(.grid-mode) .file-item.selected .file-actions {
      opacity: 1;
    }
    @media (hover: none), (max-width: 768px) {
      .file-actions {
        opacity: 1 !important;
        pointer-events: auto !important;
      }
    }

    .status-bar {
  position: fixed; bottom: 24px; right: 24px; z-index: 9998;
  background: var(--bg-card); border: var(--border-main); border-radius: var(--radius-card);
  padding: 12px 16px; font-size: 12px; color: var(--text-main); font-family: var(--font-mono);
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 16px var(--border-light);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.status-bar.active {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}

    #superAdminSection {
      padding: 16px 24px; border-top: 1.5px solid var(--c3); background: var(--c2);
      display: none;
    }
    


    .auth-input { background: var(--c1); border: 1px solid var(--border-medium); color: var(--c3); padding: 10px 14px; font-size: 14px; border-radius: var(--radius-pill); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
    .auth-input:focus { border-color: var(--c4); box-shadow: 0 0 0 3px var(--focus-ring); }

    /* ══ TEAM CATALOG & USER BROWSER ══ */
    .user-catalog-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      min-width: 0;
      background: var(--bg-main);
    }

    .user-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
      gap: 16px;
      padding: 20px;
      overflow-y: auto;
    }

    .user-card {
      background: var(--c2);
      border: 1.5px solid var(--c3);
      border-radius: 10px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      transition: border-color 0.15s ease, background 0.15s ease;
      min-width: 0;
      box-sizing: border-box;
    }

    .user-card:hover {
      border-color: var(--c4);
    }

    .user-card-header {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      min-width: 0;
    }

    .user-avatar-badge {
      width: 40px;
      height: 40px;
      min-width: 40px;
      border-radius: 8px;
      background: var(--c1);
      border: 1.5px solid var(--c3);
      color: var(--c3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-primary);
      font-weight: 700;
      font-size: 14px;
      letter-spacing: 0.5px;
      position: relative;
      flex-shrink: 0;
    }

    .user-avatar-badge.is-online::after {
      content: "";
      position: absolute;
      bottom: -3px;
      right: -3px;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--c3);
      border: 2px solid var(--c1);
    }

    .user-card-main-info {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .user-card-top-line {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .user-username {
      font-family: var(--font-primary);
      font-size: 15px;
      font-weight: 700;
      color: var(--c3);
      letter-spacing: 0.04em;
      text-transform: uppercase;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .user-email-text {
      font-family: var(--font-secondary);
      font-size: 13px;
      color: color-mix(in srgb, var(--c3) 80%, transparent);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .user-badges-wrap {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
      margin-top: 4px;
    }

    .badge {
      padding: 3px 8px;
      border-radius: 6px;
      font-family: var(--font-primary);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.06em;
      white-space: nowrap;
      text-transform: uppercase;
      line-height: 1.2;
    }

    .badge-admin {
      background: var(--c3);
      color: var(--c1);
      border: 1px solid var(--c3);
    }

    .badge-member {
      background: transparent;
      color: var(--c3);
      border: 1px solid color-mix(in srgb, var(--c3) 40%, transparent);
    }

    .badge-division {
      background: var(--c1);
      color: var(--c3);
      border: 1.5px solid var(--c3);
    }

    .badge-banned {
      background: var(--danger);
      color: var(--c1);
      border: 1px solid var(--danger);
    }

    .badge-guest {
      background: color-mix(in srgb, var(--c3) 12%, transparent);
      color: var(--c3);
      border: 1px dashed var(--c3);
    }

    /* Device Drawer inside Cards */
    .user-device-drawer {
      border: 1px solid var(--border-medium);
      background: var(--c1);
      border-radius: 8px;
      padding: 8px 12px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .user-device-drawer-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-family: var(--font-primary);
      font-size: 12px;
      color: var(--c3);
      cursor: pointer;
      user-select: none;
    }

    .device-count-badge {
      display: flex;
      align-items: center;
      gap: 6px;
      font-weight: 700;
    }

    .btn-toggle-dev-list {
      background: transparent;
      border: none;
      color: var(--c3);
      font-family: var(--font-primary);
      font-size: 11px;
      cursor: pointer;
      padding: 2px 6px;
      border-radius: 4px;
      opacity: 0.8;
      transition: opacity 0.15s;
    }

    .btn-toggle-dev-list:hover {
      opacity: 1;
      text-decoration: underline;
    }

    .user-device-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 4px;
      padding-top: 6px;
      border-top: 1px dashed var(--border-light);
    }

    .user-device-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 4px 0;
      font-size: 12px;
      font-family: var(--font-secondary);
      color: var(--c3);
      gap: 8px;
    }

    .user-device-id {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
      font-family: var(--font-secondary);
    }

    .user-device-actions {
      display: flex;
      gap: 4px;
      flex-shrink: 0;
    }

    .btn-dev-action {
      font-family: var(--font-primary);
      font-size: 12px;
      font-weight: 700;
      padding: 5px 10px;
      min-height: 28px;
      border-radius: 4px;
      border: 1px solid var(--c3);
      background: var(--c2);
      color: var(--c3);
      cursor: pointer;
      transition: 0.15s;
    }

    .btn-dev-action:hover {
      background: var(--c3);
      color: var(--c1);
    }

    .btn-dev-action.danger {
      border-color: var(--danger);
      color: var(--danger);
      background: transparent;
    }

    .btn-dev-action.danger:hover {
      background: var(--danger);
      color: var(--c1);
    }

    .card-actions {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 12px;
    }

    .card-actions .btn-card {
      padding: 6px 10px;
      font-size: 12px;
      min-height: 30px;
      border-radius: 6px;
    }

    /* ══ USER TABLE VIEW (HIGH DENSITY) ══ */
    .user-table-wrapper {
      padding: 20px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      flex: 1;
    }

    .user-table {
      width: 100%;
      border-collapse: collapse;
      background: var(--c2);
      border: 1.5px solid var(--c3);
      border-radius: 10px;
      overflow: hidden;
      font-size: 13px;
    }

    .user-table th {
      background: var(--c1);
      color: var(--c3);
      font-family: var(--font-primary);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 12px 16px;
      border-bottom: 1.5px solid var(--c3);
      text-align: left;
      white-space: nowrap;
    }

    .user-table td {
      padding: 12px 16px;
      border-bottom: 1px solid var(--border-light);
      color: var(--c3);
      font-family: var(--font-secondary);
      vertical-align: middle;
    }

    .user-table tr:last-child td {
      border-bottom: none;
    }

    .user-table tr:hover td {
      background: color-mix(in srgb, var(--c3) 4%, transparent);
    }

    .user-table-actions {
      display: flex;
      gap: 6px;
      justify-content: flex-end;
      flex-wrap: wrap;
    }

    .user-table-actions .btn-card {
      padding: 6px 10px;
      font-size: 12px;
      min-height: 32px;
      border-radius: 4px;
      flex: 0 0 auto;
    }

    .btn-card {
      background: var(--c1);
      color: var(--c3);
      border: 1.5px solid var(--c3);
      padding: 7px 14px;
      border-radius: var(--radius-pill);
      font-family: var(--font-primary);
      font-size: 13px;
      font-weight: 700;
      line-height: 1.2;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-height: 34px;
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
      flex: 1 1 auto;
      text-align: center;
      box-shadow: none;
      white-space: nowrap;
      min-width: fit-content;
      box-sizing: border-box;
      user-select: none;
      text-decoration: none;
    }
    .btn-card:hover { background: var(--c3); color: var(--c1); border-color: var(--c3); }
    .btn-card:active { transform: scale(0.98); }
    .btn-card:focus-visible { outline: 2px solid var(--c4); outline-offset: 2px; }
    .btn-card.danger { background: transparent; color: var(--c4); border-color: var(--c4); }
    .btn-card.danger:hover { background: var(--c4); color: var(--c1); }
    .btn-card.primary { background: var(--c3); color: var(--c1); border-color: var(--c3); box-shadow: none; }
    .btn-card.primary:hover { background: var(--c4); color: var(--c1); border-color: var(--c4); box-shadow: none; }
    .btn-card.primary:active { transform: scale(0.98); }
    .btn-card.btn-loading { pointer-events: none; opacity: 0.85; }

    /* File Grid Mode */
    .file-browser.grid-mode {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      grid-auto-rows: min-content;
      align-content: start;
      gap: 12px;
      padding: 16px 20px;
    }
    .file-browser.grid-mode .file-item {
      flex-direction: column;
      border: 1.5px solid var(--border-light, var(--c3));
      border-radius: 10px;
      padding: 30px 10px 14px 10px;
      justify-content: flex-start;
      align-items: center;
      text-align: center;
      position: relative;
      min-height: 125px;
      background: var(--bg-card, var(--c1));
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    .file-browser.grid-mode .file-item:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    .file-browser.grid-mode .file-item:active {
      transform: scale(0.98);
    }
    .file-browser.grid-mode .file-item.file-item-parent {
      border-style: dashed;
      justify-content: center;
      padding: 14px 10px;
    }
    .file-browser.grid-mode .file-name {
      width: 100%;
      white-space: normal;
      word-break: break-word;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      font-size: 12.5px;
      font-weight: 600;
      line-height: 1.35;
      color: var(--text-main);
      margin-top: auto;
      text-align: center;
      padding: 0 4px;
    }
    .file-browser.grid-mode .file-icon {
      margin: 4px 0 10px 0;
      width: 36px;
      height: 36px;
    }
    .file-browser.grid-mode .file-icon svg {
      width: 34px;
      height: 34px;
      stroke-width: 1.8;
    }
    .file-browser.grid-mode .file-actions {
      position: absolute;
      top: 4px;
      right: 4px;
      opacity: 1 !important;
      pointer-events: auto !important;
      margin: 0;
    }
    .file-browser.grid-mode .file-checkbox-wrap {
      position: absolute;
      top: 4px;
      left: 4px;
      margin: 0;
    }
    
    /* Drag & Drop */
    #viewFiles { position: relative; }
    #dragOverlay {
      position: absolute; top: 0; left: 0; right: 0; bottom: 0;
      background: var(--scrim);
      border: 3px dashed var(--c4);
      border-radius: 8px;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      z-index: 50; opacity: 0; pointer-events: none; transition: 0.2s;
    }
    #dragOverlay.drag-active { opacity: 1; pointer-events: all; }
    
    /* Lightbox Modal (File Displayer) */
    #lightboxModal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: color-mix(in srgb, var(--c3) 75%, transparent);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      z-index: var(--z-overlay-base, 10000);
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      opacity: 1;
      pointer-events: auto;
      visibility: visible;
      transition: opacity 0.2s ease, visibility 0.2s ease;
      overflow: hidden;
    }
    #lightboxModal.hidden {
      display: none !important;
      opacity: 0;
      pointer-events: none;
      visibility: hidden;
    }

    /* Top Bar for File Displayer */
    #lightboxHeader {
      position: relative;
      flex-shrink: 0;
      width: 100%;
      min-height: 52px;
      height: 52px;
      background: var(--c2);
      border-bottom: 1.5px solid var(--c3);
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 16px;
      padding-top: env(safe-area-inset-top, 0px);
      color: var(--c3);
      gap: 12px;
      z-index: 100;
      box-sizing: border-box;
    }

    .lightbox-header-left {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      flex: 1;
    }
    .lightbox-header-left svg {
      flex-shrink: 0;
      color: var(--c3);
    }
    #lightboxFilename {
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 700;
      color: var(--c3);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
    }

    .lightbox-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-shrink: 0;
    }
    .lightbox-actions .btn-unified {
      min-height: 34px;
      height: 34px;
      padding: 0 12px;
      font-size: 12px;
    }

    /* Content Area */
    #lightboxContentWrapper {
      position: relative;
      flex: 1;
      width: 100%;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
      box-sizing: border-box;
      overflow: auto;
    }

    #lightboxFrame {
      width: 100%;
      max-width: 1280px;
      height: 100%;
      border: 1.5px solid var(--c3);
      border-radius: var(--radius-card, 8px);
      background: #ffffff;
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
      box-sizing: border-box;
      display: block;
    }

    #lightboxImage {
      max-width: 94vw;
      max-height: calc(100% - 10px);
      object-fit: contain;
      border-radius: 8px;
      border: 1.5px solid var(--c3);
      background: var(--c2);
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    }

    #lightboxText {
      width: 90%;
      max-width: 960px;
      height: 100%;
      max-height: 100%;
      background: var(--c2);
      color: var(--c3);
      padding: 24px;
      border-radius: 8px;
      overflow: auto;
      font-family: var(--font-mono);
      font-size: 13px;
      border: 1.5px solid var(--c3);
      white-space: pre-wrap;
      word-break: break-word;
      line-height: 1.6;
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
      box-sizing: border-box;
    }

    @media (max-width: 768px) {
      #lightboxHeader {
        height: 48px;
        min-height: 48px;
        padding: 0 10px;
        padding-top: env(safe-area-inset-top, 0px);
      }
      #lightboxFilename {
        font-size: 12px;
      }
      #lightboxContentWrapper {
        padding: 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
      }
      #lightboxFrame {
        border-radius: 6px;
      }
    }

    /* Tabs */
    .tabs {
      display: flex; gap: 8px; flex: 1; justify-content: center; overflow-x: auto;
    }
    .tab { padding: 12px 22px; font-size: 14px; font-weight: 600; color: color-mix(in srgb, var(--c3) 85%, transparent);
      cursor: pointer; border: 1px solid transparent; transition: 0.2s;
      display: flex; align-items: center; gap: 8px;
    }
    .tab svg { width: 20px; height: 20px; }
    .tab:hover { color: var(--c4); background: color-mix(in srgb, var(--c3) 8%, transparent); }
    .tab.active {
      color: var(--c4);
      font-weight: 700;
      border-color: var(--border-light);
      background: var(--card-bg);
      border-bottom: 2.5px solid var(--c4);
      box-shadow: none;
    }

    /* View Sections */
    .view-section { display: none; flex-direction: column; flex: 1; overflow: hidden; }
    .view-section.active { display: flex; }

    /* Row-layout view (Team / Users: sidebar + content side by side) */
    .view-section-row { display: none; flex-direction: row; flex: 1; overflow: hidden; }
    .view-section-row.active { display: flex; }

    /* Docs View Embedded */
    #viewDocs { display: none; flex-direction: column; flex: 1; height: 100%; width: 100%; overflow: hidden; }
    #viewDocs.active { display: flex !important; }
    #viewDocs iframe { flex: 1; width: 100%; height: 100%; border: none; }


    
    /* Editor Layout Polish */
    .CodeMirror { height: 100% !important; font-size: 14px; font-family: var(--font-mono); }
    .editor-container { flex: 1; overflow: hidden; border: 1.5px solid var(--c3); border-radius: 8px; display: flex; flex-direction: row; position: relative; margin-top: 16px; }
    .editor-resizer {
      width: 6px; background: var(--border-light); cursor: col-resize; z-index: 10;
      display: flex; align-items: center; justify-content: center; transition: 0.2s;
    }
    .editor-resizer:hover, .editor-resizer.dragging { background: var(--c4); }
    .editor-resizer::after { content: "⋮"; font-family: var(--font-mono); color: color-mix(in srgb, var(--c3) 60%, transparent); font-size: 12px; }
    .editor-modal.fullscreen {
      width: 100vw !important; height: 100vh !important; max-width: 100vw !important;
      margin: 0; padding: 0; border: none; z-index: 9999;
    }

    /* Mobile Top Header (hidden on desktop) */
    .admin-mobile-header {
      display: none;
    }
    .mobile-filter-dropdowns {
      display: none;
    }
    .mobile-kanban-column-select {
      display: none;
    }
    .mobile-user-box {
      max-width: 440px;
    }
    .mobile-user-card-info {
      display: flex;
      gap: 14px;
      align-items: center;
      padding: 14px;
      background: var(--c2);
      border-radius: var(--radius-card);
      border: 1.5px solid var(--c3);
    }
    .mobile-user-avatar-large {
      width: 46px;
      height: 46px;
      min-width: 46px;
      font-size: 16px;
      font-weight: 700;
      border-radius: 50%;
      background: var(--c1);
      color: var(--c3);
      border: 1.5px solid var(--c3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-primary);
    }
    .mobile-user-details {
      display: flex;
      flex-direction: column;
      gap: 3px;
      min-width: 0;
      flex: 1;
    }
    .mobile-user-name {
      font-family: var(--font-primary);
      font-size: 16px;
      font-weight: 700;
      color: var(--text-main);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .mobile-user-email {
      font-family: var(--font-secondary);
      font-size: 12.5px;
      color: var(--text-muted);
      word-break: break-all;
    }
    .mobile-user-badges {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 4px;
    }
    .mobile-wa-section {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .mobile-wa-input-row {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .mobile-user-actions {
      display: flex;
      gap: 8px;
      width: 100%;
    }
    .mobile-modal-btn {
      flex: 1;
      justify-content: center;
      text-align: center;
      min-height: 40px;
    }

    /* ═══════════════════════════════════════════════════════════════
       MOBILE & TABLET RESPONSIVENESS & TOUCH OPTIMIZATION (<= 1024px / iPad)
       ═══════════════════════════════════════════════════════════════ */
    @media (max-width: 1024px) {
      /* Prevent iOS Safari Automatic Zoom on Focus */
      input, select, textarea, .auth-input, .task-select, .task-input-search {
        font-size: 16px !important;
      }

      /* Mobile Top Header - Ultra Slim & Space-Efficient */
      .admin-mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 42px;
        background: var(--c1);
        border-bottom: 1.5px solid var(--c3);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        z-index: 90;
        box-sizing: border-box;
      }
      .admin-mobile-header-left {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
      }
      .admin-mobile-header-left .btn-back-home {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
      }
      .admin-mobile-brand {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
      }
      .admin-mobile-brand-img {
        height: 18px;
        width: 18px;
        flex-shrink: 0;
      }
      .admin-mobile-brand-title {
        font-family: var(--font-sans);
        font-size: 14px;
        font-weight: 700;
        color: var(--text-main);
        letter-spacing: 0.04em;
        white-space: nowrap;
      }
      .admin-mobile-user-btn {
        width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 0 !important;
        border-radius: 50% !important;
        font-size: 12px;
        font-weight: 700;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: var(--c2);
        color: var(--c3);
        border: 1.5px solid var(--c3);
        flex-shrink: 0;
        cursor: pointer;
      }

      /* Content Area Viewport Fit - Maximizes Scrollable Space */
      .content-area {
        height: calc(100dvh - 42px - 56px - max(env(safe-area-inset-bottom, 0px), 8px));
        margin-top: 42px;
        overflow: hidden;
      }

      /* Bottom Dock Navigation - Compact Touch Bar */
      .bottom-dock {
        padding: 0 4px max(env(safe-area-inset-bottom, 0px), 8px) 4px;
        height: calc(56px + max(env(safe-area-inset-bottom, 0px), 8px));
        box-sizing: border-box;
        background: var(--c1);
        border-top: 1.5px solid var(--c3);
        z-index: var(--z-dock, 100);
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      .bottom-dock .brand { display: none !important; }
      .bottom-dock .user-info { display: none !important; }
      .bottom-dock .tabs {
        width: 100%;
        display: flex;
        justify-content: space-around;
        align-items: center;
        gap: 1px;
        height: 56px;
      }
      .bottom-dock .tab {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 4px 1px;
        font-size: 11px;
        flex: 1 1 0;
        height: 100%;
        min-width: 0;
        border: none;
        border-radius: 4px;
        background: transparent;
        color: var(--text-muted);
        gap: 2px;
        transition: color 0.15s ease, background 0.15s ease;
        user-select: none;
        cursor: pointer;
        box-sizing: border-box;
      }
      .bottom-dock .tab svg {
        width: 20px;
        height: 20px;
        margin-bottom: 0;
        stroke: currentColor;
        flex-shrink: 0;
      }
      .bottom-dock .tab .tab-label {
        font-family: var(--font-primary);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
      }
      .bottom-dock .tab.active {
        background: color-mix(in srgb, var(--c3) 12%, transparent);
        color: var(--c4);
        border: none;
        border-top: 2.5px solid var(--c4);
        border-radius: 0 0 6px 6px;
        font-weight: 800;
      }

      /* ── View 1: Dashboard Mobile Layout ── */
      #viewDashboard {
        display: none;
        flex-direction: column;
        height: 100%;
        overflow-y: auto;
      }
      #viewDashboard.active {
        display: flex;
      }
      #viewDashboard .toolbar {
        padding: 8px 10px;
        justify-content: space-between;
      }
      .dashboard-container {
        padding: 8px 10px !important;
        gap: 10px !important;
        display: flex;
        flex-direction: column;
      }
      .analytics-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        width: 100%;
      }
      .analytics-card {
        padding: 10px !important;
      }
      .dashboard-row {
        display: flex;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100%;
      }
      .card-column {
        min-width: 100% !important;
        max-height: 340px !important;
      }

      /* ── View 2: Files Mobile Layout ── */
      #viewFiles {
        display: none;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
      }
      #viewFiles.active {
        display: flex;
      }
      #viewFiles .toolbar {
        padding: 6px 10px;
        gap: 6px;
        flex-wrap: nowrap;
        align-items: center;
      }
      #viewFiles .toolbar .auth-input {
        height: 36px;
        padding: 4px 10px;
        font-size: 13px;
        flex: 1;
        min-width: 0;
      }
      #viewFiles .toolbar {
        padding: 8px 10px;
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
      }
      #viewFiles .toolbar::-webkit-scrollbar {
        display: none;
      }
      #viewFiles .toolbar > .btn-unified,
      #viewFiles .toolbar .toolbar-actions .btn-unified {
        height: 38px;
        min-height: 38px;
        padding: 6px 12px;
        font-size: 12.5px;
        flex-shrink: 0;
        white-space: nowrap;
      }
      .toolbar-actions {
        display: flex;
        gap: 6px;
        align-items: center;
        flex-shrink: 0;
      }
      .path-bar {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 40px;
        height: auto;
        box-sizing: border-box;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
      }
      .path-bar::-webkit-scrollbar {
        display: none;
      }
      .path-link, .path-current {
        padding: 4px 8px;
        font-size: 12px;
      }
      .file-browser {
        padding: 8px 10px !important;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }
      .file-browser.grid-mode {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)) !important;
        padding: 8px !important;
        gap: 8px !important;
      }
      .file-browser.grid-mode .file-item {
        min-height: 115px;
        padding: 26px 6px 10px 6px;
      }
      .file-browser.grid-mode .file-icon {
        width: 30px;
        height: 30px;
        margin: 2px 0 6px 0;
      }
      .file-browser.grid-mode .file-icon svg {
        width: 28px;
        height: 28px;
      }
      .file-browser.grid-mode .file-name {
        font-size: 11.5px;
      }
      .file-item {
        padding: 8px 10px;
        min-height: 48px;
      }

      /* ── View 3: Users & Team Mobile Layout (Compact header & maximum scroll area) ── */
      .view-section-row {
        flex-direction: column !important;
        height: 100%;
        overflow: hidden;
      }
      .org-sidebar {
        display: none !important; /* Replaced by mobile division selector dropdown */
      }
      .main-content-layout {
        width: 100% !important;
        height: 100% !important;
        flex: 1;
        overflow-y: auto;
      }
      .org-toolbar-layout {
        padding: 6px 10px !important;
      }
      .toolbar-row {
        flex-direction: row;
        align-items: center;
        gap: 6px;
      }
      .toolbar-row .search-wrap-box {
        flex: 1;
        min-width: 0;
        max-width: none;
      }
      .toolbar-row .btn-flex-layout {
        display: flex;
        gap: 4px;
        flex-shrink: 0;
      }
      .toolbar-row .btn-flex-layout .btn-unified {
        height: 36px;
        min-height: 36px;
        padding: 6px 10px;
        font-size: 12px;
      }
      .switch-controls-row {
        display: flex;
        flex-direction: column !important;
        padding: 6px 10px !important;
        gap: 8px !important;
      }
      .switch-group {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        width: 100%;
      }
      .switch-label {
        font-size: 12px;
        font-weight: 700;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 6px;
      }
      .announcement-group {
        display: flex;
        gap: 6px;
        width: 100%;
      }
      .announcement-input {
        flex: 1;
        width: auto !important;
        min-width: 0;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
      }
      .announcement-group .btn-unified {
        height: 36px;
        min-height: 36px;
        padding: 6px 12px;
        font-size: 12px;
      }
      .guest-cleanup-team-card {
        width: 100%;
        padding: 6px 10px;
        box-sizing: border-box;
      }
      .guest-cleanup-inner {
        width: 100%;
        justify-content: space-between;
      }
      .guest-cleanup-hours-input {
        width: 56px;
        height: 36px;
        font-size: 14px;
      }
      .guest-cleanup-team-card .guest-cleanup-btn {
        height: 36px;
        min-height: 36px;
        padding: 6px 12px;
        font-size: 12.5px;
      }
      .mobile-filter-dropdowns {
        display: flex !important;
        gap: 6px;
        width: 100%;
        margin-bottom: 0;
      }
      .mobile-division-dropdown,
      .mobile-user-filter-dropdown {
        flex: 1;
        min-width: 0;
        font-size: 12.5px;
        padding: 6px 10px;
        height: 36px;
        border-radius: var(--radius-card);
        background-color: var(--c2);
        color: var(--c3);
        border: 1.5px solid var(--c3);
        font-family: var(--font-primary);
        font-weight: 700;
      }
      .user-filter-container {
        padding: 6px 10px !important;
        flex-direction: column !important;
        gap: 6px !important;
        overflow-x: visible !important;
      }
      .user-filter-pill-group {
        display: none !important; /* Replaced by mobile dropdown on small screens */
      }
      .user-stats-ribbon {
        margin-left: 0 !important;
        width: 100%;
        text-align: center;
        font-size: 12px;
        padding: 4px 8px;
      }
      .user-grid {
        grid-template-columns: 1fr !important;
        padding: 8px 10px !important;
        gap: 10px !important;
      }
      .user-card {
        padding: 12px;
      }
      .card-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-top: 10px;
      }
      .card-actions .btn-card {
        width: 100%;
        justify-content: center;
        font-size: 12px;
        padding: 8px 10px;
        min-height: 34px;
      }

      /* ── View 4: Tasks Mobile Layout (Ultra-compact top bar) ── */
      #viewTasks {
        display: none;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
      }
      #viewTasks.active {
        display: flex;
      }
      .task-board-toolbar-wrap {
        padding: 6px 10px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
      }
      .task-board-toolbar {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
      }
      .task-board-title {
        font-size: 15px !important;
        white-space: nowrap;
        margin: 0;
      }
      .task-board-toolbar .task-select {
        height: 36px;
        padding: 6px 10px;
        font-size: 12.5px;
        flex: 1;
        min-width: 0;
      }
      .mobile-kanban-column-select {
        display: block !important;
        font-size: 12.5px;
        padding: 6px 10px;
        height: 36px;
        flex: 1;
        min-width: 0;
      }
      .task-board-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
      }
      .task-input-search {
        grid-column: 1 / -1;
        width: 100% !important;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
      }
      .task-board-controls .task-select {
        height: 36px;
        padding: 6px 10px;
        font-size: 12.5px;
        width: 100%;
      }
      .task-action-btns {
        grid-column: 1 / -1;
        display: flex;
        gap: 6px;
      }
      .task-action-btns .btn-unified {
        flex: 1;
        justify-content: center;
        height: 36px;
        min-height: 36px;
        padding: 6px 10px;
        font-size: 12.5px;
      }

      /* Kanban Mobile: Stacked / Filtered Column (Zero 1600px horizontal scroll) */
      .task-kanban-layout {
        flex-direction: column !important;
        padding: 12px !important;
        gap: 14px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
      }
      .kanban-column {
        min-width: 100% !important;
        width: 100% !important;
        max-height: none !important;
        padding: 14px !important;
        box-sizing: border-box;
      }
      .kanban-column.mobile-hidden {
        display: none !important;
      }

      /* Syllabus Mobile: Responsive Task Cards (Zero 750px table scrollbar) */
      .syllabus-table-container {
        padding: 12px !important;
        overflow-y: auto;
      }
      .syllabus-table-wrapper {
        border: none !important;
        background: transparent !important;
        overflow-x: visible !important;
        width: 100% !important;
      }
      .syllabus-table {
        min-width: 100% !important;
        width: 100% !important;
        display: block;
      }
      .syllabus-table thead {
        display: none !important; /* Hide wide table header on mobile */
      }
      .syllabus-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
      }
      .syllabus-group-header-row {
        display: block;
        border-radius: var(--radius-card);
        margin-top: 8px;
        margin-bottom: 2px;
        border: 1.5px solid var(--c3);
        background: var(--c1) !important;
      }
      .syllabus-group-header-td {
        display: block;
        padding: 10px 14px;
        font-size: 13px;
        font-weight: 700;
        border: none !important;
      }
      .syllabus-row {
        display: flex;
        flex-direction: column;
        background: var(--c2);
        border: 1.5px solid var(--c3);
        border-radius: var(--radius-card);
        padding: 12px 14px;
        gap: 8px;
        transition: transform 0.1s ease;
      }
      .syllabus-row:active {
        transform: scale(0.99);
      }
      .syllabus-row td {
        display: block;
        padding: 0 !important;
        border: none !important;
        color: var(--c3);
      }
      .syllabus-row td:nth-child(1) { /* Sem / Block */
        font-size: 12px;
        color: var(--text-muted);
        font-weight: 600;
      }
      .syllabus-row td:nth-child(2) { /* Title */
        font-size: 15px;
        font-weight: 700;
        color: var(--text-main);
        max-width: 100% !important;
        line-height: 1.35;
      }
      .syllabus-row td:nth-child(3),
      .syllabus-row td:nth-child(4) { /* Badges */
        display: inline-block;
        margin-right: 6px;
      }
      .syllabus-row td:nth-child(5) { /* Assignee */
        font-size: 12.5px;
        color: var(--text-muted);
        margin-top: 4px;
      }
      .syllabus-row td:nth-child(6) { /* Action button */
        margin-top: 6px;
        display: flex;
      }
      .syllabus-row td:nth-child(6) button {
        width: 100%;
        justify-content: center;
        min-height: 32px;
        font-size: 12px;
      }

      /* ── View 5: API Keys Mobile Layout ── */
      .api-keys-container {
        padding: 14px !important;
      }
      .api-keys-card {
        padding: 16px !important;
        margin-bottom: 16px !important;
      }
      .api-keys-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }
      .api-keys-form-row > div {
        width: 100% !important;
        min-width: 0 !important;
      }
      .api-keys-form-row .btn-unified {
        width: 100%;
        justify-content: center;
      }

      #lightboxText { width: 95%; height: 95%; font-size: 12px; padding: 16px; }
      .navbar { padding: 0 16px; }
      .file-item { padding: 12px 16px; gap: 12px; }
      .file-icon { margin-right: 0; }
      .file-name { font-size: 13px; }
    }

    /* Toggle Switch */
    .switch-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--c3); font-weight: 600; user-select: none; }
    .switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
    .switch input { opacity: 0; width: 0; height: 0; position: absolute; }
    .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: transparent; border: 1.5px solid var(--c3); transition: background-color .25s ease, border-color .25s ease; border-radius: 20px; }
    .slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 2.5px; bottom: 2.5px; background-color: var(--c3); transition: transform .25s ease, background-color .25s ease; border-radius: 50%; }
    input:checked + .slider { background-color: var(--c3); border-color: var(--c3); }
    input:checked + .slider:before { transform: translateX(16px); background-color: var(--c1); }

    /* Utilities */
    .hidden { display: none !important; }@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } } @keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }


    .file-browser:not(.grid-mode) .file-checkbox { margin-right: 12px; }
    .search-input { width: 150px; font-size: 13px; }
    @media (max-width: 1024px) { .search-input { width: 100%; flex: 1; min-width: 0; } }
    .kanban-card {
      background: var(--c1);
      border: var(--border-main);
      border-radius: var(--radius-card);
      padding: 16px;
      margin-bottom: 12px;
      cursor: pointer;
      transition: border-color 0.15s, background 0.15s;
      box-shadow: none;
    }
    .kanban-card:hover {
      border-color: var(--c4);
      background: var(--c2);
      box-shadow: none;
    }
    .kanban-col {
      display: flex; flex-direction: column; max-height: 100%;
    }
    .task-list {
      overflow-y: auto; flex: 1;
    }

/* NEW STYLES EXTRACT */
/* --- NEW STYLES --- */

/* Sidebar and Org Component Styles */
.org-sidebar {
  width: 260px;
  background: var(--bg-main);
  border-right: var(--border-main);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.org-sidebar.collapsed {
  width: 64px;
}
.org-sidebar-header {
  padding: 14px 16px;
  height: 60px;
  box-sizing: border-box;
  border-bottom: var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
  gap: 12px;
}
.org-sidebar.collapsed .org-sidebar-header {
  padding: 14px 0;
  justify-content: center;
}
.org-sidebar-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  transition: opacity 0.2s, width 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-sidebar.collapsed .org-sidebar-title {
  display: none !important;
}
.org-sidebar-toggle-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1.5px solid var(--border-medium);
  background: var(--c1);
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.org-sidebar-toggle-btn:hover {
  background: var(--c3);
  color: var(--c1);
  border-color: var(--c3);
  transform: scale(1.05);
}
.org-sidebar-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.org-sidebar-inner-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.org-sidebar.collapsed .org-sidebar-inner-list {
  padding: 16px 0;
  gap: 12px;
  align-items: center;
  width: 100%;
}
.org-sidebar-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 12px 14px 4px 14px;
  text-transform: uppercase;
}
.org-sidebar.collapsed .org-sidebar-section-title {
  display: none !important;
}
.org-sidebar-wa-config {
  padding: 16px;
  border-top: var(--border-main);
  background: var(--bg-card);
  transition: opacity 0.2s, max-height 0.3s;
  max-height: 200px;
  overflow: hidden;
}
.org-sidebar.collapsed .org-sidebar-wa-config {
  display: none !important;
}
.btn-div-item {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  text-align: left;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  gap: 8px;
  min-width: 0;
}
.btn-div-item .div-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-div-item .div-count {
  flex-shrink: 0;
}
.btn-div-item:hover {
  background: color-mix(in srgb, var(--c3) 6%, transparent);
  border-color: var(--border-light);
}
.btn-div-item.active {
  background: var(--c3);
  color: var(--c1);
  border-color: var(--c3);
  box-shadow: none;
}
#btnDivFilterAll.btn-div-item.active {
  background: var(--c3);
  color: var(--c1);
  border-color: var(--c3);
  box-shadow: none;
}
.btn-div-item::after {
  content: "";
  display: none;
}
.org-sidebar.collapsed .btn-div-item {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  margin: 0 auto;
  border-radius: 50% !important;
  justify-content: center;
  align-items: center;
  border: none !important;
  background: transparent !important;
  display: flex !important;
  flex-shrink: 0;
}
.org-sidebar.collapsed .btn-div-item .div-name,
.org-sidebar.collapsed .btn-div-item .div-count {
  display: none !important;
}
.org-sidebar.collapsed .btn-div-item::after {
  content: attr(data-initials);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  background: var(--c2);
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.org-sidebar.collapsed .btn-div-item:hover::after {
  border-color: var(--c4);
  color: var(--c4);
  background: var(--c1);
  transform: scale(1.06);
}
.org-sidebar.collapsed .btn-div-item.active::after {
  border-color: var(--c3);
  background: var(--c3);
  color: var(--c1);
  box-shadow: 0 0 0 2px var(--bg-main), 0 0 0 4px var(--c3);
}
.org-sidebar.collapsed .org-sidebar-inner-list div {
  display: none !important;
}

/* Typography & Form Polish */
.form-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-main);
  display: block;
  margin-bottom: 6px;
}

.kanban-card {
  background: var(--c2) !important;
  border: var(--border-main) !important;
  padding: 18px !important;
  border-radius: var(--radius-card) !important;
  font-size: 14px !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: border-color 0.15s, background 0.15s !important;
  display: flex !important; flex-direction: column !important; gap: 10px !important;
}
.kanban-card:hover {
  border-color: var(--c4) !important;
  box-shadow: none !important;
}

.custom-modal-overlay.bottom-up {
  align-items: flex-end !important; padding: 0 !important;
}
.custom-modal-overlay.bottom-up .custom-modal {
  width: 100% !important; max-width: 600px !important; margin: 0 auto !important;
  border-radius: 24px 24px 0 0 !important; border-bottom: none !important;
  padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.kanban-col h3 {
  font-family: var(--font-sans);
}

body { margin: 0; overflow: hidden; }

/* Top Navigation Tabs */
.top-nav {
  display: flex;
  align-items: center;
  background: var(--c1);
  border-bottom: var(--border-main);
  padding: 0 24px;
  height: 60px;
  z-index: 100;
  position: relative;
}

.top-nav .brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-right: 32px;
}

.embedded-docs .top-nav .brand,
.embedded-mode .top-nav .brand,
body.embedded .top-nav .brand {
  display: none !important;
}

.embedded-docs .top-nav {
  padding: 0 16px;
  height: 52px;
}

.top-nav .brand img {
  height: 24px;
}

.top-nav .tabs {
  display: flex;
  gap: 8px;
  height: 100%;
  flex: 0 1 auto;
  justify-content: flex-start;
}

.top-nav .tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: color-mix(in srgb, var(--c3) 85%, transparent);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.top-nav .tab:hover {
  color: var(--c4);
  background: color-mix(in srgb, var(--c3) 8%, transparent);
}

.top-nav .tab.active {
  color: var(--c4);
  font-weight: 700;
  border-bottom: 2.5px solid var(--c4);
  background: color-mix(in srgb, var(--c3) 10%, transparent);
}

.docs-content-area {
  height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 0 24px;
}

.docs-container {
  max-width: 920px;
  width: 100%;
  margin: 36px auto 90px auto;
  position: relative;
  z-index: 10;
  display: none;
  flex-direction: column;
}

.docs-container.active {
  display: flex;
}

.docs-title {
  font-family: var(--font-sans);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 32px;
  text-align: center;
  letter-spacing: 0.05em;
}

.docs-section {
  background: var(--bg-card);
  border: var(--border-main);
  border-radius: var(--radius-card);
  padding: 28px 34px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.docs-section h2 {
  font-family: var(--font-sans);
  font-size: 20px;
  color: var(--text-main);
  border-bottom: var(--border-main);
  padding-bottom: 14px;
  margin-top: 0;
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-section h3 {
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--text-main);
  margin-top: 16px;
  margin-bottom: 4px;
}

.docs-section p, .docs-section ul, .docs-section ol {
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1.75;
  font-size: 15px;
  margin: 0;
}

.docs-section ul, .docs-section ol {
  padding-left: 24px;
}

.docs-section li {
  margin-bottom: 10px;
}

.docs-section strong {
  color: var(--c4);
  font-weight: 700;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: var(--border-main);
  background: var(--bg-card);
}

.docs-table th {
  background: var(--bg-inset);
  color: var(--c4);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 18px;
  border-bottom: var(--border-main);
  text-align: left;
}

.docs-table td {
  padding: 12px 18px;
  border-bottom: var(--border-light);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-main);
  vertical-align: middle;
}

.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-table code, .docs-section code {
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-inset);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--c4);
  border: 1px solid color-mix(in srgb, var(--c4) 25%, transparent);
}

.alert-box {
  background: color-mix(in srgb, var(--c3) 7%, transparent);
  border-left: 4px solid var(--c4);
  padding: 16px 20px;
  margin-top: 14px;
  margin-bottom: 14px;
  border-radius: 0 6px 6px 0;
  font-size: 14.5px;
  line-height: 1.65;
}

.btn-back-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: color-mix(in srgb, var(--c3) 60%, transparent);
  transition: all 0.2s;
}
.btn-back-home:hover {
  background: var(--border-light);
  color: var(--c3);
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--c1);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--c3) 60%, transparent);
}

/* Unified Typography */
body {
  font-family: var(--font-mono);
}
h1, h2, h3, h4, h5, h6, .modal-title, .docs-title, .docs-section h2, .section-title, #orgViewTitle, #contextTitle, #editorTitle {
  font-family: var(--font-sans) !important;
}

/* --- Worker Aesthetic Correction Utilities --- */
.auth-brand-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 48px;
}
.auth-brand-logo {
  height: 60px;
  opacity: 0.95;
  margin-bottom: 8px;
}
.auth-brand-title {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.08em;
  line-height: 1.1;
  font-family: var(--font-sans) !important;
}
.auth-brand-subtitle {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  opacity: 0.85;
  letter-spacing: 0.2em;
  margin-top: 4px;
  font-family: var(--font-sans) !important;
}
.auth-status-msg {
  font-size: 13px;
  color: var(--text-main);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.drop-overlay-icon {
  margin-bottom: 16px;
}
.drop-overlay-text {
  font-size: 18px;
  font-weight: 600;
}
.toolbar-header {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}
.dashboard-container {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 24px;
  overflow-y: auto;
  flex: 1;
}
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.analytics-card {
  background: var(--bg-card);
  border: var(--border-main);
  border-radius: var(--radius-card);
  padding: 24px 28px;
}
.analytics-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}
.analytics-value {
  font-size: 38px;
  font-weight: 700;
}
.cleanup-result {
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  min-height: 20px;
  color: var(--text-main);
}
.guest-cleanup-team-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-card);
  border: var(--border-main);
  border-radius: var(--radius-card);
}
.guest-cleanup-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}
.guest-cleanup-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.guest-cleanup-hours-input {
  width: 52px;
  height: 32px;
  padding: 4px 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-card);
}
.guest-cleanup-unit {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.guest-cleanup-team-card .guest-cleanup-btn {
  width: auto;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.guest-cleanup-team-card .cleanup-result {
  font-size: 11.5px;
  font-weight: 600;
  min-height: 16px;
  margin: 0;
  color: var(--text-main);
}
.dashboard-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
  flex: 1;
}
.card-column {
  background: var(--bg-card);
  border: var(--border-main);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}
.card-column-header {
  padding: 16px 24px;
  border-bottom: var(--border-main);
  font-weight: 700;
  font-size: 16px;
}
.card-column-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  list-style: none;
}
.placeholder-text {
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
}
.org-sidebar-wa-config-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.org-sidebar-wa-input {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  font-size: 14px;
  box-sizing: border-box;
}
.main-content-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  min-width: 0;
}
.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}
.toolbar-info-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toolbar-title {
  font-family: var(--font-primary);
  font-size: 24px;
  font-weight: 700;
  color: var(--c3);
  margin: 0;
  letter-spacing: 0.05em;
}
.toolbar-desc {
  font-family: var(--font-secondary);
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
}
.controls-row {
  padding: 12px 20px;
  border-bottom: var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--c1);
}
.switch-group {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.announcement-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  max-width: 460px;
  min-width: 260px;
}
.announcement-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  min-width: 0;
}
.user-filter-container {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: var(--border-main);
  background: var(--bg-card);
  flex-wrap: wrap;
}
.search-wrap-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
  flex: 1;
  max-width: 380px;
}
.search-icon-svg {
  position: absolute;
  left: 12px;
  color: var(--c3);
  opacity: 0.6;
  pointer-events: none;
}
.search-users-input {
  width: 100%;
  font-size: 13px;
  padding: 8px 14px 8px 36px;
  border-radius: var(--radius-pill);
  box-sizing: border-box;
}
.user-filter-pill-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.user-filter-btn {
  font-size: 12px;
  padding: 6px 14px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--c3);
  border: 1.5px solid var(--c3);
  cursor: pointer;
  transition: 0.15s;
}
.user-filter-btn:hover {
  background: color-mix(in srgb, var(--c3) 10%, transparent);
}
.user-filter-btn.active {
  background: var(--c3);
  color: var(--c1);
}
.user-stats-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-primary);
  font-size: 12px;
  color: var(--c3);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  background: var(--c1);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  white-space: nowrap;
}
.task-board-toolbar-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-bottom: 1.5px solid var(--c3);
}
.task-board-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.task-board-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.task-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.task-board-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}
.task-select {
  padding: 8px 12px;
  font-size: 13.5px;
  width: auto;
  border-radius: var(--radius-card);
}
.task-input-search {
  padding: 8px 12px;
  font-size: 13.5px;
  width: 150px;
  border-radius: var(--radius-card);
}
.task-btn-new {
  display: none;
}
.task-kanban-layout {
  display: flex;
  gap: 18px;
  padding: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}
.kanban-column {
  flex: 1;
  min-width: 310px;
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-card);
  border: var(--border-main);
  display: flex;
  flex-direction: column;
  max-height: 100%;
}
.kanban-column-title {
  margin-top: 0;
  border-bottom: var(--border-main);
  padding-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-sans);
}
.kanban-task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  overflow-y: auto;
  flex: 1;
}
/* Syllabus Table View (Clean Scroll & Anti-Overflow) */
.syllabus-table-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  background: var(--bg-main);
}

.syllabus-table-container.hidden {
  display: none !important;
}

.syllabus-table-wrapper {
  background: var(--c2);
  border-radius: 10px;
  border: 1.5px solid var(--c3);
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.syllabus-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
  min-width: 750px;
  table-layout: auto;
}

.syllabus-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
}

.syllabus-table-tr {
  background: var(--c1);
  border-bottom: 1.5px solid var(--c3);
  color: var(--c3);
  font-family: var(--font-primary);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.syllabus-table-th {
  padding: 12px 16px;
  font-size: 12px;
  white-space: nowrap;
}

.syllabus-group-header-row {
  background: var(--c1) !important;
}

.syllabus-group-header-td {
  padding: 8px 16px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 13px;
  color: var(--c4);
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--c3);
  border-top: 1.5px solid var(--c3);
}

.syllabus-row {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
  cursor: pointer;
}

.syllabus-row:hover {
  background: color-mix(in srgb, var(--c3) 6%, transparent);
}

.syllabus-row td {
  padding: 12px 16px;
  color: var(--c3);
  font-family: var(--font-secondary);
  vertical-align: middle;
}

.editor-pane-layout {
  width: 50%;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--c2);
}
.preview-pane-layout {
  width: 50%;
  display: flex;
  background: var(--c1);
  height: 100%;
}
.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.editor-helper-text {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.editor-action-btn {
  padding: 10px 20px;
}
.context-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.context-cancel-btn {
  justify-content: center;
  width: 100%;
}
.division-picker-overlay {
  /* z-index dynamically managed by ModalManager */
}
.division-picker-box {
  max-width: 480px;
}
.division-picker-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.division-picker-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.division-picker-btn {
  justify-content: center;
}
.bottom-dock-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}
.bottom-dock-brand-img {
  height: 24px;
  opacity: 1;
}
.bottom-dock-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bottom-dock-brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--text-main);
  font-family: var(--font-sans) !important;
}
.bottom-dock-brand-subtitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
}
.bottom-dock-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}
.user-badge-text {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1024px) {
  .user-badge-text {
    max-width: 150px;
  }
}
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-toast, 20000);
  pointer-events: none;
  max-width: min(420px, calc(100vw - 32px));
}
.docs-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.docs-brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--text-main);
  font-family: var(--font-sans) !important;
}
.docs-brand-subtitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
}
.docs-note-block {
  color: var(--text-main);
  font-weight: bold;
  background: color-mix(in srgb, var(--c3) 8%, transparent);
  padding: 12px 18px;
  border-radius: var(--radius-card);
  margin-top: 10px;
  font-size: 14.5px;
}
.toolbar-actions-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.btn-flex-layout {
  display: flex;
  align-items: center;
  gap: 8px;
}
.w-100 {
  width: 100%;
}
.badge-division {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--card-border-hover);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}
.api-keys-container {
  padding: 24px 32px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  flex: 1;
}
.api-keys-card {
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  width: 100%;
  box-sizing: border-box;
}
.api-keys-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.api-keys-form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  width: 100%;
}
.api-stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.api-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.api-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}
.api-stat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.connector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.connector-card:hover {
  border-color: var(--c4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.api-key-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 12px;
  background: var(--bg-card);
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.api-key-item-card:hover {
  border-color: var(--c4);
}

.api-key-badge-active {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, #10b981 15%, transparent);
  color: #10b981;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.api-key-badge-expired {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, #ef4444 15%, transparent);
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.api-keys-reveal-box {
  display: none;
  margin-bottom: 24px;
  padding: 24px;
  border: 2px solid var(--c4);
  border-radius: 12px;
  background: color-mix(in srgb, var(--c4) 7%, transparent);
  width: 100%;
  box-sizing: border-box;
}
.api-keys-step {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.wa-container-box {
  grid-column: 1 / -1;
  background: var(--bg-card);
  padding: 20px 24px;
  border: var(--border-main);
  border-radius: var(--radius-card);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: none;
  transition: border-color 0.15s;
}
.wa-container-box:hover {
  border-color: var(--c4);
}
.division-card-box {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: var(--border-main);
  border-radius: var(--radius-card);
  box-shadow: none;
  transition: border-color 0.15s;
}
.division-card-box:hover {
  border-color: var(--c4) !important;
  box-shadow: none;
}
.member-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 8px;
  padding: 10px 14px;
  background: var(--bg-main);
  border: var(--border-main);
  border-radius: var(--radius-card);
  transition: all 0.2s ease;
}
.member-item-row:hover {
  background: var(--c2) !important;
}
.member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c3);
  color: var(--c1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}
.member-info-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-remove-member {
  padding: 5px 10px;
  font-size: 12px;
  opacity: 0.85;
  transition: all 0.2s ease;
}
.btn-remove-member:hover {
  opacity: 1 !important;
}
.div-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.div-card-title {
  margin: 0;
  font-size: 19px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.3px;
  font-family: var(--font-sans) !important;
}
.div-card-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  background: var(--border-light);
  color: var(--accent);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.div-card-desc {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.55;
  min-height: 45px;
  margin-bottom: 20px;
}
.div-card-members-section {
  flex: 1;
  border-top: 1px dashed var(--border-medium);
  padding-top: 16px;
}
.div-card-members-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.div-card-no-members {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
  background: var(--bg-main);
  border-radius: var(--radius-card);
  border: 1.5px dashed var(--text-main);
}
.toast {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card) !important;
  border: var(--border-main) !important;
  padding: 14px 18px !important;
  border-radius: var(--radius-card) !important;
  color: var(--text-main) !important;
  font-family: var(--font-mono) !important;
  font-size: 13.5px !important;
  box-shadow: none !important;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  pointer-events: auto !important;
  min-width: 280px;
  max-width: 420px;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-out {
  animation: toastOut 0.3s ease forwards !important;
}
.toast-info {
  border-left: 3px solid var(--border-heavy) !important;
}
.toast-success {
  border-left: 3px solid var(--c4) !important;
}
.toast-error {
  border-left: 3px solid var(--danger) !important;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards, toastShake 0.4s ease-in-out !important;
}
.toast-warning {
  border-left: 3px solid var(--danger) !important;
}
.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.toast-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-icon {
  stroke-width: 2.5px;
}
.toast-icon-info {
  color: var(--text-muted);
}
.toast-icon-success {
  color: var(--c4);
}
.toast-icon-error, .toast-icon-warning {
  color: var(--danger);
}
.toast-message {
  font-family: var(--font-mono) !important;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}
.toast-close {
  background: none !important;
  border: none !important;
  color: var(--text-muted) !important;
  font-size: 16px !important;
  cursor: pointer;
  padding: 0 4px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  line-height: 1;
}
.toast-close:hover {
  color: var(--text-main) !important;
}
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear forwards;
}
.toast-info .toast-progress {
  background: var(--border-heavy);
}
.toast-success .toast-progress {
  background: var(--c4);
}
.toast-error .toast-progress, .toast-warning .toast-progress {
  background: var(--danger);
}
@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@keyframes toastShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.user-filter.active {
  background: var(--c3) !important;
  color: var(--c1) !important;
  border-color: var(--c3) !important;
  box-shadow: none !important;
}
.activity-log-item {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
  animation: fadeIn 0.3s ease;
  font-family: var(--font-mono) !important;
}
.log-time-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--c4);
}
.log-user {
  font-weight: 700;
  font-size: 14.5px;
}
.log-email {
  font-size: 14px;
}
.log-device {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.95;
  margin-top: 4px;
}
.log-online {
  font-weight: 700;
  color: var(--text-main);
}
.log-offline {
  font-weight: 600;
  color: var(--text-muted);
}
.syllabus-table-row {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
  cursor: pointer;
}
.syllabus-table-row:hover {
  background: var(--c2) !important;
}
.editor-block-container {
  background: var(--bg-main);
  padding: 18px;
  border-radius: var(--radius-card);
  border: var(--border-main);
}
.editor-block-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 10px;
}
.editor-block-textarea {
  width: 100%;
  height: 150px;
  background: var(--c2);
  color: var(--c3);
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 14px;
  border: var(--border-main);
  border-radius: var(--radius-card);
  resize: vertical;
}
.editor-block-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
.loading-spinner-wrapper {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}
.inline-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-medium);
  border-radius: 50%;
  border-top-color: var(--c4);
  animation: spin 1s ease-in-out infinite;
  margin-left: 8px;
  vertical-align: middle;
}
.leaderboard-item {
  display: flex;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}
.leaderboard-rank-user {
  display: flex;
  gap: 16px;
  align-items: center;
}
.leaderboard-medal {
  font-size: 16px;
  font-weight: 700;
  width: 36px;
}
.leaderboard-username {
  font-size: 14.5px;
  font-weight: 500;
}
.leaderboard-points {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--accent);
}


.font-bold {
  font-weight: bold;
}
.docs-tab-link {
  text-decoration: none;
  color: inherit;
}
#editorTitle {
  color: var(--accent);
}

.flex-column-24 {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.flex-1-min-300 {
  flex: 1;
  min-width: 300px;
}
.flex-2-min-400 {
  flex: 2;
  min-width: 400px;
}

.text-danger-style {
  color: var(--danger) !important;
}
.slider-danger-style {
  border-color: var(--danger) !important;
}
.slider-danger-style:before {
  background-color: var(--danger) !important;
}
input:checked + .slider-danger-style {
  background-color: var(--danger) !important;
  border-color: var(--danger) !important;
}
input:checked + .slider-danger-style:before {
  background-color: var(--c1) !important;
}

.divisions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  padding: 0 24px;
}
.contributions-layout {
  display: flex;
  padding: 24px;
  gap: 24px;
  flex-wrap: wrap;
  height: 100%;
}
.flex-column-16 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.member-item-row-status {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
}
.card-column-large {
  background: var(--bg-card);
  border: var(--border-main);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}
.review-container {
  padding: 24px;
  height: calc(100% - 60px);
  overflow-y: auto;
}
.review-search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.review-input-file {
  flex: 1;
}
.review-editor-area {
  display: none;
  flex-direction: column;
  gap: 16px;
}
.review-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-card);
  border: var(--border-main);
}



.docs-mobile-select {
  display: none;
}

/* ── Docs top-nav responsive (placed last so it overrides base rules) ──
   Replaces cramped tabs on mobile with a clean dropdown selector and
   ensures tables, code blocks, and headings fit mobile screen widths. */
@media (max-width: 1024px) {
  .top-nav {
    padding: 0 12px;
    gap: 10px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .top-nav .brand {
    margin-right: 0;
    gap: 8px;
    display: flex;
    align-items: center;
  }
  .top-nav .brand img {
    height: 22px;
  }
  .docs-brand-text {
    display: none !important;
  }
  .top-nav .tabs {
    display: none !important; /* Replaced by clean dropdown selector on mobile */
  }
  .docs-mobile-select {
    display: block !important;
    flex: 1;
    min-width: 0;
    max-width: 240px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: var(--radius-card);
    background: var(--c2);
    color: var(--c3);
    border: 1.5px solid var(--c3);
    font-family: var(--font-primary);
  }
  .docs-content-area {
    padding: 0 14px;
    overflow-x: hidden;
  }
  .docs-container {
    margin: 16px auto 60px auto;
  }
  .docs-title {
    font-size: 20px;
    margin-bottom: 16px;
  }
  .docs-section {
    padding: 16px;
    margin-bottom: 16px;
  }
  .docs-section h2 {
    font-size: 17px;
  }
  .docs-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-card);
  }
  .docs-table th, .docs-table td {
    padding: 10px 12px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  .alert-box {
    padding: 14px;
    font-size: 13.5px;
  }
}

/* ── Docs top-nav brand + back-button polish ──
   Overrides the conflicting .btn-back-home definitions (admin extract vs
   docs section) with one consistent, scoped treatment. */
.top-nav .brand { flex-direction: row; align-items: center; gap: 12px; }
.top-nav .brand img { height: 26px; }
.top-nav .btn-back-home {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border-heavy);
  background: transparent;
  color: var(--c3);
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.top-nav .btn-back-home svg { width: 18px; height: 18px; }
.top-nav .btn-back-home:hover {
  background: var(--c3);
  color: var(--c1);
  border-color: var(--c3);
  transform: translateX(-2px);
}
.docs-brand-title { line-height: 1.05; }
.docs-brand-subtitle { color: var(--text-muted); }

/* ─── API Keys View ──────────────────────────────────────── */
/* Uses existing: var(--bg-card), var(--bg-inset), var(--border-light),
   var(--text-main), var(--text-muted), var(--danger),
   .toolbar-header, .btn-unified, .auth-input, .form-label */

/* ══ SETTINGS OVERLAY & MODALS ══ */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay-base, 10000);
  background: color-mix(in srgb, var(--c3) 65%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.settings-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.settings-box {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--c3);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
  box-sizing: border-box;
}

.settings-overlay.active .settings-box {
  transform: translateY(0) scale(1);
}

.settings-header {
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--c3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--bg-card);
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-message-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 16px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.settings-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.settings-header .btn-text {
  opacity: 0.75;
  padding: 6px 10px;
  border-radius: var(--radius-card);
  transition: opacity 0.2s, background 0.2s;
}
.settings-header .btn-text:hover {
  opacity: 1;
  background: var(--border-light);
}
.settings-header .btn-text svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.modal-actions-end {
  justify-content: flex-end;
}

.settings-box-limit {
  max-width: 600px;
}

.settings-body-flex {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.settings-row {
  display: flex;
  gap: 16px;
  width: 100%;
}
.settings-row-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.settings-input-full {
  width: 100%;
  box-sizing: border-box;
  text-overflow: ellipsis;
}
select.settings-input-full {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.settings-textarea {
  width: 100%;
  height: 90px;
  min-height: 80px;
  max-height: 200px;
  box-sizing: border-box;
  resize: vertical;
  border-radius: var(--radius-card);
  font-family: inherit;
  line-height: 1.4;
}
@media (max-width: 540px) {
  .settings-row {
    flex-direction: column;
    gap: 14px;
  }
}

.prompt-box-limit {
  max-width: 440px;
}

.prompt-input-full {
  width: 100%;
  box-sizing: border-box;
}

.editor-modal-container {
  max-width: 96vw !important;
  width: 96vw !important;
  height: 92vh !important;
  max-height: 92vh !important;
}

@media (max-width: 540px) {
  .settings-overlay {
    padding: 8px;
  }
  .settings-box {
    max-height: 94vh;
    border-radius: 10px;
  }
  .settings-header {
    padding: 12px 16px;
  }
  .settings-body {
    padding: 16px;
  }
  .modal-actions {
    flex-direction: column-reverse;
  }
  .modal-actions .btn-unified,
  .modal-actions .btn-card {
    width: 100%;
    justify-content: center;
  }
}

/* Context Actions List Modal */
.context-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.context-actions-list .btn-unified {
  width: 100%;
  justify-content: flex-start;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-card);
}
.context-actions-list .btn-unified svg {
  flex-shrink: 0;
}
.context-cancel-btn {
  width: 100%;
  margin-top: 12px;
  justify-content: center;
  border-radius: var(--radius-card);
}

/* Sidebar WhatsApp Input & Save Button */
.org-sidebar-wa-config {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.org-sidebar-wa-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.org-sidebar-wa-input-wrapper .prompt-input-full {
  flex: 1;
  min-width: 0;
}
.btn-save-wa {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Broadcast Button & Announcement Group */
.announcement-group {
  display: flex;
  gap: 10px;
  align-items: center;
}
.announcement-input {
  width: 280px;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: var(--radius-pill);
}
.btn-broadcast {
  flex-shrink: 0;
  white-space: nowrap;
}

/* User Filter Buttons Styling */
.user-filter {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.user-filter:hover:not(.active) {
  background: color-mix(in srgb, var(--c3) 8%, transparent);
  border-color: var(--border-medium);
}

/* ==========================================================================
   COUPLE PACKAGE & DOCK PROFILE STYLING (SYMMETRICAL, NO EMOJI)
   ========================================================================== */

.user-profile-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm, 4px);
  padding: 6px 12px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 13px;
}
.user-profile-dock-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.badge-couple {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: none !important;
  padding: 2px 7px !important;
  border-radius: 3px !important;
  font-size: 10px !important;
  letter-spacing: 0.5px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  line-height: 1 !important;
  box-shadow: 0 1px 3px rgba(236, 72, 153, 0.25);
}

.dash-couple-card {
  margin-top: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg-surface, var(--c1));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md, 8px);
  animation: fadeIn 0.3s ease;
}

.dash-couple-grid {
  display: grid;
  grid-template-columns: 1fr 140px 1fr;
  align-items: stretch;
  gap: 16px;
}

.dash-couple-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-elevated, var(--c1));
  border: 1px solid var(--border-light);
  border-radius: 6px;
  min-width: 0;
  transition: border-color 0.2s ease;
}

.dash-couple-box.left {
  justify-content: flex-start;
  text-align: left;
}

.dash-couple-box.right {
  justify-content: flex-end;
  text-align: right;
}

.dash-couple-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 6px;
}

.couple-modal-partners-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.couple-partner-card {
  padding: 14px;
  background: var(--bg-elevated, var(--c1));
  border: 1px solid var(--border-light);
  border-radius: 6px;
  min-width: 0;
}

.couple-link-glyph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

@media (max-width: 768px) {
  .dash-couple-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dash-couple-box.right {
    justify-content: flex-start !important;
    text-align: left !important;
    flex-direction: row-reverse;
  }
  .dash-couple-core {
    order: -1;
    padding: 10px;
  }
  .couple-modal-partners-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .couple-link-glyph {
    transform: rotate(90deg);
    margin: 4px 0;
  }
}

/* Couple Management Modal Tabs */
.couple-tab-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.couple-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--border-medium);
}
.couple-tab-btn.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}
.couple-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}
.couple-panel.active {
  display: block;
}

/* ══ REPO MOUNT BAR & TAGS ══ */
.repo-mount-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--c2);
  border-bottom: 1.5px solid var(--border-light);
  gap: 12px;
  flex-wrap: wrap;
}
.mount-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mount-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.mount-label {
  font-family: var(--font-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--c3);
  text-transform: uppercase;
}
.mount-select {
  background: var(--c1);
  color: var(--c3);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-card, 6px);
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}
.mount-select:hover, .mount-select:focus {
  border-color: var(--accent);
}
.mount-status-tag {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.04em;
}
.mount-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.repo-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.repo-tag.content-repo {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.repo-tag.main-repo {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.repo-tag.synced {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* ══════════════════════════════════════════════
   KLIPY GIF EXPLORER & ADS CARDS
══════════════════════════════════════════════ */
.klipy-chip {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-card, #1c1c1c);
  border: 1px solid var(--border-light, #333);
  color: var(--text-muted, #aaa);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.klipy-chip.active, .klipy-chip:hover {
  background: var(--accent, #3b82f6);
  color: #ffffff;
  border-color: var(--accent, #3b82f6);
}
.klipy-card {
  position: relative;
  background: var(--bg-card, #141414);
  border: 1px solid var(--border-light, #262626);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.klipy-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.klipy-card.is-ad {
  border: 1.5px solid rgba(234, 179, 8, 0.5);
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.08) 0%, rgba(20,20,20,0.95) 100%);
}
.klipy-ad-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #eab308;
  color: #000;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  z-index: 2;
}
.klipy-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #000;
}
.klipy-card-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card, #141414);
}
.klipy-card-title {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main, #eee);
}
.klipy-card-actions {
  display: flex;
  gap: 4px;
}
.klipy-card-btn {
  flex: 1;
  font-size: 10px;
  padding: 5px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid var(--border-light, #333);
  background: var(--bg-main, #1e1e1e);
  color: var(--text-main, #ccc);
  cursor: pointer;
  transition: all 0.15s ease;
}
.klipy-card-btn:hover {
  background: var(--accent, #3b82f6);
  color: #fff;
  border-color: var(--accent, #3b82f6);
}
.klipy-card-btn.ad-cta {
  background: #eab308;
  color: #000;
  font-weight: 700;
  border-color: #eab308;
}
.klipy-card-btn.ad-cta:hover {
  background: #facc15;
}




/* Modal Fallbacks & Activity Logs Styling */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay-base, 10000);
  background: color-mix(in srgb, var(--c3) 65%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.custom-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}
.custom-modal-overlay.hidden {
  display: none !important;
}

.log-chip {
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  border-radius: 4px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
.log-chip:hover {
  border-color: var(--c3) !important;
  color: var(--text-main) !important;
}
.log-chip.active {
  background: var(--c3) !important;
  color: var(--c1) !important;
  border-color: var(--c3) !important;
}
