/* ============================================================
   DigiLib — Digital Learning Platform
   style.css
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --c1: #2563eb;
  --c2: #16a34a;
  --c3: #d97706;
  --c4: #dc2626;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-light: #eff6ff;

  --bg: #f8fafc;
  --bg2: #ffffff;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;

  --sidebar-w: 260px;
  --topbar-h: 64px;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(0,0,0,.07);
  --shadow-md: 0 4px 24px rgba(0,0,0,.10);

  --font: 'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;

  --transition: .22s cubic-bezier(.4,0,.2,1);
}

body.dark {
  --bg: #0f172a;
  --bg2: #1e293b;
  --surface: #1e293b;
  --surface2: #0f172a;
  --border: #334155;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #475569;
  --shadow: 0 2px 16px rgba(0,0,0,.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,.4);
}

/* ── Reset ──────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }
select, input, textarea {
  font-family: var(--font);
  color: var(--text);
  background: transparent;
}
img { max-width: 100%; }

/* ── Page System ────────────────────────────────────────────── */
.page { display: none; min-height: 100vh; }
.page.active { display: flex; flex-direction: column; }
.app-layout { flex-direction: row !important; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: .6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  transition: background var(--transition), transform var(--transition);
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-primary.btn-lg { padding: .8rem 2rem; font-size: 1rem; border-radius: 10px; }
.btn-primary.btn-full { width: 100%; justify-content: center; padding: .85rem; margin-top: .5rem; font-size: 1rem; border-radius: 10px; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: .6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: border-color var(--transition), background var(--transition);
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost.btn-lg { padding: .8rem 2rem; font-size: 1rem; border-radius: 10px; }
.btn-ghost-sm { padding: .4rem .9rem; font-size: .85rem; background: transparent; border: 1.5px solid var(--border); border-radius: var(--radius-sm); color: var(--text2); transition: var(--transition); }
.btn-ghost-sm:hover { border-color: var(--brand); color: var(--brand); }

.btn-sm {
  background: var(--surface2);
  border: none;
  padding: .35rem .55rem;
  border-radius: 6px;
  color: var(--text2);
  font-size: .85rem;
  transition: var(--transition);
}
.btn-sm:hover { background: var(--brand); color: #fff; }
.btn-approve { background: #dcfce7; color: #16a34a; }
.btn-approve:hover { background: #16a34a; color: #fff; }
.btn-reject { background: #fee2e2; color: #dc2626; }
.btn-reject:hover { background: #dc2626; color: #fff; }

.btn-danger { background: #fee2e2; color: var(--c4); border: none; padding: .5rem 1rem; border-radius: 8px; font-weight: 600; transition: var(--transition); }
.btn-danger:hover { background: var(--c4); color: #fff; }

.btn-google {
  width: 100%; padding: .75rem; background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 10px; font-size: .95rem; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: .6rem;
  color: var(--text); transition: var(--transition);
}
.btn-google:hover { border-color: var(--brand); }

/* ── Form Elements ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text2); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

.input-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 10px; overflow: hidden; transition: border-color var(--transition);
}
.input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.input-wrap > i:first-child { padding: 0 .75rem; color: var(--text3); font-size: .9rem; flex-shrink: 0; }
.input-wrap input,
.input-wrap select { flex: 1; padding: .7rem .75rem .7rem 0; border: none; outline: none; background: transparent; font-size: .95rem; }
.input-wrap select { padding-right: .5rem; }
.toggle-pass { padding: 0 .75rem; color: var(--text3); cursor: pointer; flex-shrink: 0; font-size: .9rem; }
textarea { width: 100%; padding: .75rem 1rem; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface2); outline: none; resize: vertical; font-size: .95rem; transition: border-color var(--transition); }
textarea:focus { border-color: var(--brand); }

.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--text2); cursor: pointer; }
.forgot-link { font-size: .875rem; color: var(--brand); }
.divider { text-align: center; position: relative; margin: 1.2rem 0; color: var(--text3); font-size: .85rem; }
.divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.divider::before { left: 0; }
.divider::after { right: 0; }
.search-sm { flex: 1; min-width: 200px; }

/* ── LANDING ────────────────────────────────────────────────── */
#page-landing { background: var(--bg); }

.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2rem; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { font-weight: 500; color: var(--text2); transition: color var(--transition); }
.nav-links a:hover { color: var(--brand); text-decoration: none; }

.logo { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: .4rem; }
.logo-icon { color: var(--brand); font-size: 1.1rem; }
.logo-white { color: #fff; }
.logo-white .logo-icon { color: #93c5fd; }

.hero {
  text-align: center; padding: 5rem 1.5rem 3rem;
  background: linear-gradient(160deg, #eff6ff 0%, #f8fafc 60%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.08) 0%, transparent 70%);
}
.hero-badge {
  display: inline-block; background: var(--brand-light); color: var(--brand);
  padding: .35rem 1rem; border-radius: 99px; font-size: .85rem; font-weight: 600;
  margin-bottom: 1.5rem; border: 1px solid rgba(37,99,235,.15);
}
.hero-title {
  font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.1; margin-bottom: 1.2rem; color: var(--text);
}
.gradient-text {
  background: linear-gradient(135deg, var(--brand) 0%, #7c3aed 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { max-width: 560px; margin: 0 auto 2rem; color: var(--text2); font-size: 1.1rem; line-height: 1.7; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--text); }
.stat span { font-size: .8rem; color: var(--text2); }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

.features-strip {
  display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 2rem 1.5rem; background: var(--surface);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.feature-card {
  display: flex; align-items: center; gap: .6rem;
  color: var(--text2); font-weight: 500; font-size: .9rem;
}
.feature-card i { color: var(--brand); }

.landing-branches { padding: 4rem 1.5rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.section-title { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; margin-bottom: 1.8rem; text-align: center; }
.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.branch-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-align: center;
}
.branch-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand); }
.branch-icon { width: 52px; height: 52px; border-radius: 12px; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; opacity: .85; }
.branch-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.branch-card p { font-size: .8rem; color: var(--text2); }

.landing-footer {
  padding: 2rem; text-align: center; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  color: var(--text2); font-size: .875rem;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text2); }
.footer-links a:hover { color: var(--brand); }

/* ── AUTH ────────────────────────────────────────────────────── */
.auth-layout { display: flex; min-height: 100vh; }
.auth-visual {
  flex: 0 0 42%;
  background: linear-gradient(145deg, var(--brand) 0%, #1d4ed8 40%, #7c3aed 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem; color: #fff;
}
.auth-visual-alt { background: linear-gradient(145deg, #7c3aed 0%, #2563eb 60%, #0ea5e9 100%); }
.auth-visual-inner { max-width: 340px; }
.auth-visual-inner h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 800; margin: 2rem 0 .75rem; }
.auth-visual-inner p { opacity: .85; font-size: 1.05rem; line-height: 1.6; }
.auth-illustration { font-size: 5rem; margin-top: 2.5rem; display: block; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }

.auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
.auth-form-box { width: 100%; max-width: 440px; }
.back-btn { background: none; border: none; color: var(--text2); font-size: .875rem; display: flex; align-items: center; gap: .4rem; margin-bottom: 1.5rem; padding: 0; transition: color var(--transition); }
.back-btn:hover { color: var(--brand); }
.form-title { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; margin-bottom: .25rem; }
.form-sub { color: var(--text2); font-size: .9rem; margin-bottom: 1.5rem; }

.role-toggle { display: flex; gap: .5rem; margin-bottom: 1.5rem; background: var(--surface2); padding: 4px; border-radius: 10px; border: 1.5px solid var(--border); }
.role-btn { flex: 1; padding: .5rem; border: none; border-radius: 8px; background: transparent; font-weight: 600; font-size: .9rem; color: var(--text2); transition: var(--transition); }
.role-btn.active { background: var(--brand); color: #fff; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  height: 100vh; position: sticky; top: 0;
  display: flex; flex-direction: column; overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-admin { border-right-color: rgba(37,99,235,.3); }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.2rem 1rem;
}
.sidebar-close { display: none; background: none; border: none; font-size: 1.1rem; color: var(--text2); }
.sidebar-user { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.2rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: .5rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-admin { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.sidebar-username { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.sidebar-role { font-size: .75rem; color: var(--text3); }

.sidebar-nav { flex: 1; padding: .5rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.nav-item {
  display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem;
  border-radius: 9px; color: var(--text2); font-weight: 500; font-size: .9rem;
  transition: background var(--transition), color var(--transition);
  text-decoration: none; position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.nav-item i { width: 18px; text-align: center; }
.badge { background: var(--brand); color: #fff; font-size: .7rem; padding: .1rem .45rem; border-radius: 99px; margin-left: auto; }
.nav-logout { color: #ef4444; }
.nav-logout:hover { background: #fee2e2; color: #dc2626; }
.sidebar-footer { padding: .75rem; border-top: 1px solid var(--border); }
.admin-tag { background: var(--brand); color: #fff; font-size: .65rem; padding: .15rem .45rem; border-radius: 4px; font-weight: 600; }

/* ── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 90;
}
.hamburger { display: none; background: none; border: none; font-size: 1.2rem; color: var(--text2); }
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.icon-btn { background: none; border: none; font-size: 1rem; color: var(--text2); position: relative; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.icon-btn:hover { background: var(--surface2); }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; border: 1.5px solid var(--surface); }
.topbar-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.notif-btn { position: relative; }

/* ── MAIN CONTENT ────────────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; min-width: 0; display: flex; flex-direction: column; }
.tab-content { display: none; padding: 2rem; flex: 1; animation: fadeIn .2s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; }
.page-desc { color: var(--text2); font-size: .9rem; margin-top: .2rem; }

/* ── STATS ROW ──────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem 1.4rem; display: flex; align-items: center; gap: 1rem;
  border-left: 4px solid var(--accent, var(--brand));
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; background: color-mix(in srgb, var(--accent, var(--brand)) 12%, transparent); color: var(--accent, var(--brand)); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.stat-info { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--text2); margin-top: .15rem; }

/* ── DASHBOARD GRID ─────────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.dash-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-header h3 { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.card-header a { font-size: .825rem; color: var(--brand); }

/* ── RESOURCE LIST ──────────────────────────────────────────── */
.resource-list { display: flex; flex-direction: column; gap: .65rem; }
.resource-item { display: flex; align-items: center; gap: .85rem; padding: .7rem; border-radius: 10px; background: var(--surface2); transition: background var(--transition); }
.resource-item:hover { background: var(--brand-light); }
.res-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.res-icon.pdf { background: #fee2e2; color: #dc2626; }
.res-icon.doc { background: #dbeafe; color: #2563eb; }
.res-icon.ppt { background: #ffedd5; color: #ea580c; }
.res-info { flex: 1; min-width: 0; }
.res-info strong { font-size: .875rem; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-info span { font-size: .75rem; color: var(--text3); }
.res-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* ── QUICK GRID ─────────────────────────────────────────────── */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
.quick-btn { background: var(--surface2); border: 1.5px solid var(--border); border-radius: 10px; padding: .85rem .6rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--text2); transition: var(--transition); }
.quick-btn i { font-size: 1.1rem; color: var(--brand); }
.quick-btn:hover { border-color: var(--brand); background: var(--brand-light); color: var(--brand); }

.announce-list { display: flex; flex-direction: column; gap: .65rem; }
.announce-item { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem; border-radius: 10px; background: var(--surface2); }
.announce-item i { margin-top: .2rem; font-size: 1rem; }
.announce-item strong { font-size: .85rem; font-weight: 600; display: block; }
.announce-item p { font-size: .8rem; color: var(--text2); }

/* ── BRANCHES ────────────────────────────────────────────────── */
.branches-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1.2rem; }
.branch-big-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; cursor: pointer; position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  border-top: 4px solid var(--bc);
}
.branch-big-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--bc); }
.bc-emoji { font-size: 2.2rem; margin-bottom: .85rem; }
.branch-big-card h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin-bottom: .3rem; }
.branch-big-card p { font-size: .8rem; color: var(--text2); }
.bc-arrow { position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--bc); opacity: .4; font-size: 1.1rem; }
.branch-big-card:hover .bc-arrow { opacity: 1; }

.branch-detail { margin-top: 1.5rem; }
.branch-detail h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; margin: 1rem 0; }
.subject-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 1rem; }
.hidden { display: none !important; }

/* ── SEARCH ──────────────────────────────────────────────────── */
.search-bar-wrap { margin-bottom: 1.5rem; }
.big-search-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--surface); border: 2px solid var(--border); border-radius: 14px;
  overflow: hidden; margin-bottom: 1rem;
  transition: border-color var(--transition);
}
.big-search-bar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.big-search-bar > i { padding: 0 1rem; color: var(--text3); font-size: 1rem; flex-shrink: 0; }
.big-search-bar input { flex: 1; padding: .9rem 0; border: none; outline: none; background: transparent; font-size: 1rem; }
.big-search-bar button { background: var(--brand); color: #fff; border: none; padding: .9rem 1.5rem; font-weight: 600; font-size: .9rem; transition: background var(--transition); }
.big-search-bar button:hover { background: var(--brand-dark); }
.search-filters { display: flex; gap: .75rem; flex-wrap: wrap; }
.search-filters select { padding: .5rem .85rem; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface); font-size: .875rem; outline: none; cursor: pointer; }
.search-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }
.search-empty { text-align: center; color: var(--text3); padding: 3rem; font-size: 1rem; grid-column: 1/-1; }
.search-empty i { font-size: 2.5rem; display: block; margin-bottom: .75rem; }

.result-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem; display: flex; gap: .85rem; align-items: flex-start;
  transition: transform var(--transition), box-shadow var(--transition);
}
.result-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rc-info { flex: 1; min-width: 0; }
.rc-info h4 { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.rc-info .rc-meta { font-size: .75rem; color: var(--text3); margin-bottom: .5rem; }
.rc-info .rc-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.rc-tag { font-size: .7rem; background: var(--brand-light); color: var(--brand); padding: .15rem .5rem; border-radius: 99px; font-weight: 500; }
.rc-actions { display: flex; flex-direction: column; gap: .4rem; }

/* ── UPLOAD ──────────────────────────────────────────────────── */
.upload-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; }
.upload-form-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }
.upload-info-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.6rem; height: fit-content; }
.upload-info-card h3 { font-family: var(--font-display); font-weight: 700; font-size: .95rem; margin-bottom: .85rem; display: flex; align-items: center; gap: .5rem; color: var(--text); }
.upload-info-card ul { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.upload-info-card li { font-size: .85rem; color: var(--text2); line-height: 1.5; }
.mini-resource-list { display: flex; flex-direction: column; gap: .5rem; }
.mini-res { display: flex; align-items: center; gap: .6rem; padding: .6rem; border-radius: 8px; background: var(--surface2); font-size: .85rem; color: var(--text2); }

.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 2.5rem 1.5rem;
  text-align: center; cursor: pointer; transition: var(--transition); margin-bottom: 1rem;
  background: var(--surface2);
}
.dropzone:hover, .dropzone.dz-active { border-color: var(--brand); background: var(--brand-light); }
.dropzone i { font-size: 2.5rem; color: var(--brand); margin-bottom: .75rem; display: block; }
.dropzone p { font-weight: 600; color: var(--text2); margin-bottom: .3rem; }
.dropzone span { color: var(--brand); text-decoration: underline; }
.dropzone small { color: var(--text3); font-size: .8rem; }

.file-item { display: flex; align-items: center; gap: .65rem; padding: .6rem .9rem; background: var(--surface2); border-radius: 8px; margin-bottom: .5rem; font-size: .875rem; }
.file-item i { color: var(--brand); }
.file-item span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .remove-file { background: none; border: none; color: var(--text3); cursor: pointer; padding: 0 .2rem; }
.file-item .remove-file:hover { color: #dc2626; }

/* ── NOTIFICATIONS ──────────────────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: .75rem; max-width: 720px; }
.notif-item {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; display: flex; gap: 1rem; align-items: flex-start;
  position: relative; transition: var(--transition);
}
.notif-item.unread { border-left: 4px solid var(--brand); background: var(--brand-light); }
.notif-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .9rem; color: #fff; flex-shrink: 0; }
.bg-blue { background: var(--c1); }
.bg-green { background: var(--c2); }
.bg-orange { background: var(--c3); }
.bg-purple { background: #7c3aed; }
.notif-body { flex: 1; }
.notif-body strong { font-size: .9rem; font-weight: 600; display: block; margin-bottom: .15rem; }
.notif-body p { font-size: .825rem; color: var(--text2); }
.notif-time { font-size: .75rem; color: var(--text3); margin-top: .3rem; display: block; }
.notif-close { position: absolute; top: .8rem; right: .8rem; background: none; border: none; color: var(--text3); font-size: .8rem; padding: .2rem; }
.notif-close:hover { color: var(--c4); }

/* ── PROFILE ─────────────────────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; align-items: start; }
.profile-left { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; }
.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 1rem; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--brand) 0%, #7c3aed 100%); color: #fff; font-size: 1.6rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.avatar-edit-btn { position: absolute; bottom: 0; right: 0; width: 26px; height: 26px; background: var(--brand); color: #fff; border: none; border-radius: 50%; font-size: .65rem; display: flex; align-items: center; justify-content: center; }
.profile-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; margin-bottom: .2rem; }
.profile-branch { font-size: .85rem; color: var(--text2); margin-bottom: 1rem; }
.profile-badges { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.badge-tag { font-size: .7rem; background: var(--brand-light); color: var(--brand); padding: .25rem .65rem; border-radius: 99px; font-weight: 600; }
.profile-mini-stats { display: flex; gap: 1rem; justify-content: center; border-top: 1px solid var(--border); padding-top: 1rem; }
.pm-stat { display: flex; flex-direction: column; align-items: center; }
.pm-stat strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; }
.pm-stat span { font-size: .72rem; color: var(--text2); }

.profile-right { display: flex; flex-direction: column; gap: 1.2rem; }
.profile-section { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.profile-section h3 { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }

/* ── SETTINGS ────────────────────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; max-width: 900px; }
.settings-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.settings-card h3 { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: .5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: .7rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.setting-row:last-child { border: none; }
.danger-card { border-color: #fecaca; }
.danger-card h3 { color: var(--c4); }

.toggle-switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 22px; transition: .3s; }
.slider::before { content: ''; position: absolute; width: 16px; height: 16px; bottom: 3px; left: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.toggle-switch input:checked + .slider { background: var(--brand); }
.toggle-switch input:checked + .slider::before { transform: translateX(20px); }

/* ── ADMIN: USERS TABLE ─────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-toolbar select { padding: .5rem .85rem; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface2); font-size: .875rem; outline: none; }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface2); }
th { text-align: left; padding: .85rem 1rem; font-size: .8rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td { padding: .85rem 1rem; font-size: .875rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border: none; }
tr:hover td { background: var(--surface2); }
.status-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.status-active { background: #dcfce7; color: #16a34a; }
.status-inactive { background: var(--surface2); color: var(--text3); }

/* ── BRANCH SUMMARY ─────────────────────────────────────────── */
.branch-summary-list { display: flex; flex-direction: column; gap: .9rem; }
.bs-row { display: flex; align-items: center; gap: .75rem; }
.bs-branch { font-size: .8rem; font-weight: 600; width: 110px; flex-shrink: 0; color: var(--text2); }
.bs-bar-wrap { flex: 1; height: 8px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.bs-bar { height: 100%; border-radius: 99px; transition: width .6s ease; }
.bs-row > span:last-child { font-size: .8rem; font-weight: 600; width: 32px; text-align: right; color: var(--text2); }

/* ── TOAST ───────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  background: var(--text); color: var(--bg);
  padding: .75rem 1.2rem; border-radius: 10px; font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow-md); transform: translateY(80px); opacity: 0;
  transition: all .3s cubic-bezier(.4,0,.2,1); pointer-events: none; max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── SIDEBAR OVERLAY ────────────────────────────────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 199; }
.sidebar-overlay.visible { display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .upload-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%); z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .hamburger { display: flex; }
  .auth-visual { display: none; }
  .auth-form-wrap { padding: 1.5rem; }
}

@media (max-width: 600px) {
  .hero { padding: 3.5rem 1rem 2.5rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .branch-grid { grid-template-columns: 1fr 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .tab-content { padding: 1.2rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .branches-grid { grid-template-columns: 1fr 1fr; }
  .search-results { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-btn { font-size: .7rem; padding: .65rem .3rem; }
  .topbar { padding: 0 1rem; }
  .features-strip { gap: 1rem; padding: 1.2rem; }
  .landing-nav { padding: 1rem; }
}

@media (max-width: 400px) {
  .branch-grid { grid-template-columns: 1fr; }
  .branches-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
}