/* ============================================
   EPIC Health Wallet — App Styles
   Brand: Indigo / Gold / Green
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand Colors */
  --indigo:       #1B4D8E;
  --indigo-light: #2E6AB8;
  --indigo-dark:  #123660;
  --indigo-bg:    #EBF1F9;
  --gold:         #D4A12E;
  --gold-light:   #E8BD5C;
  --gold-bg:      #FDF6E3;
  --green:        #2E8B57;
  --green-light:  #4CAF7A;
  --green-bg:     #E8F5EE;
  --red:          #D9534F;
  --red-light:    #FDECEA;
  --orange:       #E67E22;
  --orange-bg:    #FFF3E0;

  /* Neutrals */
  --white:   #FFFFFF;
  --gray-50: #F8F9FA;
  --gray-100:#F1F3F5;
  --gray-200:#E9ECEF;
  --gray-300:#DEE2E6;
  --gray-400:#ADB5BD;
  --gray-500:#6C757D;
  --gray-600:#495057;
  --gray-700:#343A40;
  --gray-800:#212529;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Sizing */
  --sidebar-w:  260px;
  --header-h:   64px;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 2px 6px rgba(0,0,0,.08);
  --shadow-md:  0 4px 14px rgba(0,0,0,.1);
  --shadow-lg:  0 8px 28px rgba(0,0,0,.12);

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--gray-700);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea {
  font-family: inherit; font-size: inherit; color: inherit;
}
ul { list-style: none; }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--indigo-dark) 0%, var(--indigo) 50%, var(--indigo-light) 100%);
}
.auth-wrapper {
  display: flex;
  min-height: 100vh;
}
.auth-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  color: var(--white);
  max-width: 520px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 2rem;
}
.auth-brand strong { font-weight: 700; }
.auth-left h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.auth-left p {
  font-size: 1.05rem;
  opacity: .85;
  margin-bottom: 2rem;
  line-height: 1.5;
}
.auth-features { display: flex; flex-direction: column; gap: .75rem; }
.auth-feature {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .95rem;
  opacity: .9;
}
.auth-feature svg { width: 20px; height: 20px; flex-shrink: 0; stroke: var(--gold-light); }

.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}
.auth-card h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: .25rem;
}
.auth-subtitle {
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}
.auth-field {
  margin-bottom: 1rem;
}
.auth-field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: .35rem;
}
.auth-field input {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--white);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.auth-field input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(27,77,142,.12);
}
.auth-field input::placeholder { color: var(--gray-400); }

.password-wrap {
  position: relative;
}
.password-wrap input { padding-right: 2.8rem; }
.toggle-password {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: .5;
  transition: opacity .2s;
}
.toggle-password:hover { opacity: .8; }

.auth-error {
  color: var(--red);
  font-size: .85rem;
  min-height: 1.2em;
  margin-bottom: .5rem;
}

.btn-auth-primary {
  display: block;
  width: 100%;
  padding: .8rem;
  background: var(--indigo);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s var(--ease), transform .15s var(--ease);
}
.btn-auth-primary:hover { background: var(--indigo-light); }
.btn-auth-primary:active { transform: scale(.98); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--gray-400);
  font-size: .85rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

.auth-switch {
  text-align: center;
  font-size: .9rem;
  color: var(--gray-500);
}
.auth-switch a { font-weight: 600; }

.auth-back {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: .85rem;
  color: var(--gray-400);
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* -- Sidebar -- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--indigo-dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform .3s var(--ease);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.25rem 1.25rem .75rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: .5rem;
}
.sidebar-brand strong { font-weight: 700; }
.sidebar-brand svg { flex-shrink: 0; }

.sidebar-nav {
  flex: 1;
  padding: .5rem 0;
  overflow-y: auto;
}
.nav-section-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
  padding: 1rem 1.25rem .4rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1.25rem;
  font-size: .9rem;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  border-radius: 0;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .7; }
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: .3rem; bottom: .3rem;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--indigo-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: .72rem; opacity: .5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.5); padding: .3rem;
  transition: color .2s;
}
.btn-logout:hover { color: var(--red); }
.btn-logout svg { width: 18px; height: 18px; }

/* -- Main Content -- */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-left h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
}
.btn-menu-toggle {
  display: none;
  background: none; border: none;
  cursor: pointer; padding: .3rem;
  color: var(--gray-600);
}
.btn-menu-toggle svg { width: 24px; height: 24px; }

.header-right { display: flex; align-items: center; gap: .75rem; }
.header-date {
  font-size: .85rem;
  color: var(--gray-500);
}

.app-content {
  flex: 1;
  padding: 1.75rem;
  max-width: 1200px;
  width: 100%;
}

/* ============================================
   CARDS & WIDGETS
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--gray-200);
  padding: 1.25rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

/* Stat cards grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--gray-200);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .9rem;
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.indigo  { background: var(--indigo-bg); color: var(--indigo); }
.stat-icon.gold    { background: var(--gold-bg);   color: var(--gold); }
.stat-icon.green   { background: var(--green-bg);  color: var(--green); }
.stat-icon.red     { background: var(--red-light);  color: var(--red); }
.stat-icon.orange  { background: var(--orange-bg); color: var(--orange); }
.stat-info { flex: 1; }
.stat-label {
  font-size: .78rem;
  color: var(--gray-500);
  margin-bottom: .15rem;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.2;
}
.stat-change {
  font-size: .75rem;
  margin-top: .2rem;
}
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ============================================
   TABLES
   ============================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .65rem .75rem;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
td {
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: .9rem;
}
tr:last-child td { border-bottom: none; }
tr:hover { background: var(--gray-50); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--indigo);
  color: var(--white);
}
.btn-primary:hover { background: var(--indigo-light); }

.btn-success {
  background: var(--green);
  color: var(--white);
}
.btn-success:hover { background: var(--green-light); }

.btn-warning {
  background: var(--gold);
  color: var(--white);
}
.btn-warning:hover { background: var(--gold-light); }

.btn-danger {
  background: var(--red);
  color: var(--white);
}
.btn-danger:hover { background: #c9302c; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-600);
}
.btn-outline:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--indigo-bg);
}

.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  cursor: pointer;
  transition: all .2s;
}
.btn-icon:hover { color: var(--indigo); border-color: var(--indigo); background: var(--indigo-bg); }
.btn-icon.danger:hover { color: var(--red); border-color: var(--red); background: var(--red-light); }

/* ============================================
   FORMS (in-app)
   ============================================ */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: .83rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: .3rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .6rem .8rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--white);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(27,77,142,.1);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  transform: translateY(20px) scale(.96);
  transition: transform .25s var(--ease);
}
.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-800);
}
.modal-close {
  background: none; border: none;
  cursor: pointer; color: var(--gray-400);
  font-size: 1.3rem; line-height: 1;
  padding: .2rem;
  transition: color .2s;
}
.modal-close:hover { color: var(--gray-700); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1.5rem;
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s var(--ease);
}
.progress-fill.indigo { background: var(--indigo); }
.progress-fill.green  { background: var(--green); }
.progress-fill.gold   { background: var(--gold); }
.progress-fill.red    { background: var(--red); }

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge-indigo { background: var(--indigo-bg); color: var(--indigo); }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-gold   { background: var(--gold-bg);   color: var(--gold); }
.badge-red    { background: var(--red-light);  color: var(--red); }
.badge-gray   { background: var(--gray-100);  color: var(--gray-500); }

.category-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: .4rem;
  vertical-align: middle;
}

/* ============================================
   TABS (for sections within modules)
   ============================================ */
.tab-nav {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.25rem;
}
.tab-btn {
  padding: .55rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.tab-btn:hover { color: var(--indigo); }
.tab-btn.active {
  color: var(--indigo);
  border-bottom-color: var(--indigo);
}

/* ============================================
   EMPTY / PLACEHOLDER STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.empty-state svg {
  width: 64px; height: 64px;
  color: var(--gray-300);
  margin: 0 auto 1rem;
}
.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: .4rem;
}
.empty-state p {
  color: var(--gray-400);
  font-size: .9rem;
  margin-bottom: 1.25rem;
}

/* ============================================
   CHARTS (simple bar chart built via CSS)
   ============================================ */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: .35rem;
  height: 160px;
  padding-bottom: 1.75rem;
  position: relative;
}
.chart-bar {
  flex: 1;
  background: var(--indigo);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: height .4s var(--ease), background .2s;
  min-width: 24px;
  cursor: pointer;
}
.chart-bar:hover { background: var(--indigo-light); }
.chart-bar-label {
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .68rem;
  color: var(--gray-500);
  white-space: nowrap;
}
.chart-bar-value {
  position: absolute;
  top: -1.3rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .7rem;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s;
}
.chart-bar:hover .chart-bar-value { opacity: 1; }

/* ============================================
   RESOURCE CARDS
   ============================================ */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.resource-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  padding: 1.25rem;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.resource-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.resource-card h4 {
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: .35rem;
}
.resource-card p {
  font-size: .83rem;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: .75rem;
}
.resource-card .badge { margin-right: .35rem; }

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

/* ============================================
   SECTION MODULE VIEW (in-content)
   ============================================ */
.module-section {
  display: none;
}
.module-section.active {
  display: block;
  animation: fadeIn .3s var(--ease);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FILTER / TOOLBAR
   ============================================ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.filter-select {
  padding: .45rem .75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: .83rem;
  color: var(--gray-600);
  cursor: pointer;
  outline: none;
}
.filter-select:focus { border-color: var(--indigo); }
.search-input {
  padding: .45rem .75rem .45rem 2rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ADB5BD' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat .6rem center;
  font-size: .83rem;
  outline: none;
  min-width: 180px;
}
.search-input:focus { border-color: var(--indigo); }

/* ============================================
   RESPONSIVE
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main-area { margin-left: 0; }
  .btn-menu-toggle { display: flex; }
  .auth-wrapper {
    flex-direction: column;
  }
  .auth-left {
    max-width: 100%;
    padding: 2rem 1.5rem 1rem;
  }
  .auth-left h1 { font-size: 1.6rem; }
  .auth-features { display: none; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .app-content { padding: 1rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .resource-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ---------- Admin Panel ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { text-align: left; padding: .6rem .75rem; background: var(--gray-50); color: var(--gray-600); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid var(--gray-200); }
.admin-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.admin-table tr:hover td { background: var(--indigo-bg); }
.admin-inline-input { width: 100%; padding: .3rem .5rem; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: .85rem; background: var(--white); transition: border-color .2s; }
.admin-inline-input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 2px rgba(27,77,142,.15); }
.btn-danger { background: var(--red); color: var(--white); border: none; cursor: pointer; padding: .35rem .75rem; border-radius: var(--radius-sm); font-size: .78rem; font-weight: 600; transition: background .2s; }
.btn-danger:hover { background: #c0392b; }
