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

:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #7c3aed;
  --primary2: #6d28d9;
  --input: #f9fafb;
  --sidebar-bg: #11121f;
  --sidebar-card: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body.dark {
  --bg: #0b0d17;
  --card: #151828;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --border: #262b40;
  --primary: #a78bfa;
  --primary2: #8b5cf6;
  --input: #1c2033;
  --sidebar-bg: #080912;
  --sidebar-card: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.45);
}

* {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Modern Login Screen */
.login-wrap {
  background:
    radial-gradient(640px 420px at 15% 15%, rgba(124, 58, 237, 0.16), transparent 60%),
    radial-gradient(540px 400px at 85% 85%, rgba(236, 72, 153, 0.12), transparent 60%),
    var(--bg);
}

.login-card {
  max-width: 430px !important;
  border: 1px solid var(--border) !important;
  border-radius: 22px !important;
  padding: 36px 32px !important;
  box-shadow: var(--shadow-md) !important;
  position: relative;
}

.admin-login-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
  border: 1px solid rgba(124, 58, 237, 0.25);
  margin: 0 auto 14px;
}

.pass-wrap {
  position: relative;
}

.pass-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  border: none !important;
  color: var(--muted) !important;
  padding: 4px 8px !important;
  font-size: 16px !important;
  cursor: pointer;
}

/* Modern Dark SaaS Sidebar */
.sidebar {
  width: 266px !important;
  background: linear-gradient(180deg, #131126 0%, #0d0e1a 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 16px !important;
  font-size: 16.5px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09) !important;
}

.sidebar-search-wrap {
  padding: 12px 12px 6px;
}

.sidebar-search {
  width: 100% !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  color: #f9fafb !important;
  font-size: 12.5px !important;
  font-weight: 600;
}

.sidebar-search::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.side-group-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(196, 181, 253, 0.65);
  padding: 12px 12px 6px;
}

.side-tab {
  padding: 9.5px 12px !important;
  border-radius: 10px !important;
  font-size: 13.2px !important;
  font-weight: 600 !important;
  color: rgba(243, 244, 246, 0.8) !important;
  margin-bottom: 3px !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease !important;
}

.side-tab:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #ffffff !important;
}

.side-tab.active {
  background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35) !important;
}

.sidebar-footer {
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.09) !important;
}

/* Sticky Glass Topbar */
.topbar {
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm) !important;
  padding: calc(11px + env(safe-area-inset-top, 0px)) 22px 11px !important;
}

body.dark .topbar {
  background: rgba(21, 24, 40, 0.88) !important;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-pill-btn {
  background: var(--input) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  padding: 7px 12px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.top-pill-btn:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.top-pill-btn.primary {
  background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

/* Spacious Web Workspace */
.container {
  max-width: 1320px !important;
  padding: 20px 24px 110px !important;
}

.card {
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 24px !important;
}

select, input, textarea {
  border-radius: 10px !important;
  border-width: 1.5px !important;
  padding: 11px 13px !important;
  font-size: 14px !important;
}

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

/* Modern Overview KPI Cards & Quick Launchpad */
.overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)) !important;
  gap: 14px !important;
}

.overview-box {
  background: var(--input) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  padding: 18px 16px !important;
  text-align: left !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.overview-box:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.4);
}

.overview-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #ec4899);
}

.overview-num {
  font-size: 27px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

.overview-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  margin-top: 4px !important;
}

.quick-launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.ql-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px !important;
  border-radius: 14px !important;
  background: var(--input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  text-align: left;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.ql-btn small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.ql-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary) !important;
  opacity: 1 !important;
}

/* Google Drive PYQ Vault Grid inside Admin */
.drive-vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.drive-vault-item {
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.drive-vault-item b {
  font-size: 13.5px;
  color: var(--text);
}

.drive-vault-item small {
  font-size: 11.5px;
  color: var(--muted);
  display: block;
}

/* Command Palette Modal */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(10, 12, 24, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 20px;
}

.cmd-overlay.hidden {
  display: none !important;
}

.cmd-box {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.cmd-input {
  width: 100% !important;
  margin: 0 !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  padding: 15px 18px !important;
  font-size: 15px !important;
  background: var(--card) !important;
}

.cmd-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-item {
  width: 100%;
  text-align: left;
  background: transparent !important;
  color: var(--text) !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cmd-item:hover {
  background: rgba(124, 58, 237, 0.12) !important;
  color: var(--primary) !important;
  opacity: 1 !important;
}

@media (max-width: 820px) {
  .sidebar { left: -276px !important; }
  .sidebar.open { left: 0 !important; }
  .container { padding: 12px 12px 130px !important; }
  .hide-sm { display: none !important; }
}
