/* EdHelfy — Buttons, cards, inputs, badges, modals, tables, and UI components */

  /* ═══ BUTTONS ═══ */
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: var(--font-body);
    white-space: nowrap; transition: all 0.15s;
  }
  .btn:hover { border-color: var(--border2); background: var(--surface-hover); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.04); }
  .btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }

  .btn-accent {
    background: var(--accent); color: #fff;
    border-color: var(--accent);
  }
  .btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 4px 12px rgba(30,86,160,0.25); }

  .btn-ghost {
    background: transparent; border-color: transparent;
    color: var(--text2); padding: 8px;
  }
  .btn-ghost:hover { background: var(--bg2); color: var(--text); }

  .btn-sm { padding: 6px 10px; font-size: 12px; }
  .btn-danger { color: var(--red); }
  .btn-danger:hover { background: var(--red-bg); border-color: transparent; }

  .btn-google {
    background: #fff; border: 1.5px solid #dadce0; color: #1f1f1f;
    font-weight: 500; gap: 8px;
  }
  .btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

  .icon-btn {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--surface);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text2); transition: all 0.15s;
  }
  .icon-btn:hover { border-color: var(--border2); color: var(--text); }

  /* ═══ INPUTS ═══ */
  .input-group {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1.5px solid var(--border);
    transition: border 0.15s;
  }
  .input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,86,160,0.1); }
  .input-group input {
    border: none; outline: none; font-size: 13px;
    font-family: var(--font-body); background: transparent;
    color: var(--text); width: 180px;
  }
  .input-group svg { color: var(--text3); flex-shrink: 0; }

  .form-field { display: flex; flex-direction: column; gap: 5px; }
  .form-label {
    font-size: 12px; font-weight: 600; color: var(--text2);
    letter-spacing: 0.02em;
  }
  .form-input {
    padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); font-size: 14px;
    font-family: var(--font-body); outline: none; color: var(--text);
    background: var(--surface); width: 100%; transition: border 0.15s;
  }
  .form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,86,160,0.1); }
  select.form-input { cursor: pointer; }

  /* ═══ CARDS ═══ */
  .card {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
  }
  .card-pad { padding: 20px; }
  @media (hover:hover) { .card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); } }

  /* ═══ TABLE ═══ */
  .table-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; }
  th {
    text-align: left; padding: 12px 16px;
    font-size: 11px; font-weight: 700; color: var(--text3);
    text-transform: uppercase; letter-spacing: 0.06em;
    border-bottom: 2px solid var(--border);
    background: var(--bg);
    position: sticky; top: 0;
  }
  td {
    padding: 12px 16px; font-size: 13px;
    border-bottom: 1px solid var(--border);
  }
  tr:hover td { background: var(--surface-hover); }
  tbody tr:nth-child(even) td { background: rgba(0,0,0,0.012); }
  td.editable { cursor: pointer; position: relative; }
  td.editable:hover { background: var(--accent-light); }
  td.editable input {
    border: none; outline: none; background: transparent;
    font: inherit; color: inherit; width: 100%; padding: 0;
  }

  /* ═══ BADGES ═══ */
  .badge {
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600; display: inline-block;
    letter-spacing: 0.01em;
  }
  .badge-paid { background: var(--green-bg); color: var(--green-text); }
  .badge-partial { background: var(--yellow-bg); color: var(--yellow-text); }
  .badge-pending { background: var(--red-bg); color: var(--red-text); }
  .badge-pending { animation: subtlePulse 2s ease-in-out infinite; }
  .badge-cat { background: var(--accent-light); color: var(--accent); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

  /* ═══ DASHBOARD PANELS (collapsible + overlay) ═══ */
  .dash-panel-open .dash-panel-body { display: flex !important; }
  .dash-panel-open .dash-panel-icon { transform: rotate(45deg); }
  .dash-panel-open { position: relative; z-index: 20; box-shadow: var(--shadow-lg) !important; }

  /* ═══ STATS ═══ */
  .stats-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 24px;
  }
  .stat-card { padding: 18px 20px; position: relative; overflow: hidden; }
  .stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0;
    width: 4px; background: var(--accent); border-radius: 0 4px 4px 0;
  }
  .stat-card[data-color="green"]::before { background: var(--green); }
  .stat-card[data-color="red"]::before { background: var(--red); }
  .stat-card[data-color="yellow"]::before { background: var(--yellow); }
  .stat-card[data-color="blue"]::before { background: var(--accent); }
  .stat-eyebrow { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
  .stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
  .stat-delta { font-size: 12px; margin-top: 2px; }
  .stat-delta.up { color: var(--green); }
  .stat-delta.down { color: var(--red); }

  /* ═══ SECTIONS ═══ */
  .section { display: none; animation: fadeUp 0.3s ease; position: relative; }
  .section.active { display: block; }
  .stats-row .card:nth-child(1) { animation: fadeUpStagger 0.4s ease both; animation-delay: 0.05s; }
  .stats-row .card:nth-child(2) { animation: fadeUpStagger 0.4s ease both; animation-delay: 0.1s; }
  .stats-row .card:nth-child(3) { animation: fadeUpStagger 0.4s ease both; animation-delay: 0.15s; }
  .stats-row .card:nth-child(4) { animation: fadeUpStagger 0.4s ease both; animation-delay: 0.2s; }

  .section-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
  }
  .section-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

  /* ═══ MODAL ═══ */
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 900; padding: 20px;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .modal-overlay.open { opacity: 1; pointer-events: all; }
  .modal {
    background: var(--surface); border-radius: 16px;
    width: 100%; max-width: 520px; max-height: 88vh;
    overflow: auto; box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
  }
  .modal-overlay.open .modal { transform: scale(1) translateY(0); }
  .modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--surface); z-index: 1;
  }
  .modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
  .modal-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
  .modal-footer {
    padding: 16px 24px; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
    position: sticky; bottom: 0; background: var(--surface);
  }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

  /* ═══ THEME TRANSITIONS ═══ */
  body, .sidebar, .main, .topbar, .card, .modal, .notif-panel, .fab-menu {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
  }

  /* ═══ SCAN ZONE ═══ */
  .scan-zone {
    border: 2px dashed var(--border2); border-radius: var(--radius);
    padding: 32px; text-align: center; cursor: pointer;
    transition: all 0.2s; background: var(--bg);
  }
  .scan-zone:hover { border-color: var(--accent); background: var(--accent-light); }
  .scan-zone.dragover { border-color: var(--accent); background: var(--accent-light); transform: scale(1.01); }
  .scan-icon { color: var(--text3); margin-bottom: 10px; }
  .scan-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
  .scan-sub { font-size: 12px; color: var(--text3); }
  .scan-preview { max-width: 100%; max-height: 200px; border-radius: var(--radius-sm); margin-top: 12px; object-fit: contain; }
  .scan-result {
    background: var(--bg); border-radius: var(--radius-sm); padding: 14px;
    margin-top: 12px; font-size: 13px; text-align: left;
    max-height: 200px; overflow: auto; white-space: pre-wrap;
    border: 1px solid var(--border); font-family: 'Inter', monospace;
  }
  .scan-progress {
    width: 100%; height: 4px; border-radius: 2px; background: var(--border);
    overflow: hidden; margin-top: 12px;
  }
  .scan-progress-fill {
    height: 100%; background: var(--accent); border-radius: 2px;
    transition: width 0.3s;
  }

  /* ═══ GOOGLE SHEETS PANEL ═══ */
  .sheets-panel {
    background: var(--bg); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 20px;
    margin-bottom: 20px;
  }
  .sheets-panel-title {
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; font-size: 14px; margin-bottom: 12px;
  }
  .sheets-url-input {
    display: flex; gap: 8px; align-items: center;
  }
  .sheets-url-input input { flex: 1; }
  .sheets-status {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; margin-top: 8px;
  }
  .sheets-dot { width: 8px; height: 8px; border-radius: 50%; }
  .sheets-dot.connected { background: #22c55e; }
  .sheets-dot.disconnected { background: var(--text3); }

  /* ═══ INVENTORY GRID ═══ */
  .inv-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
  }
  .inv-card { padding: 18px; }
  .inv-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
  .inv-name { font-weight: 600; font-size: 15px; }
  .inv-price { font-size: 12px; color: var(--text2); margin-top: 2px; }
  .progress { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin: 10px 0 4px; }
  .progress-bar { height: 100%; border-radius: 3px; transition: width 0.4s; }
  .progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); }

  /* ═══ ROUTINE ═══ */
  .routine-card { padding: 18px; margin-bottom: 12px; }
  .routine-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .routine-tag { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
  .routine-day { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-light); padding: 3px 10px; border-radius: 20px; }
  .periods { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .period { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
  .period.break { background: var(--yellow-bg); border-color: transparent; }
  .period-time { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; }
  .period-subj { font-size: 13px; font-weight: 600; margin-top: 2px; }

  /* ═══ ACADEMIC ═══ */
  .acad-card { padding: 18px; margin-bottom: 12px; }
  .acad-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .acad-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
  .acad-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
  .acad-grade { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1; }
  .subjects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .subj-card { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
  .subj-name { font-size: 11px; font-weight: 600; color: var(--text3); }
  .subj-marks { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-top: 2px; }
  .subj-marks span { font-size: 12px; color: var(--text3); font-family: var(--font-body); }
  .mini-bar { height: 3px; border-radius: 2px; background: var(--border); margin-top: 6px; overflow: hidden; }
  .mini-bar-fill { height: 100%; border-radius: 2px; }

  /* ═══ EMPTY ═══ */
  .empty-state { text-align: center; padding: 48px 20px; color: var(--text3); }
  .empty-state svg { margin-bottom: 12px; }
  .empty-state p { font-size: 14px; }

  /* ═══ TABS ═══ */
  .tab-bar { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
  .tab-btn {
    padding: 10px 18px; border: none; background: transparent;
    font: 13px/1 var(--font-body); font-weight: 600; color: var(--text3);
    cursor: pointer; border-bottom: 2px solid transparent;
    transition: all 0.15s; position: relative; top: 1px;
  }
  .tab-btn:hover { color: var(--text); }
  .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

  /* ═══ CHECKBOX ═══ */
  .checkbox { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

  /* ═══ AI CHAT ═══ */
  .ai-container { display:flex; flex-direction:column; height:calc(100vh - 148px); max-height:700px; }
  .ai-prompts { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
  .ai-prompt-btn {
    padding:8px 14px; border-radius:20px; font-size:12px; font-weight:500;
    border:1.5px solid var(--border); background:var(--surface); cursor:pointer;
    font-family:var(--font-body); color:var(--text2); transition:all 0.15s;
  }
  .ai-prompt-btn:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-light); }
  .ai-messages {
    overflow-y:auto; display:flex; flex-direction:column; gap:12px;
    padding:8px 0; min-height:0;
  }
  .ai-msg {
    max-width:88%; padding:12px 16px; border-radius:14px; font-size:13px; line-height:1.6;
    animation:fadeUp 0.3s ease; word-wrap:break-word;
  }
  .ai-msg.user { align-self:flex-end; background:var(--accent); color:#fff; border-bottom-right-radius:4px; }
  .ai-msg.ai { align-self:flex-start; background:var(--surface); border:1px solid var(--border); border-bottom-left-radius:4px; }
  .ai-msg.ai strong { color:var(--accent); }
  .ai-msg.loading { color:var(--text3); font-style:italic; }
  .ai-msg pre { background:var(--bg); padding:8px 10px; border-radius:6px; overflow-x:auto; font-size:12px; margin:6px 0; font-family:monospace; }
  .ai-msg ul,.ai-msg ol { padding-left:18px; margin:6px 0; }
  .ai-msg li { margin:3px 0; }
  .ai-input-bar {
    display:flex; gap:8px; padding-top:12px; border-top:1px solid var(--border);
  }
  .ai-input-bar input {
    flex:1; padding:12px 16px; border-radius:var(--radius); border:1.5px solid var(--border);
    font-size:14px; font-family:var(--font-body); outline:none; background:var(--surface); color:var(--text);
  }
  .ai-input-bar input:focus { border-color:var(--accent); }
  .ai-input-bar button {
    padding:12px 20px; border-radius:var(--radius); background:var(--accent); color:#fff;
    border:none; font-weight:600; cursor:pointer; font-family:var(--font-body); font-size:14px;
    transition:background 0.15s;
  }
  .ai-input-bar button:hover { background:var(--accent-hover); }
  .ai-input-bar button:disabled { opacity:0.5; cursor:not-allowed; }

  /* ═══ STUDENT PROFILE ═══ */
  .profile-header {
    display:flex; align-items:center; gap:18px; padding:20px; background:var(--bg);
    border-radius:var(--radius); margin-bottom:16px;
  }
  .profile-avatar {
    width:64px; height:64px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--yellow));
    display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:800;
    color:#fff; font-family:var(--font-display); flex-shrink:0;
  }
  .stud-toolbar { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
  .stud-toolbar-row { display:flex; gap:6px; align-items:center; }
  .stud-toolbar-more { display:flex; gap:6px; flex-wrap:wrap; padding:10px; background:var(--bg); border-radius:var(--radius-sm); border:1px solid var(--border); }
  .stud-row-actions { display:flex; justify-content:space-between; align-items:center; }
  .stud-row-filters { display:flex; gap:8px; align-items:center; flex-wrap:wrap; padding:10px 14px; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm); }
  .mb-only { display:none !important; }

  .profile-tabs { display:flex; gap:0; border-bottom:2px solid var(--border); margin-bottom:16px; }
  .profile-tab {
    padding:10px 18px; border:none; background:none; font:13px/1 var(--font-body); font-weight:600;
    color:var(--text3); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; transition:0.15s;
  }
  .profile-tab:hover { color:var(--text); }
  .profile-tab.active { color:var(--accent); border-bottom-color:var(--accent); }

  /* ═══ ATTENDANCE ═══ */
  .att-grid { display:grid; grid-template-columns:200px repeat(auto-fill, 36px); gap:2px; align-items:center; }
  .att-cell {
    width:36px; height:36px; border-radius:var(--radius-xs); display:flex; align-items:center;
    justify-content:center; font-size:12px; font-weight:700; cursor:pointer; border:1.5px solid var(--border);
    transition:all 0.1s; user-select:none;
  }
  .att-cell.present { background:#dcfce7; color:#15803d; border-color:#86efac; }
  .att-cell.absent { background:#fee2e2; color:#b91c1c; border-color:#fca5a5; }
  .att-cell.late { background:#fef9c3; color:#a16207; border-color:#fde68a; }
  .att-cell:hover { transform:scale(1.1); box-shadow:var(--shadow); }
  .att-name { font-size:13px; font-weight:600; padding:6px 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

  /* ═══ CHARTS ═══ */
  .chart-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
  .chart-card { padding:18px; }
  .chart-title { font-family:var(--font-display); font-size:15px; font-weight:700; margin-bottom:14px; }
  .bar-chart { display:flex; flex-direction:column; gap:8px; }
  .bar-row { display:flex; align-items:center; gap:10px; }
  .bar-label { font-size:12px; font-weight:600; width:90px; text-align:right; flex-shrink:0; }
  .bar-track { flex:1; height:22px; background:var(--bg); border-radius:4px; overflow:hidden; position:relative; }
  .bar-fill { height:100%; border-radius:4px; transition:width 0.6s ease; display:flex; align-items:center; padding:0 8px; font-size:10px; font-weight:700; color:#fff; }
  .mini-pie { width:120px; height:120px; border-radius:50%; position:relative; margin:0 auto; }

  /* ═══ NOTIFICATIONS ═══ */
  .notif-btn { position:relative; }
  .notif-dot {
    position:absolute;top:2px;right:2px;width:8px;height:8px;border-radius:50%;
    background:var(--red);border:2px solid var(--surface);
  }
  .notif-panel {
    position:absolute;top:100%;right:0;width:340px;max-height:420px;overflow-y:auto;
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
    box-shadow:var(--shadow-lg);z-index:300;display:none;margin-top:6px;
  }
  .notif-panel.open { display:block; }
  .notif-item { padding:12px 16px;border-bottom:1px solid var(--border);font-size:13px;display:flex;gap:10px;align-items:flex-start; }
  .notif-item:last-child { border:none; }
  .notif-icon { width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:16px; }
  .notif-icon.red { background:var(--red-bg);color:var(--red); }
  .notif-icon.yellow { background:var(--yellow-bg);color:var(--yellow); }
  .notif-icon.blue { background:var(--blue-bg);color:var(--blue); }

  /* ═══ BULK SELECT ═══ */
  .bulk-bar {
    display:none;padding:10px 16px;background:var(--accent-light);border:1.5px solid var(--accent);
    border-radius:var(--radius);margin-bottom:12px;align-items:center;gap:10px;
  }
  .bulk-bar.show { display:flex; }
  .cb { width:16px;height:16px;accent-color:var(--accent);cursor:pointer; }

  /* ═══ RECEIPT / REPORT CARD ═══ */
  .receipt-frame {
    background:var(--surface);border:2px solid var(--border);border-radius:var(--radius);padding:28px;
    max-width:600px;margin:0 auto;
  }
  .receipt-frame h2 { font-family:var(--font-display);text-align:center;margin-bottom:2px; }
  .receipt-frame table { width:100%;border-collapse:collapse;margin:14px 0; }
  .receipt-frame td,.receipt-frame th { padding:8px 10px;border:1px solid var(--border);font-size:13px; }
  .receipt-frame th { background:var(--bg);font-weight:600; }

  /* ═══ SPINNER ═══ */
  .spinner { width:16px;height:16px;border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin 0.6s linear infinite; }

  /* ═══ CALENDAR ═══ */
  .cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
  .cal-head { font-size:11px; font-weight:700; text-align:center; padding:6px; color:var(--text3); }
  .cal-day {
    min-height:56px; padding:4px 6px; border:1px solid var(--border); border-radius:var(--radius-xs);
    font-size:12px; cursor:pointer; transition:0.15s; position:relative; background:var(--surface);
  }
  .cal-day:hover { border-color:var(--accent); }
  .cal-day.today { border-color:var(--accent); background:var(--accent-light); }
  .cal-day.empty { background:transparent; border:none; cursor:default; }
  .cal-event {
    font-size:9px; padding:1px 4px; border-radius:3px; margin-top:2px; white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis; font-weight:600;
  }
  .cal-event.holiday { background:#fee2e2; color:#b91c1c; }
  .cal-event.exam { background:#dbeafe; color:#1d4ed8; }
  .cal-event.event { background:#dcfce7; color:#15803d; }
  .cal-event.meeting { background:#fef9c3; color:#a16207; }

  /* ═══ ROLE BADGES ═══ */
  .role-badge { font-size:10px; padding:2px 8px; border-radius:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; }
  .role-admin { background:var(--accent-light); color:var(--accent); }
  .role-teacher { background:var(--blue-bg); color:var(--blue); }
  .role-accountant { background:var(--green-bg); color:var(--green); }
  .role-parent { background:var(--yellow-bg); color:var(--yellow); }

  /* ═══ ADMISSION ═══ */
  .admission-step { display:flex; align-items:center; gap:10px; padding:12px; border-bottom:1px solid var(--border); }
  .step-num { width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;flex-shrink:0; }
  .step-num.done { background:var(--green); color:#fff; }
  .step-num.active { background:var(--accent); color:#fff; }
  .step-num.pending { background:var(--bg); color:var(--text3); border:2px solid var(--border); }

  /* ═══ RESPONSIVE FIX ═══ */
  .content { overflow-x:hidden; }
  .table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .table-wrap table { min-width:600px; }

  /* ═══ OFFLINE BANNER ═══ */
  .offline-bar { display:none;position:fixed;top:0;left:0;right:0;z-index:9999;background:#f59e0b;color:#000;text-align:center;padding:6px;font-size:12px;font-weight:600; }
  .offline-bar.show { display:block; }

  /* ═══ FIRST LAUNCH ═══ */
  .welcome-overlay { position:fixed;inset:0;background:var(--bg);z-index:9998;display:flex;align-items:center;justify-content:center; }
  .welcome-box { background:var(--surface);padding:40px;border-radius:16px;box-shadow:var(--shadow-lg);width:400px;max-width:90vw;text-align:center; }
  .welcome-box h1 { font-family:var(--font-display);font-size:26px;margin-bottom:6px; }

  /* ═══ UNDO TOAST ═══ */
  .toast.undo { background:var(--text);color:#fff;display:flex;align-items:center;gap:10px; }
  .toast.undo button { background:var(--accent);color:#fff;border:none;padding:4px 12px;border-radius:var(--radius-xs);font-weight:700;cursor:pointer;font-size:12px; }

  /* ═══ MOBILE CARD VIEW ═══ */
  .m-card-list { display:none; }
  .m-card-item { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:14px;margin-bottom:8px; }
  .m-card-row { display:flex;justify-content:space-between;align-items:center;padding:3px 0;font-size:13px; }
  .m-card-label { color:var(--text3);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.3px; }
  .m-card-actions { display:flex;gap:8px;margin-top:8px;padding-top:8px;border-top:1px solid var(--border); }

  /* ═══ BETTER TOUCH TARGETS ═══ */
  .touch-btn { min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:var(--radius-xs);border:none;background:none;cursor:pointer;color:var(--text2);transition:0.15s; }
  .touch-btn:hover { background:var(--bg); }
  .touch-btn.danger { color:var(--red); }
  .touch-btn.danger:hover { background:var(--red-bg); }
  .touch-btn.green { color:var(--green); }
  .touch-btn.green:hover { background:var(--green-bg); }

  /* ═══ TIMETABLE ═══ */
  .tt-table { width:100%;border-collapse:separate;border-spacing:0;font-size:12px; }
  .tt-table th { background:var(--accent);color:#fff;padding:8px 6px;font-weight:600;text-align:center;font-size:11px;position:sticky;top:0; }
  .tt-table th:first-child { background:var(--surface);color:var(--text);text-align:left;min-width:90px; }
  .tt-table td { padding:0;border:1px solid var(--border);vertical-align:top;min-width:100px;height:56px; }
  .tt-table td:first-child { background:var(--bg);padding:6px 8px;font-weight:600;font-size:11px;color:var(--text2);min-width:90px; }
  .tt-cell { padding:6px;height:100%;cursor:pointer;transition:0.15s;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;min-height:48px; }
  .tt-cell:hover { background:var(--accent-light); }
  .tt-cell.filled { background:var(--surface); }
  .tt-cell .tt-subj { font-weight:700;font-size:12px;color:var(--text);line-height:1.2; }
  .tt-cell .tt-teacher { font-size:10px;color:var(--text3);margin-top:2px; }
  .tt-cell.break { background:var(--yellow-bg);cursor:default; }
  .tt-cell.break .tt-subj { color:var(--yellow);font-style:italic; }
  .tt-cell.prayer { background:#ede9fe;cursor:default; }
  .tt-cell.prayer .tt-subj { color:#7c3aed;font-style:italic; }
  .tt-add-btn { width:24px;height:24px;border-radius:50%;border:1.5px dashed var(--accent);background:transparent;color:var(--accent);font-size:16px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:0.15s;line-height:1; }
  .tt-add-btn:hover { background:var(--accent);color:#fff;border-style:solid; }
  .tt-rm-btn { width:18px;height:18px;border-radius:50%;border:1px solid var(--border);background:transparent;color:var(--text3);font-size:14px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:0.15s;line-height:1;opacity:0.4;vertical-align:middle;margin-left:2px; }
  .tt-rm-btn:hover { background:var(--red);color:#fff;border-color:var(--red);opacity:1; }
  .tt-table th .tt-rm-btn { color:rgba(255,255,255,0.5);border-color:rgba(255,255,255,0.3); }
  .tt-table th .tt-rm-btn:hover { background:rgba(255,255,255,0.2);color:#fff;border-color:rgba(255,255,255,0.6); }

  /* ═══ TIME PICKER POPOVER ═══ */
  .tp-wrap { position:relative;display:inline-block; }
  .tp-display { display:flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;font-size:13px;font-weight:600;color:var(--text);min-width:110px;transition:border-color 0.2s; }
  .tp-display:hover { border-color:var(--accent); }
  .tp-display.active { border-color:var(--accent);box-shadow:0 0 0 3px rgba(30,86,160,0.1); }
  .tp-popover { display:none;position:absolute;top:100%;left:0;z-index:100;margin-top:4px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:8px;min-width:200px; }
  .tp-popover.open { display:flex;gap:4px; }
  .tp-col { display:flex;flex-direction:column;height:180px;overflow-y:auto;flex:1;scrollbar-width:thin; }
  .tp-col::-webkit-scrollbar { width:4px; }
  .tp-col::-webkit-scrollbar-thumb { background:var(--border2);border-radius:2px; }
  .tp-col-label { font-size:9px;font-weight:700;color:var(--text3);text-transform:uppercase;text-align:center;padding:2px 0 4px;letter-spacing:0.5px; }
  .tp-opt { padding:5px 10px;text-align:center;font-size:12px;cursor:pointer;border-radius:4px;transition:background 0.15s;white-space:nowrap; }
  .tp-opt:hover { background:var(--accent-light); }
  .tp-opt.selected { background:var(--accent);color:#fff;font-weight:700; }

  /* ═══ TRIAL BANNER ═══ */
  .trial-bar { padding:8px 16px;text-align:center;font-size:12px;font-weight:600;background:linear-gradient(90deg,#6B21A8,#DB2777);color:#fff;display:none; }
  .trial-bar.show { display:block; }
  .trial-bar a { color:#fef3c7;text-decoration:underline;margin-left:6px; }

  /* ═══ PARENT PORTAL ═══ */
  .parent-header { background:linear-gradient(135deg,var(--accent-light),var(--surface));padding:20px;border-radius:var(--radius);margin-bottom:16px;display:flex;align-items:center;gap:16px; }
  .parent-logo { width:48px;height:48px;border-radius:12px;background:linear-gradient(135deg,#6B21A8,#DB2777,#F59E0B);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:20px;font-family:var(--font-display);flex-shrink:0; }

  .modal-drag-handle { display: none; }
  .ptr-indicator { display: none; }
  .swipe-tab-indicator { display: none; }
