/* Clean, Google-like admin UI */
:root {
  --bg: #f6f8fa;
  --text: #202124;
  --muted: #5f6368;
  --primary: #1a73e8;
  --surface: #ffffff;
  --border: #e0e3e7;
  --success: #0f9d58;
  --error: #d93025;
}

/* Enhance dropdown animation globally */
.menu-open .dropdown { opacity: 1; transform: translateY(0); }

/* Segmented control for toggles */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.segmented .seg { padding: 8px 12px; cursor: pointer; color: var(--text); }
.segmented .seg + .seg { border-inline-start: 1px solid var(--border); }
.segmented .seg.active { background: var(--primary); color: #fff; }

/* Badges and plan visuals */
.badge { display: inline-block; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); }
.badge.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.plan-card h3 { display: flex; align-items: center; justify-content: space-between; }
.plan-card .value { font-size: 22px; margin: 4px 0; }
.plan-card ul { margin: 8px 0 0; padding-inline-start: 18px; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Roboto, system-ui, -apple-system, Segoe UI, Tahoma; color: var(--text); background: var(--bg); }

.app { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 56px 1fr; grid-template-areas: "appbar appbar" "sidebar content"; height: 100%; }
.app--landing { grid-template-columns: 1fr; grid-template-areas: "appbar" "content"; }
.app-bar { grid-area: appbar; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.app-bar .title { font-weight: 500; color: var(--text); }
.app-bar .spacer { flex: 1; }
.app-bar a { color: var(--primary); text-decoration: none; font-weight: 500; }

.sidebar { grid-area: sidebar; padding: 16px; border-right: 1px solid var(--border); background: var(--surface); }
.sidebar .brand { font-weight: 700; margin-bottom: 12px; }
.nav { display: grid; gap: 6px; }
.nav a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.nav a:hover { background: #f1f3f4; border-color: var(--border); }

.content { grid-area: content; padding: 24px; overflow: auto; }
.container { max-width: 1120px; margin-inline: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.card h3 { margin: 0 0 8px; font-weight: 600; }
.card .value { font-size: 20px; font-weight: 700; }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.btn { display: inline-block; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer; transition: filter .2s ease, transform .06s ease; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.error { background: var(--error); border-color: var(--error); color: #fff; }
.btn:hover { filter: brightness(0.98); }
.btn:active { transform: translateY(1px); }

.field { display: grid; gap: 6px; margin-bottom: 10px; }
.field label { color: var(--muted); font-size: 13px; }
.input, .select, .textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); }
.textarea { min-height: 90px; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: start; }
.table th { background: #f8f9fa; font-weight: 600; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }

.alert { padding: 10px 12px; border-radius: 8px; }
.alert.error { background: #fce8e6; color: var(--error); }
.alert.success { background: #e6f4ea; color: var(--success); }

/* Landing hero */
.hero { background: linear-gradient(135deg, #f1f3f4, #e8f0fe); padding: 24px; border: 1px solid var(--border); border-radius: 12px; }
.hero h1 { margin: 0 0 8px; }
.muted { color: var(--muted); }

/* Mobile responsiveness */
.menu-btn { display: none !important; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 8px 10px; }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 90; }
/* Top dropdown menu for mobile */
.dropdown { display: none; }

@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; grid-template-areas: "appbar" "content"; }
  .sidebar { display: none; }
  .content { padding: 16px; }
  .container { max-width: 100%; padding-inline: 8px; }
  .toolbar { flex-wrap: wrap; }
  .card { padding: 12px; }
  .btn { padding: 10px 12px; }
  .nav a { padding: 12px 14px; }
  .app-bar .title { font-size: 16px; }
  .app-bar a { font-size: 14px; }
  .menu-btn { display: inline-block !important; }
  .table { display: block; overflow-x: auto; }
  .table thead, .table tbody, .table tr { display: table; width: 100%; }
  .table th, .table td { white-space: nowrap; }
  /* Dropdown panel below app-bar */
  .dropdown { position: fixed; top: 56px; right: 0; left: 0; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.15); z-index: 100; opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease; }
  .dropdown .nav { display: grid; gap: 0; }
  .dropdown .nav a { border-radius: 0; border-bottom: 1px solid var(--border); }
  .menu-open .dropdown { display: block !important; opacity: 1; transform: translateY(0); }
  .menu-open .backdrop { display: block; }
}