@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;700&display=swap');

:root {
  --sidebar-bg: #1e2a4a;
  --sidebar-hover: #2b3a63;
  --primary: #2563eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --muted: #6b7280;
  --card-border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

body {
  font-family: 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f6fb;
  margin: 0;
}

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

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.2rem 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand i {
  font-size: 1.8rem;
  color: #60a5fa;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
}

.nav-section {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0.9rem 0.6rem 0.3rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 2px;
  text-decoration: none;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 1.3rem;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem;
  font-size: 0.75rem;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e2a4a;
}

.topbar-user {
  display: flex;
  align-items: center;
}

.content {
  flex: 1;
  padding: 1.5rem;
}

.app-footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Badges ---------- */
.badge-status {
  padding: 0.35em 0.7em;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-paid { background: #dcfce7; color: var(--success); }
.badge-pending { background: #fef3c7; color: var(--warning); }
.badge-overdue { background: #fee2e2; color: var(--danger); }
.badge-active { background: #dcfce7; color: var(--success); }
.badge-vacant { background: #f3f4f6; color: var(--muted); }
.badge-open { background: #fee2e2; color: var(--danger); }
.badge-progress { background: #fef3c7; color: var(--warning); }
.badge-closed { background: #dcfce7; color: var(--success); }
.badge-info { background: #dbeafe; color: var(--primary); }

/* ---------- Table ---------- */
.table th {
  font-weight: 600;
  color: #4b5563;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.page-header h2 {
  margin: 0;
  font-weight: 700;
}

/* ---------- Auth ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e2a4a 0%, #2563eb 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .nav-section, .sidebar-footer { display: none; }
}