/* ============================================================
   PERSEUS DESIGN SYSTEM — applied to Chiron / MyDoc
   ============================================================ */

/* ── Google Fonts ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── Custom Properties ──────────────────────────────────── */
:root {
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --line:    rgba(15, 23, 42, 0.1);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);

  --blue:          #0a84ff;
  --blue-bg:       rgba(10, 132, 255, 0.12);
  --blue-bg-strong:rgba(10, 132, 255, 0.18);

  /* legacy compat — keep chiron's --brand pointing at the same blue */
  --brand:      #0a84ff;
  --brand-dark: #0062c4;
}

/* ── Reset / Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  max-width: 100%;
  overflow-x: hidden !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: var(--ink-900);
  background:
    radial-gradient(1000px 460px at 8%  -8%,  rgba(10, 132, 255, 0.18), transparent 55%),
    radial-gradient(1000px 420px at 95% -6%,  rgba(71,  85, 105, 0.15), transparent 58%),
    #f4f7fb;
}

main { flex: 1 0 auto; }

/* ── Typography ─────────────────────────────────────────── */
.display-title {
  font-size: clamp(30px, 6.5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin: 12px 0 10px;
  font-weight: 650;
  color: #0b1220;
}

.lead {
  font-size: clamp(17px, 2.1vw, 21px);
  line-height: 1.5;
  color: var(--ink-700);
  max-width: 760px;
  margin-top: 0;
}

.section-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0a5cc4;
  background: rgba(224, 237, 255, 0.9);
  border: 1px solid rgba(10, 92, 196, 0.22);
  border-radius: 999px;
  padding: 6px 12px;
}

.muted { color: var(--ink-500); }

/* ── Surface / Card Components ──────────────────────────── */
.surface {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.11);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.surface-strong {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.09);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-pill {
  border-radius: 999px;
  text-transform: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0 18px;
  height: 42px;
  line-height: 40px;
}

/* Normalize UIKit text-transform */
.uk-button { text-transform: none; font-family: inherit; }
.uk-navbar-nav > li > a,
.uk-nav > li > a { text-transform: none !important; }

/* ── Navbar ─────────────────────────────────────────────── */
.p-navbar-desktop {
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  height: 52px;
  border-bottom: 1px solid var(--line);
}

.p-navbar-mobile {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  height: 62px;
}

.p-nav-link {
  color: var(--ink-900) !important;
  text-transform: none;
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none !important;
}

.p-nav-link:hover { color: var(--blue) !important; }
.p-nav-link.is-active { color: var(--blue) !important; font-weight: 500; }

/* Inner-app simplified nav */
.p-app-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.p-app-nav-logo img { height: 28px; display: block; }

.p-app-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-app-nav-links a {
  color: var(--ink-700);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: color 0.15s ease;
}

.p-app-nav-links a:hover { color: var(--blue); }

/* ── Apple-style mobile menu ─────────────────────────────── */
.apple-menu.uk-modal-full {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}
.apple-menu .uk-modal-dialog { background: transparent; }

.apple-menu .uk-modal-close-default {
  top: 18px;
  right: 18px;
  background: rgba(0, 0, 0, 0.06);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.apple-menu .uk-modal-close-default:hover { background: rgba(0, 0, 0, 0.10); }

.apple-menu-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 82px 20px 36px;
  animation: uk-animation-slide-top-small 0.25s ease-out both;
}

.apple-menu-logo {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 0 0 18px;
}

.apple-menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.apple-menu-link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  text-decoration: none !important;
  color: #111827;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}

.apple-menu-link:hover,
.apple-menu-link:focus,
.apple-menu-link:visited { text-decoration: none !important; }

.apple-menu-link:hover {
  background: var(--blue-bg);
  color: var(--blue);
}

.apple-menu-link:active {
  transform: scale(0.995);
  background: var(--blue-bg-strong);
  color: var(--blue);
}

.apple-menu-link.is-active {
  background: var(--blue-bg-strong);
  color: var(--blue);
}

/* ── Auth Pages (login / register) ──────────────────────── */
.auth-page {
  background:
    radial-gradient(1000px 460px at 8%  -8%,  rgba(10, 132, 255, 0.18), transparent 55%),
    radial-gradient(1000px 420px at 95% -6%,  rgba(71,  85, 105, 0.15), transparent 58%),
    #f4f7fb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.13);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 40px;
}

.auth-card-wide {
  max-width: 680px;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-logo img { height: 32px; }

.auth-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-900);
  margin: 0 0 6px;
  text-align: center;
}

.auth-subtitle {
  color: var(--ink-500);
  font-size: 15px;
  text-align: center;
  margin: 0 0 28px;
}

/* ── Form Elements ──────────────────────────────────────── */
.p-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 6px;
}

.p-input,
.p-select,
.p-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink-900);
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  display: block;
}

.p-input:focus,
.p-select:focus,
.p-textarea:focus {
  border-color: rgba(10, 132, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.10);
}

.p-select { appearance: auto; }

.p-textarea { resize: vertical; min-height: 100px; }

/* Override UIKit inputs to match PERSEUS style */
.uk-input,
.uk-select,
.uk-textarea {
  border-radius: 12px !important;
  border: 1px solid var(--line) !important;
  font-family: "DM Sans", inherit !important;
  font-size: 15px !important;
  color: var(--ink-900) !important;
  background: rgba(255, 255, 255, 0.85) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.uk-input:focus,
.uk-select:focus,
.uk-textarea:focus {
  border-color: rgba(10, 132, 255, 0.45) !important;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.10) !important;
}

.uk-input { height: 48px !important; }

/* ── Buttons (detailed) ─────────────────────────────────── */
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
  text-decoration: none !important;
  white-space: nowrap;
}

.p-btn:active { transform: scale(0.98); }

.p-btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35);
}
.p-btn-primary:hover { background: #0072e5; color: #fff; }

.p-btn-secondary {
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink-900);
}
.p-btn-secondary:hover { background: rgba(15, 23, 42, 0.10); color: var(--ink-900); }

.p-btn-ghost {
  background: transparent;
  color: var(--ink-700);
  border: 1px solid var(--line);
}
.p-btn-ghost:hover { background: rgba(15, 23, 42, 0.04); color: var(--ink-900); }

.p-btn-danger {
  background: #ef4444;
  color: #fff;
}
.p-btn-danger:hover { background: #dc2626; color: #fff; }

.p-btn-full { width: 100%; }

/* UIKit primary button override */
.uk-button-primary {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  border-radius: 12px !important;
  text-transform: none !important;
  font-family: "DM Sans", inherit !important;
  font-weight: 600 !important;
}
.uk-button-primary:hover {
  background: #0072e5 !important;
  border-color: #0072e5 !important;
}

/* ── Alert / Notice Boxes ───────────────────────────────── */
.p-alert {
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.p-alert-error {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.25);
  color: #b91c1c;
}

.p-alert-success {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.25);
  color: #15803d;
}

.p-alert-warning {
  background: rgba(234, 179, 8, 0.10);
  border-color: rgba(234, 179, 8, 0.30);
  color: #92400e;
}

.p-alert-info {
  background: var(--blue-bg);
  border-color: rgba(10, 132, 255, 0.20);
  color: #0a5cc4;
}

/* ── Status Badges ──────────────────────────────────────── */
.p-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.p-badge-scheduled  { background: rgba(234, 179, 8, 0.12); color: #92400e; }
.p-badge-confirmed  { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.p-badge-completed  { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.p-badge-cancelled  { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }

/* ── Cards ──────────────────────────────────────────────── */
.p-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
  padding: 24px;
}

.p-card-accent-blue  { border-left: 3px solid var(--blue); }
.p-card-accent-red   { border-left: 3px solid #ef4444; }
.p-card-accent-green { border-left: 3px solid #22c55e; }

/* ── Dividers ───────────────────────────────────────────── */
.p-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

/* ── Page Section ───────────────────────────────────────── */
.p-section {
  padding: 48px 0;
}

.p-section-sm {
  padding: 28px 0;
}

/* ── Footer ─────────────────────────────────────────────── */
.p-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  padding: 16px 24px;
}

.p-footer-dark {
  background: #09142f;
  color: rgba(255, 255, 255, 0.78);
  padding: 56px 0 32px;
}

.p-footer-dark a {
  color: rgba(255, 255, 255, 0.78) !important;
  text-decoration: none !important;
}

.p-footer-dark a:hover { color: #fff !important; }

.p-footer-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-500);
  padding: 14px 0 4px;
}

.p-footer-dark .p-footer-credit { color: rgba(255, 255, 255, 0.55); }

/* ── Utilities ──────────────────────────────────────────── */
.p-form-group { margin-bottom: 18px; }

.p-form-row {
  display: grid;
  gap: 14px;
}

.p-form-row-2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 600px) {
  .p-form-row-2 { grid-template-columns: 1fr; }
}

.p-flex        { display: flex; }
.p-flex-center { display: flex; align-items: center; }
.p-flex-between{ display: flex; align-items: center; justify-content: space-between; }
.p-gap-8   { gap: 8px; }
.p-gap-12  { gap: 12px; }
.p-gap-16  { gap: 16px; }
.p-gap-20  { gap: 20px; }
.p-mt-4  { margin-top: 4px;  }
.p-mt-8  { margin-top: 8px;  }
.p-mt-16 { margin-top: 16px; }
.p-mt-24 { margin-top: 24px; }
.p-mb-4  { margin-bottom: 4px;  }
.p-mb-8  { margin-bottom: 8px;  }
.p-mb-16 { margin-bottom: 16px; }
.p-mb-24 { margin-bottom: 24px; }
.p-text-center { text-align: center; }
.p-text-sm  { font-size: 13px; }
.p-text-xs  { font-size: 11px; }
.p-fw-600   { font-weight: 600; }
.p-fw-700   { font-weight: 700; }
.p-w-full   { width: 100%; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 959px) {
  .display-title { letter-spacing: -0.035em; }
  .auth-card { padding: 28px 20px; }
  .p-app-nav-links { display: none; }
}

@media (max-width: 420px) {
  .apple-menu-link { font-size: 24px; }
}

/* ── Dashboard / Sidebar Layout ─────────────────────────── */
body.dash-page {
  display: block;
  min-height: 100vh;
}

.dash-wrap {
  display: flex;
  gap: 20px;
  padding: 20px;
  min-height: 100vh;
  align-items: flex-start;
}

.dash-main {
  flex: 1;
  min-width: 0;
}

/* Mobile topbar (hamburger + logo) */
.dash-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 16px;
  padding: 10px 16px;
  margin-bottom: 18px;
  position: sticky;
  top: 12px;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dash-topbar img { height: 22px; display: block; }

.dash-topbar-toggle {
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-900);
  border-radius: 10px;
  transition: background .12s ease;
}
.dash-topbar-toggle:hover { background: rgba(15,23,42,.06); }

/* Hide sidebar, show topbar on mobile */
@media (max-width: 959px) {
  .csb { display: none !important; }
  .dash-topbar { display: flex !important; }
  .dash-wrap { padding: 12px; }
}

/* ── Stat cards ─────────────────────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.dash-stat {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.dash-stat-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 14px;
  background: var(--blue-bg);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}

.dash-stat-icon.green  { background: rgba(34, 197, 94, 0.12);  color: #16a34a; }
.dash-stat-icon.purple { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.dash-stat-icon.orange { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.dash-stat-icon.red    { background: rgba(239, 68, 68, 0.12);  color: #dc2626; }

.dash-stat-val {
  font-size: 28px; font-weight: 700;
  color: var(--ink-900); line-height: 1;
  margin-bottom: 3px;
}

.dash-stat-label {
  font-size: 12px; color: var(--ink-500);
}

/* ── Dashboard section panels ───────────────────────────── */
.dash-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.dash-card-head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  display: flex; align-items: center; justify-content: space-between;
}

.dash-card-head h2 {
  font-size: 15px; font-weight: 700;
  margin: 0; color: var(--ink-900);
  letter-spacing: -.02em;
}

.dash-card-body { padding: 20px; }

/* ── Dashboard table ────────────────────────────────────── */
.dash-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}

.dash-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-500);
  border-bottom: 1px solid rgba(15,23,42,.07);
  white-space: nowrap;
}

.dash-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15,23,42,.05);
  color: var(--ink-700);
  vertical-align: middle;
}

.dash-table tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover td { background: rgba(10,132,255,.03); }

/* Two-column grid for dashboard widgets */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 767px) {
  .dash-grid-2 { grid-template-columns: 1fr; }
  .dash-stats   { grid-template-columns: 1fr 1fr; }
}
