/* ============================================
   DCRB Digital — Base Styles
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans Devanagari', 'Inter', Arial, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
  min-height: 100vh;
  font-size: 14px;
}

/* ---------- Login ---------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b3d91, #1e40af);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}

.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: #0b3d91;
  text-align: center;
  letter-spacing: .5px;
}

.login-card .sub {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin: 6px 0 22px;
}

/* ---------- Form fields ---------- */
.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #0b3d91;
  box-shadow: 0 0 0 3px rgba(11,61,145,.1);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s;
}
.btn:hover { opacity: .9; }

.btn-primary { background: #0b3d91; color: #fff; }
.btn-success { background: #16a34a; color: #fff; }
.btn-danger  { background: #dc2626; color: #fff; }
.btn-grey    { background: #e5e7eb; color: #1f2937; }
.btn-sm      { padding: 5px 10px; font-size: 12px; }
.btn-block   { width: 100%; }

/* ---------- Alerts ---------- */
.alert-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------- App Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  background: #0b3d91;
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar h1 {
  font-size: 15px;
  font-weight: 700;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  line-height: 1.4;
}

.sidebar nav { flex: 1; padding: 8px 0; }

.sidebar nav a {
  display: block;
  padding: 11px 16px;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
}

.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }

.sidebar nav a.active {
  background: rgba(255,255,255,.14);
  color: #fff;
  border-left-color: #fff;
  font-weight: 600;
}

.user-box {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: 12px;
}
.user-box .name { font-weight: 600; margin-bottom: 2px; }
.user-box .meta { opacity: .75; font-size: 11px; margin-bottom: 8px; }

.main { flex: 1; padding: 20px; overflow-x: auto; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar h2 { font-size: 20px; color: #0b3d91; font-weight: 700; }

/* ---------- Panel ---------- */
.panel {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.panel h3 {
  font-size: 15px;
  color: #0b3d91;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 12px;
}

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead tr { background: #0b3d91; }
thead th {
  color: #fff;
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
}

tbody tr:hover { background: #f8faff; }

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  border-left: 4px solid #0b3d91;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.stat .label { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.stat .value { font-size: 24px; font-weight: 700; color: #0b3d91; }

.muted { color: #9ca3af; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar nav a.active { border-left: none; border-bottom-color: #fff; }
  .main { padding: 14px; }
}

/* ---------- Module Launcher ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.module-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: 4px solid #0b3d91;
  border-radius: 10px;
  padding: 18px 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.module-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  transform: translateY(-2px);
}
.module-icon { font-size: 30px; margin-bottom: 8px; }
.module-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.module-desc { font-size: 12px; color: #6b7280; line-height: 1.5; }
