:root {
  --bg: #f0ebe3;
  --card: #fff;
  --primary: #1e5631;
  --primary-light: #2d5a27;
  --primary-dark: #164323;
  --sidebar: #164323;
  --sidebar-hover: #1e5631;
  --accent: #c9a227;
  --accent-soft: #e8d48b;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans Devanagari", "Noto Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
}

/* Top bar: brand + language only */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: relative;
  z-index: 10;
}

.site-header .brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.site-header .brand:hover {
  color: var(--accent-soft);
}

.lang-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#lang-toggle {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

#lang-toggle:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
}

/* App layout: sidebar + main */
.app-wrap {
  display: flex;
  min-height: calc(100vh - 52px);
}

/* Login/landing: no sidebar, content centered */
.app-wrap--no-sidebar .main-content {
  width: 100%;
}
.main-content--centered {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 2rem;
}
.main-content--centered .container {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 420px;
}

/* Narrow card for send-request form only, centered */
.card--narrow {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* Sidebar - same on admin and user panel */
.app-wrap .sidebar {
  width: 240px;
  min-width: 240px;
  flex-shrink: 0;
  background: var(--sidebar);
  padding: 1.25rem 0;
  box-shadow: 2px 0 12px rgba(0,0,0,0.08);
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Sidebar links: always white/light, never inherit from .card a or body */
.app-wrap .sidebar .sidebar-nav a,
.sidebar .sidebar-nav a {
  display: block;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.9) !important;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff !important;
  border-left-color: var(--accent);
}

.sidebar-nav a.active {
  background: var(--sidebar-hover);
  color: var(--accent-soft) !important;
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-nav li.divider {
  height: 1px;
  padding: 0;
  margin: 0.5rem 1rem;
  background: rgba(255,255,255,0.15);
  list-style: none;
}

.sidebar-nav .logout-link {
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 0.5rem;
}

.sidebar-nav .logout-link a {
  color: var(--accent-soft) !important;
  font-weight: 600;
}

.sidebar-nav .logout-link a:hover {
  background: rgba(180,0,0,0.25);
  color: #fff !important;
  border-left-color: #c53030;
}

/* Main content */
.main-content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-x: auto;
}

.container {
  max-width: 560px;
  margin: 0;
  padding: 0;
}

.container--wide {
  max-width: none;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.card:last-child {
  margin-bottom: 0;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 86, 49, 0.15);
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 2px 4px rgba(30, 86, 49, 0.25);
  transition: transform 0.1s, box-shadow 0.2s;
}

.btn:hover {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 4px 8px rgba(30, 86, 49, 0.3);
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--text-muted);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-secondary:hover {
  background: #4b5563;
}

.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--primary);
  background: rgba(30, 86, 49, 0.06);
  font-size: 0.9rem;
  text-transform: none;
}

tbody tr:hover {
  background: rgba(30, 86, 49, 0.03);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.badge-accepted {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.badge-rejected {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Admin action buttons */
.actions {
  white-space: nowrap;
}

.action-form {
  display: inline-block;
  margin: 0 0.25rem 0 0;
}

.action-form:last-child {
  margin-right: 0;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  width: auto;
}

.btn-accept {
  background: #059669;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

.btn-accept:hover {
  background: #047857;
}

.btn-reject {
  background: #dc2626;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

.btn-reject:hover {
  background: #b91c1c;
}

.nav-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.nav-links a {
  color: var(--primary);
  font-weight: 600;
}

/* Inline link in card (e.g. Admin Login on landing) */
.card a:not(.btn) {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.card a:not(.btn):hover {
  text-decoration: underline;
}

/* Force sidebar look on both admin and user panel (override cache/other styles) */
body .app-wrap aside.sidebar {
  width: 240px !important;
  min-width: 240px !important;
  flex-shrink: 0 !important;
  background: #164323 !important;
  padding: 1.25rem 0 !important;
  box-shadow: 2px 0 12px rgba(0,0,0,0.08) !important;
}
body .app-wrap aside.sidebar nav ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
body .app-wrap aside.sidebar a {
  display: block !important;
  padding: 0.65rem 1.25rem !important;
  color: rgba(255,255,255,0.9) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  font-size: 0.95rem !important;
  border-left: 3px solid transparent !important;
}
body .app-wrap aside.sidebar a:hover {
  background: #1e5631 !important;
  color: #fff !important;
  border-left-color: #c9a227 !important;
}
body .app-wrap aside.sidebar a.active {
  background: #1e5631 !important;
  color: #e8d48b !important;
  border-left-color: #c9a227 !important;
  font-weight: 600 !important;
}
body .app-wrap aside.sidebar .logout-link a {
  color: #e8d48b !important;
  font-weight: 600 !important;
}
body .app-wrap aside.sidebar .logout-link a:hover {
  background: rgba(180,0,0,0.25) !important;
  color: #fff !important;
  border-left-color: #c53030 !important;
}
body .app-wrap aside.sidebar li.divider {
  height: 1px !important;
  padding: 0 !important;
  margin: 0.5rem 1rem !important;
  background: rgba(255,255,255,0.15) !important;
  list-style: none !important;
}

@media (min-width: 600px) {
  .main-content {
    padding: 2rem 2.5rem;
  }
}

@media (max-width: 768px) {
  .app-wrap {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    padding: 0.75rem 0;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0 0.75rem;
  }

  .sidebar-nav a {
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .sidebar-nav a.active {
    border-bottom-color: var(--accent);
  }

  .sidebar-nav .divider {
    display: none;
  }

  .sidebar-nav .logout-link {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-left: auto;
  }

  .main-content {
    padding: 1.25rem 1rem;
  }
}
