/* Google Sheets Dashboard */
.sheets-dashboard { width: 100%; }
.sheets-controls { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.sheets-select { background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.85rem; padding: 0.5rem 1rem; outline: none; cursor: pointer; }
.sheets-loading { color: var(--muted); font-size: 0.82rem; display: flex; align-items: center; gap: 6px; }
.sheets-loading::before { content: ''; width: 12px; height: 12px; border: 2px solid var(--muted); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chart-wrap { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; margin-bottom: 1.25rem; position: relative; height: 280px; }
.sheets-table-wrap { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.sheets-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.sheets-table th { background: var(--surface3); padding: 0.6rem 1rem; text-align: left; font-size: 0.72rem; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.sheets-table td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); }
.sheets-table tr:last-child td { border-bottom: none; }
.sheets-table tr:hover td { background: rgba(255,255,255,0.02); }
.sheets-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.summary-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
.summary-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.summary-value { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; color: var(--success); }


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #080c12;
  --surface: #0f1520;
  --surface2: #161e2e;
  --surface3: #1d2840;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --accent: #3b82f6;
  --accent2: #06b6d4;
  --text: #e8edf5;
  --muted: #5a6a82;
  --muted2: #8a9ab2;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
}
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E"); pointer-events: none; z-index: 0; }
.grid-bg { position: fixed; inset: 0; background-image: linear-gradient(rgba(59,130,246,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(59,130,246,0.025) 1px, transparent 1px); background-size: 60px 60px; pointer-events: none; z-index: 0; }
.orb { position: fixed; border-radius: 50%; filter: blur(130px); pointer-events: none; z-index: 0; }
.orb-1 { width: 500px; height: 500px; background: rgba(59,130,246,0.07); top: -150px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: rgba(6,182,212,0.05); bottom: -100px; left: -80px; }

/* SCREEN SYSTEM */
.screen { display: none; position: relative; z-index: 1; }
.screen.active { display: flex; }

/* ── LOGIN ── */
#login-screen { min-height: 100vh; align-items: center; justify-content: center; padding: 2rem; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2.5rem; box-shadow: 0 0 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03); animation: cardIn 0.6s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes cardIn { from { opacity:0; transform:translateY(24px) scale(0.97);} to {opacity:1; transform:translateY(0) scale(1);} }
.portal-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2); border-radius: 100px; padding: 4px 12px; font-size: 0.72rem; font-weight: 500; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1.5rem; }
.portal-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.login-title { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; line-height: 1.1; margin-bottom: 0.4rem; background: linear-gradient(135deg, #fff 60%, #5a6a82); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.field-label { font-size: 0.75rem; font-weight: 500; color: var(--muted2); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.5rem; display: block; }
.input-group { margin-bottom: 1rem; }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
input[type="text"], input[type="password"] { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 1rem 0.75rem 2.75rem; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.9rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
input:focus { border-color: rgba(59,130,246,0.5); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
input::placeholder { color: var(--muted); }
.error-msg { color: var(--danger); font-size: 0.78rem; margin-top: 0.5rem; display: none; }
.error-msg.show { display: block; }
.btn-primary { width: 100%; padding: 0.85rem; background: linear-gradient(135deg, var(--accent), #1d4ed8); border: none; border-radius: 10px; color: #fff; font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700; cursor: pointer; margin-top: 0.5rem; transition: opacity 0.2s, transform 0.15s; letter-spacing: 0.02em; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* ── TOPBAR (shared) ── */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; height: 60px; background: rgba(8,12,18,0.9); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.topbar-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.1rem; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-pill { display: flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 100px; padding: 4px 12px 4px 8px; font-size: 0.8rem; font-weight: 500; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; }
.pill-dot.admin { background: var(--warning); }
.pill-dot.user { background: var(--success); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.8rem; flex-shrink: 0; }
.avatar.admin-av { background: linear-gradient(135deg, var(--warning), #d97706); }
.avatar.user-av { background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.btn-sm { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--muted2); padding: 6px 14px; font-size: 0.78rem; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; white-space: nowrap; }
.btn-sm:hover { color: var(--text); border-color: var(--border2); }

/* ══ ADMIN DASHBOARD ══ */
#admin-screen { flex-direction: column; min-height: 100vh; }
.admin-content { flex: 1; padding: 2rem; max-width: 1100px; width: 100%; margin: 0 auto; }
.page-header { margin-bottom: 2rem; animation: fadeUp 0.4s both; }
.page-title { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800; margin-bottom: 0.2rem; }
.page-sub { color: var(--muted); font-size: 0.85rem; }
@keyframes fadeUp { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 1.5rem; animation: fadeUp 0.4s 0.05s both; }
.tab { flex: 1; padding: 0.6rem; background: transparent; border: none; border-radius: 8px; color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s; text-align: center; }
.tab.active { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }

.tab-panel { display: none; animation: fadeUp 0.3s both; }
.tab-panel.active { display: block; }

/* Admin cards */
.a-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; margin-bottom: 1.25rem; }
.a-card-title { font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 8px; }

/* User management table */
.user-table { width: 100%; border-collapse: collapse; }
.user-table th { text-align: left; font-size: 0.72rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 0.75rem 0.75rem; border-bottom: 1px solid var(--border); }
.user-table td { padding: 0.9rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; vertical-align: middle; }
.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: rgba(255,255,255,0.01); }
.username-cell { font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* Permission badges */
.biz-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; padding: 2px 8px; border-radius: 100px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted2); margin: 2px; }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted2); }
.toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--surface3); border: 1px solid var(--border2); border-radius: 100px; cursor: pointer; transition: background 0.2s; }
.slider::before { content: ''; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: var(--muted); border-radius: 50%; transition: transform 0.2s, background 0.2s; }
.toggle input:checked + .slider { background: rgba(59,130,246,0.2); border-color: rgba(59,130,246,0.4); }
.toggle input:checked + .slider::before { transform: translateX(16px); background: var(--accent); }

/* Action buttons row */
.actions-row { display: flex; gap: 0.5rem; }
.btn-icon { background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; color: var(--muted2); padding: 5px 10px; font-size: 0.75rem; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s; display: flex; align-items: center; gap: 4px; }
.btn-icon:hover { color: var(--text); border-color: var(--border2); }
.btn-icon.danger:hover { color: var(--danger); border-color: rgba(239,68,68,0.3); }
.btn-icon.success { color: var(--success); border-color: rgba(16,185,129,0.3); }

/* Add user form */
.add-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 0.75rem; align-items: end; }
.add-form .input-group { margin-bottom: 0; }
.btn-add { background: linear-gradient(135deg, var(--accent), #1d4ed8); border: none; border-radius: 10px; color: #fff; font-family: 'Syne', sans-serif; font-size: 0.85rem; font-weight: 700; cursor: pointer; padding: 0.75rem 1.25rem; white-space: nowrap; transition: opacity 0.2s; height: 44px; }
.btn-add:hover { opacity: 0.9; }

/* Permission modal overlay */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: 18px; padding: 2rem; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; box-shadow: 0 40px 80px rgba(0,0,0,0.6); }
.modal-title { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 800; margin-bottom: 0.3rem; }
.modal-sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 1.5rem; }
.modal-close { position: absolute; top: 1.25rem; right: 1.25rem; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; transition: all 0.2s; }
.modal-close:hover { color: var(--text); }
.modal-header { position: relative; }

/* Per-business permission rows */
.perm-biz { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 0.75rem; }
.perm-biz-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.perm-biz-name { font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.perm-biz-access-label { font-size: 0.72rem; }
.perm-biz-access-label.on { color: var(--success); }
.perm-biz-access-label.off { color: var(--muted); }
.perm-checks { display: flex; gap: 1.5rem; }
.perm-check { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted2); cursor: pointer; }
.perm-check input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.perm-check input:disabled { opacity: 0.3; cursor: not-allowed; }
.perm-check.disabled { opacity: 0.4; }

.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }

/* Business management */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.biz-manage-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; display: flex; align-items: center; gap: 12px; }
.biz-icon-wrap { width: 40px; height: 40px; border-radius: 10px; background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.15); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.biz-manage-info { flex: 1; min-width: 0; }
.biz-manage-name { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-manage-industry { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.biz-user-count { font-size: 0.72rem; color: var(--accent); margin-top: 3px; }

/* Content management */
.content-section { margin-bottom: 1.5rem; }
.content-section-title { font-size: 0.78rem; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; }
.content-item { display: flex; align-items: center; gap: 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 1rem; margin-bottom: 0.5rem; }
.content-item-icon { font-size: 1.1rem; }
.content-item-info { flex: 1; }
.content-item-name { font-size: 0.85rem; font-weight: 500; }
.content-item-meta { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.biz-filter-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.biz-filter-btn { font-size: 0.78rem; padding: 4px 12px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--muted2); cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; }
.biz-filter-btn.active { border-color: rgba(59,130,246,0.5); background: rgba(59,130,246,0.1); color: var(--accent); }

/* ══ USER DASHBOARD ══ */
#user-screen { flex-direction: column; min-height: 100vh; }
.user-content { flex: 1; padding: 2rem; max-width: 1050px; width: 100%; margin: 0 auto; }
.user-header { margin-bottom: 2rem; animation: fadeUp 0.4s both; }
.user-greeting { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800; margin-bottom: 0.2rem; }
.user-sub { color: var(--muted); font-size: 0.85rem; }
.biz-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; animation: fadeUp 0.4s 0.05s both; }
.biz-tab { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 100px; font-size: 0.82rem; font-weight: 500; cursor: pointer; color: var(--muted2); transition: all 0.2s; }
.biz-tab.active { border-color: rgba(59,130,246,0.5); background: rgba(59,130,246,0.1); color: var(--accent); }
.biz-tab-icon { font-size: 0.9rem; }

/* Company selection cards */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; animation: fadeUp 0.4s both; }
.company-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.75rem; cursor: pointer; transition: all 0.25s; position: relative; overflow: hidden; }
.company-card:hover { border-color: rgba(59,130,246,0.4); transform: translateY(-3px); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.company-card-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.company-card-logo { width: 58px; height: 58px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; overflow: hidden; flex-shrink: 0; }
.company-card-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.company-card-name { font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.2rem; }
.company-card-industry { font-size: 0.72rem; color: var(--muted); }
.company-card-reports { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 1rem; }
.report-tag { font-size: 0.68rem; padding: 2px 8px; border-radius: 100px; background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.15); color: var(--accent); }
.company-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.company-card-cta { font-size: 0.78rem; font-weight: 600; color: var(--accent); }
.company-card-arrow { font-size: 1rem; color: var(--muted); transition: transform 0.2s; }
.company-card:hover .company-card-arrow { transform: translateX(4px); color: var(--accent); }
.back-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--muted2); padding: 6px 14px; font-size: 0.8rem; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; margin-bottom: 1.25rem; }
.back-btn:hover { color: var(--text); border-color: var(--border2); }

.user-sections { animation: fadeUp 0.3s both; }
.user-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.u-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; }
.u-card-title { font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }
.u-card-title .count { font-size: 0.72rem; font-weight: 400; background: var(--surface2); border: 1px solid var(--border); border-radius: 100px; padding: 1px 8px; color: var(--muted2); }

/* Locked card */
.locked-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: 0.5; }
.lock-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.lock-msg { font-size: 0.85rem; color: var(--muted); }

/* Doc items in user dash */
.u-doc-item { display: flex; align-items: center; gap: 10px; padding: 0.7rem; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
.u-doc-item:hover { background: var(--surface2); }
.u-doc-icon { width: 34px; height: 34px; border-radius: 8px; background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.15); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
.u-doc-name { font-size: 0.83rem; font-weight: 500; }
.u-doc-meta { font-size: 0.7rem; color: var(--muted); margin-top: 1px; }

/* Financial info */
.fin-item { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem; background: var(--surface2); border-radius: 10px; margin-bottom: 0.5rem; }
.fin-label { font-size: 0.82rem; color: var(--muted2); }
.fin-value { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; }
.fin-value.up { color: var(--success); }
.fin-value.neutral { color: var(--text); }

/* Empty state */
.empty-state { padding: 2rem; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* No businesses state */
.no-access { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem 2rem; text-align: center; }
.no-access-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.no-access-title { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.no-access-msg { color: var(--muted); font-size: 0.85rem; max-width: 300px; }

/* Toast */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: var(--surface2); border: 1px solid var(--border2); border-radius: 12px; padding: 0.85rem 1.25rem; font-size: 0.85rem; font-weight: 500; z-index: 200; box-shadow: 0 20px 50px rgba(0,0,0,0.5); transform: translateY(20px); opacity: 0; transition: all 0.35s cubic-bezier(0.16,1,0.3,1); pointer-events: none; max-width: 300px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.green { color: var(--success); border-color: rgba(16,185,129,0.3); }
.toast.red { color: var(--danger); border-color: rgba(239,68,68,0.3); }

/* ── RESPONSIVE / MOBILE ── */
@media (max-width: 768px) {
  /* Login */
  .login-card { padding: 1.75rem 1.25rem; margin: 1rem; border-radius: 16px; }
  .login-title { font-size: 1.6rem; }
  input[type="text"], input[type="password"] { font-size: 1rem; padding: 0.85rem 1rem 0.85rem 2.75rem; }
  .btn-primary { padding: 1rem; font-size: 1rem; }

  /* Topbar */
  .topbar { padding: 0 1rem; height: 54px; }
  .topbar-logo { font-size: 0.95rem; }
  .topbar-pill { display: none; }

  /* Admin */
  .admin-content { padding: 1rem; }
  .add-form { grid-template-columns: 1fr; gap: 0.5rem; }
  .tabs { flex-direction: column; gap: 4px; }
  .tab { padding: 0.5rem; font-size: 0.8rem; }
  .user-table { font-size: 0.78rem; }
  .user-table th, .user-table td { padding: 0.6rem 0.5rem; }
  .actions-row { flex-direction: column; gap: 4px; }
  .btn-icon { font-size: 0.72rem; padding: 5px 8px; }
  .biz-grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 1.25rem; }
  .perm-checks { flex-direction: column; gap: 0.5rem; }

  /* User dashboard */
  .user-content { padding: 1rem; }
  .user-greeting { font-size: 1.2rem; }
  .company-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .company-card { padding: 1.25rem; }
  .user-grid { grid-template-columns: 1fr; }

  /* Charts & sheets */
  .chart-wrap { height: 200px; }
  .sheets-controls { flex-wrap: wrap; gap: 0.5rem; }
  .sheets-select { font-size: 0.85rem; padding: 0.5rem 0.75rem; width: 100%; }
  .sheets-table { font-size: 0.75rem; }
  .sheets-table th, .sheets-table td { padding: 0.5rem 0.6rem; }
  .summary-card { padding: 0.85rem; }
  .summary-value { font-size: 1.1rem; }

  /* Dash tabs */
  .dash-tab-btn { font-size: 0.75rem; padding: 0.4rem; }

  /* Toast */
  .toast { bottom: 1rem; right: 1rem; left: 1rem; max-width: 100%; }

  /* Back button */
  .back-btn { margin-bottom: 1rem; }

  /* Hide orbs on mobile for performance */
  .orb { display: none; }
}

@media (max-width: 480px) {
  .login-card { margin: 0.5rem; padding: 1.5rem 1rem; }
  .login-title { font-size: 1.4rem; }
  .company-card-name { font-size: 0.88rem; }
  .topbar-logo { font-size: 0.85rem; }
  .user-greeting { font-size: 1.1rem; }
  .biz-grid { grid-template-columns: 1fr; }
}

/* Documents page */
.docs-page { animation: fadeUp 0.3s both; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.doc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; gap: 0.75rem; }
.doc-card:hover { border-color: rgba(59,130,246,0.4); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.doc-card-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.doc-card-icon.pdf { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); }
.doc-card-icon.excel { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); }
.doc-card-icon.word { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2); }
.doc-card-name { font-size: 0.85rem; font-weight: 600; line-height: 1.3; }
.doc-card-desc { font-size: 0.75rem; color: var(--muted); }
.doc-card-date { font-size: 0.7rem; color: var(--muted); margin-top: auto; }
.pdf-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 200; display: none; flex-direction: column; }
.pdf-modal.open { display: flex; }
.pdf-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.pdf-modal-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.95rem; }
.pdf-modal-close { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); padding: 6px 14px; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 0.82rem; }
.pdf-modal-body { flex: 1; overflow: hidden; }
.pdf-modal-body iframe { width: 100%; height: 100%; border: none; }
.upload-area { border: 2px dashed var(--border2); border-radius: 12px; padding: 2rem; text-align: center; cursor: pointer; transition: all 0.2s; margin-bottom: 1rem; }
.upload-area:hover { border-color: var(--accent); background: rgba(59,130,246,0.05); }
.upload-area-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-area-text { font-size: 0.85rem; color: var(--muted2); }
.upload-area-text strong { color: var(--accent); }
.admin-doc-item { display: flex; align-items: center; gap: 12px; padding: 0.75rem; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.5rem; }
.admin-doc-info { flex: 1; min-width: 0; }
.admin-doc-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-doc-meta { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

