/* ==========================================================================
   Gurukul Study Center — premium editorial theme
   Ivory paper · deep emerald · brass accents · serif display
   ========================================================================== */

:root {
  --paper: #f7f4ec;
  --paper-2: #efeadf;
  --ink: #24312b;
  --ink-soft: #5a665f;
  --emerald: #14532d;
  --emerald-2: #166534;
  --teal: #0f766e;
  --brass: #b7791f;
  --brass-soft: #d9b45b;
  --line: rgba(20, 83, 45, 0.12);
  --card: rgba(255, 255, 255, 0.72);
  --shadow: 0 10px 34px rgba(18, 51, 37, 0.10);
}

* { box-sizing: border-box; }

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

h1, h2, h3, .font-display {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.01em;
}

.bg-scene {
  background:
    radial-gradient(900px 480px at 10% -6%, rgba(52, 132, 96, 0.14), transparent 60%),
    radial-gradient(800px 460px at 94% 4%, rgba(183, 121, 31, 0.10), transparent 55%),
    linear-gradient(160deg, var(--paper) 0%, #fbf9f3 50%, var(--paper-2) 100%);
  min-height: 100vh;
}

/* ---------- Public navbar ---------- */
.navbar {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.navbar .nav-link { color: var(--ink-soft); font-weight: 500; }
.navbar .nav-link:hover { color: var(--emerald); }

.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  color: #fff; font-weight: 700; font-size: 1rem;
}

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 3rem; }
.hero .eyebrow {
  color: var(--brass);
  font-weight: 700; font-size: .72rem;
  letter-spacing: .22em; text-transform: uppercase;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1.12; }
.hero .lead { color: var(--ink-soft); max-width: 540px; }
.gradient-text {
  background: linear-gradient(100deg, var(--emerald) 0%, var(--teal) 55%, var(--brass) 115%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Cards / panels ---------- */
.glass-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.glass-card .card-header, .panel-head {
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid var(--line);
  border-radius: 1.1rem 1.1rem 0 0 !important;
  font-weight: 700;
}
.stat-card { padding: 1rem 1.1rem; }
.stat-card .stat-label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 800; font-family: Georgia, serif; }

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(110deg, var(--emerald), var(--teal));
  border: 0; color: #fff;
  box-shadow: 0 6px 18px rgba(20, 83, 45, 0.30);
}
.btn-primary:hover { background: linear-gradient(110deg, var(--emerald-2), #0d5e58); color: #fff; }
.btn-outline-success { color: var(--emerald); border-color: rgba(20, 83, 45, 0.4); }
.btn-outline-success:hover { background: var(--emerald); border-color: var(--emerald); color: #fff; }

/* ---------- App shell (admin / student) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 248px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 1rem;
}
.app-brand { display: flex; gap: .65rem; align-items: center; text-decoration: none; color: var(--ink); padding: .25rem .25rem .9rem; }
.app-brand small { display: block; color: var(--brass); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
.app-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.app-nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .75rem; border-radius: .6rem;
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .9rem;
}
.app-nav-link i { font-size: 1rem; }
.app-nav-link:hover { background: rgba(20, 83, 45, 0.06); color: var(--emerald); }
.app-nav-link.active {
  background: linear-gradient(110deg, var(--emerald), var(--teal));
  color: #fff; box-shadow: 0 6px 16px rgba(20, 83, 45, 0.28);
}
.app-sidebar-foot { border-top: 1px solid var(--line); padding-top: .9rem; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: .9rem; flex-shrink: 0;
}
.avatar-admin { background: linear-gradient(135deg, #92400e, var(--brass)); }
.avatar-student { background: linear-gradient(135deg, var(--emerald), var(--teal)); }

.app-main { flex: 1; min-width: 0; }
.app-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(247, 244, 236, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: .65rem 1.5rem;
}
.app-content { padding: 1.5rem; max-width: 1280px; }

/* ---------- Tables ---------- */
.table thead th {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-soft); border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}
.table tbody tr:hover { background: rgba(255, 255, 255, 0.55); }
.table td { vertical-align: middle; }

/* ---------- Feed (community) ---------- */
.post-body { white-space: pre-wrap; }
.comment-card { background: rgba(255, 255, 255, 0.55); border-radius: .8rem; }

/* ---------- Misc ---------- */
.text-brass { color: var(--brass); }
.form-control, .form-select { background: rgba(255, 255, 255, 0.85); }
.form-control:focus, .form-select:focus { border-color: rgba(20, 83, 45, 0.5); box-shadow: 0 0 0 .2rem rgba(20, 83, 45, 0.12); }
.section-eyebrow {
  color: var(--brass); font-weight: 700; font-size: .72rem;
  letter-spacing: .22em; text-transform: uppercase;
}
.list-group-item { background: transparent; }

@media (max-width: 991.98px) {
  .app-shell { display: block; }
  .app-sidebar { position: static; width: 100%; height: auto; }
  .app-nav { flex-direction: row; flex-wrap: wrap; }
  .app-sidebar-foot { display: none; }
}

/* ---------- Print (receipts, ID card) ---------- */
@media print {
  .app-sidebar, .app-topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .app-content { padding: 0; max-width: 100%; }
  .glass-card { box-shadow: none; }
}
