:root {
  --cyan: #00abb6;
  --cyan-strong: #0094a0;
  --cyan-soft: #e6f7f8;
  --cyan-mid: #b8e8eb;
  --navy: #1a3054;
  --ink: #243247;
  --muted: #6b7c93;
  --line: #dce5ee;
  --bg: #f3f7f9;
  --white: #ffffff;
  --gold: #f0c430;
  --rose: #e8a0a8;
  --ok: #1f9d6e;
  --warn: #c98516;
  --danger: #c94545;
  --info: #2f7ec8;
  --shadow: 0 10px 30px rgba(26, 48, 84, 0.08);
  --radius: 18px;
  --sidebar: 220px;
  --font-display: "Anek Kannada", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(0,171,182,.12), transparent 35%),
    radial-gradient(circle at 100% 0%, rgba(240,196,48,.12), transparent 30%),
    linear-gradient(180deg, #eef6f8 0%, var(--bg) 40%, #edf3f6 100%);
  min-height: 100vh;
}

a { color: var(--cyan-strong); text-decoration: none; }
img { max-width: 100%; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 40;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
.sidebar-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
  letter-spacing: .02em;
}
.sidebar-brand span {
  color: var(--muted);
  font-size: .75rem;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { border-radius: 10px; }
.nav-group.open .nav-children { display: block; }
.nav-group.open .nav-chevron { transform: rotate(90deg); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--navy);
  font-weight: 600;
  font-size: .88rem;
  transition: .2s ease;
  position: relative;
}
.nav-item:hover { background: var(--cyan-soft); color: var(--cyan-strong); }
.nav-item.active,
.nav-item.active-parent {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-strong));
  color: #fff;
  box-shadow: 0 6px 14px rgba(0,171,182,.22);
}
.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255,255,255,.35);
  font-size: .82rem;
  flex-shrink: 0;
}
.nav-chevron {
  margin-left: auto;
  font-size: 1rem;
  opacity: .7;
  transition: transform .2s ease;
}
.nav-children {
  display: none;
  padding: 2px 0 4px 34px;
}
.nav-group.open .nav-children {
  display: block;
}
.nav-child {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.nav-child:hover { background: var(--cyan-soft); color: var(--cyan-strong); }
.nav-child.active { color: var(--cyan-strong); background: var(--cyan-soft); }

.sidebar-cta { margin-top: 2px; font-size: .82rem; padding: 8px 10px; }
.sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: .85rem;
  color: var(--muted);
}
.sidebar-foot p {
  font-family: var(--font-display);
  color: var(--navy);
  font-style: italic;
  margin: 0 0 6px;
}

.main {
  margin-left: var(--sidebar);
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px 8px;
}
.topbar-title { flex: 1; }
.topbar-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--navy);
  line-height: 1.1;
}
.topbar-title span { color: var(--muted); font-size: .9rem; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cyan);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: .9rem; color: var(--navy); }
.user-meta .user-role { font-size: .7rem; color: var(--muted); font-weight: 600; }
.user-meta a { font-size: .75rem; color: var(--muted); }

.burger {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
}
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,48,84,.35);
  z-index: 30;
}
.overlay.show { display: block; }

.content { padding: 10px 24px 36px; }

.hero-compact,
.hero {
  background:
    linear-gradient(120deg, rgba(0,171,182,.16), rgba(255,255,255,.9) 45%, rgba(240,196,48,.12)),
    #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.hero-compact {
  padding: 20px 24px;
  margin-bottom: 18px;
}
.hero-compact h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  color: var(--navy);
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 1.2rem;
}
.panel-body { padding: 16px 18px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar .grow { flex: 1; min-width: 180px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  font-family: inherit;
  transition: .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--cyan); color: #fff; }
.btn-primary:hover { background: var(--cyan-strong); }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--navy); }
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan-strong); }
.btn-accent { background: var(--gold); color: #3a2d00; }
.btn-danger { background: #fdeeee; color: var(--danger); border-color: #f3c8c8; }
.btn-sm { padding: 7px 10px; font-size: .8rem; border-radius: 10px; }
.btn-block { width: 100%; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid rgba(0,171,182,.25);
  border-color: var(--cyan);
}

.table-wrap { overflow-x: auto; overflow-y: visible; }
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data td.actions-cell {
  width: 1%;
  white-space: nowrap;
  overflow: visible;
}
table.data tbody tr:has(.action-dropdown.is-open) {
  position: relative;
  z-index: 40;
}
table.data th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--cyan-strong);
  background: var(--cyan-soft);
}
table.data tr:hover td { background: #fafcfd; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.action-dropdown {
  position: relative;
  display: inline-block;
}
.action-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  transition: .15s ease;
}
.action-dropdown-toggle:hover,
.action-dropdown.is-open .action-dropdown-toggle {
  border-color: var(--cyan);
  background: var(--cyan-soft);
  color: var(--cyan-strong);
}
.action-dropdown-dots {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}
.action-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 168px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(26, 48, 84, 0.2);
  padding: 6px;
  z-index: 9999;
}
.action-dropdown-menu.is-fixed {
  position: fixed;
  top: auto;
  right: auto;
}
.action-dropdown.is-open.drop-up .action-dropdown-menu:not(.is-fixed) {
  top: auto;
  bottom: calc(100% + 4px);
}
.action-dropdown-item,
.action-dropdown-form button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.action-dropdown-item:hover,
.action-dropdown-form button:hover {
  background: var(--cyan-soft);
  color: var(--cyan-strong);
}
.action-dropdown-item.is-danger,
.action-dropdown-form button.is-danger { color: var(--danger); }
.action-dropdown-item.is-danger:hover,
.action-dropdown-form button.is-danger:hover {
  background: #fdeeee;
  color: var(--danger);
}
.action-dropdown-item.is-accent,
.action-dropdown-form button.is-accent { color: #9a7400; }
.action-dropdown-form { margin: 0; padding: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: capitalize;
}
.badge-ok { background: #e7f8f0; color: var(--ok); }
.badge-warn { background: #fff4df; color: var(--warn); }
.badge-danger { background: #fdeeee; color: var(--danger); }
.badge-info { background: #eaf3fc; color: var(--info); }
.badge-accent { background: #fff6d8; color: #9a7400; }
.badge-muted { background: #eef1f5; color: var(--muted); }

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-weight: 600;
}
.alert-success { background: #e7f8f0; color: var(--ok); }
.alert-error { background: #fdeeee; color: var(--danger); }
.alert-info { background: #eaf3fc; color: var(--info); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--navy);
  font-size: .88rem;
}
.help { color: var(--muted); font-size: .8rem; margin-top: 4px; }

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.list-cards { display: none; gap: 12px; }
.card-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}
.card-item h4 { margin: 0 0 6px; color: var(--navy); font-family: var(--font-display); }
.card-meta { color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.thumb {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--cyan-soft);
}

.config-box {
  background: #fff;
  border: 1px dashed var(--cyan);
  border-radius: 16px;
  padding: 18px;
}
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #0f2238;
  color: #d7f6f8;
  border-radius: 12px;
  padding: 14px;
  overflow: auto;
  font-size: .85rem;
  line-height: 1.5;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,171,182,.18), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(240,196,48,.2), transparent 35%),
    linear-gradient(160deg, #eaf6f8, #f7fafc 50%, #eef3f7);
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}
.login-card img { width: 96px; margin-bottom: 10px; }
.login-card h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  color: var(--navy);
}
.login-card p { color: var(--muted); margin: 0 0 18px; }
.login-card .field { text-align: left; margin-bottom: 12px; }
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.detail-item {
  background: var(--cyan-soft);
  border-radius: 14px;
  padding: 12px;
}
.detail-item span { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 4px; }
.detail-item strong { color: var(--navy); word-break: break-word; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-105%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 720px) {
  .user-meta { display: none; }
  table.data { display: none; }
  .list-cards { display: grid; }
  .panel-head { align-items: stretch; }
  .toolbar { flex-direction: column; align-items: stretch; }
}
