:root {
  --ink: #0b211e;
  --green: #143a35;
  --green-2: #26564e;
  --paper: #f1eee7;
  --white: #fffdf9;
  --gold: #c3a36f;
  --line: rgba(11, 33, 30, 0.14);
  --muted: #71807b;
  --danger: #a8453c;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: #2d403c; background: var(--paper); font-family: var(--sans); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--white);
}

.login-brand {
  position: relative;
  padding: clamp(50px, 8vw, 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 18%, rgba(195, 163, 111, 0.22), transparent 30%),
    linear-gradient(120deg, #071916, #153c36);
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -180px;
  bottom: -260px;
  width: 600px;
  height: 600px;
  border: 1px solid rgba(195, 163, 111, 0.25);
  border-radius: 50%;
}

.admin-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  font-family: var(--serif);
  font-size: 2.5rem;
}

.login-brand > p { margin: 22px 0 50px; color: var(--gold); font-size: .75rem; font-weight: 700; letter-spacing: .25em; }
.login-brand h1 { max-width: 650px; margin: 0 0 22px; font-family: var(--serif); font-size: clamp(3.3rem, 6vw, 6.2rem); font-weight: 500; letter-spacing: -.045em; line-height: .94; }
.login-brand small { max-width: 430px; color: rgba(255,255,255,.62); font-size: .82rem; line-height: 1.8; }

.login-card { width: min(460px, calc(100% - 48px)); margin: auto; padding: 40px 0; }
.kicker { margin: 0 0 14px; color: var(--gold); font-size: .68rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.login-card h2 { margin: 0 0 35px; color: var(--ink); font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 500; }
.login-card form, .settings-card, .security-card { display: grid; gap: 18px; }
label { display: grid; gap: 8px; }
label > span { color: #42544f; font-size: .68rem; font-weight: 700; }
input, select, textarea { width: 100%; padding: 13px 14px; color: var(--ink); background: #f8f5ef; border: 1px solid var(--line); border-radius: 0; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(195,163,111,.13); }
form button, .settings-card button, .security-card button { min-height: 52px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; color: var(--white); background: var(--green); border: 0; font-size: .78rem; font-weight: 700; }
form button:hover { background: var(--ink); }
form button:disabled { opacity: .58; cursor: wait; }
form button i { font-family: var(--serif); font-size: 1.2rem; font-style: normal; }
.form-message, .panel-message { min-height: 20px; margin: 0; color: var(--danger); font-size: .7rem; font-weight: 700; line-height: 1.5; }
.form-message.success, .panel-message.success { color: #277059; }
.back-link { margin-top: 25px; display: inline-block; color: #64736e; font-size: .7rem; text-underline-offset: 4px; }

.admin-app { min-height: 100vh; display: grid; grid-template-columns: 255px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 255px; padding: 35px 24px 28px; display: flex; flex-direction: column; z-index: 30; color: var(--white); background: var(--ink); }
.admin-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.admin-brand > span { width: 43px; height: 43px; display: grid; place-items: center; color: var(--ink); background: var(--gold); font-family: var(--serif); font-size: 1.6rem; }
.admin-brand div { display: grid; }
.admin-brand strong { font-family: var(--serif); font-size: 1.2rem; letter-spacing: .14em; }
.admin-brand small { color: rgba(255,255,255,.48); font-size: .52rem; letter-spacing: .15em; }
.sidebar nav { margin-top: 75px; display: grid; gap: 6px; }
.nav-item { min-height: 48px; padding: 0 12px; display: flex; align-items: center; gap: 14px; color: rgba(255,255,255,.56); background: transparent; border: 0; text-align: left; font-size: .75rem; }
.nav-item span { color: var(--gold); font-family: var(--serif); }
.nav-item:hover, .nav-item.active { color: var(--white); background: rgba(255,255,255,.07); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 9px; }
.sidebar-bottom a, .sidebar-bottom button { padding: 10px 12px; color: rgba(255,255,255,.62); background: transparent; border: 0; font-size: .68rem; text-align: left; text-decoration: none; }
.sidebar-bottom a:hover, .sidebar-bottom button:hover { color: var(--white); }

.admin-main { grid-column: 2; min-width: 0; }
.admin-header { height: 86px; padding: 0 clamp(24px, 4vw, 60px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255,253,249,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.admin-header > div { display: grid; gap: 3px; }
.admin-header small { color: var(--muted); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }
.admin-header strong { color: var(--ink); font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
.admin-user { padding: 9px 13px; color: var(--green); background: #e4e9e4; font-size: .66rem; font-weight: 700; }
.mobile-sidebar-toggle { display: none; }
.password-warning { margin: 22px clamp(24px, 4vw, 60px) 0; padding: 13px 16px; color: #684c23; background: #eee0c4; border-left: 2px solid var(--gold); font-size: .7rem; }
.password-warning button { margin-left: 10px; padding: 0; color: var(--ink); background: none; border: 0; font-weight: 700; text-decoration: underline; }

.admin-panel { padding: 48px clamp(24px, 4vw, 60px) 70px; }
.panel-heading { margin-bottom: 35px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.panel-heading h1 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(2.8rem, 5vw, 4.6rem); font-weight: 500; letter-spacing: -.035em; }
.refresh-button { padding: 10px 14px; color: var(--green); background: transparent; border: 1px solid var(--line); font-size: .68rem; font-weight: 700; }
.refresh-button:hover { background: var(--white); }

.stat-grid { margin-bottom: 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-grid article { padding: 20px; background: var(--white); border-top: 2px solid var(--gold); }
.stat-grid span { display: block; color: var(--muted); font-size: .62rem; font-weight: 700; text-transform: uppercase; }
.stat-grid strong { display: block; margin-top: 12px; color: var(--ink); font-family: var(--serif); font-size: 2.3rem; font-weight: 500; }
.toolbar { margin-bottom: 16px; display: grid; grid-template-columns: 1fr 190px; gap: 12px; }
.search-box { position: relative; display: block; }
.search-box > span { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); color: var(--gold); }
.search-box input { padding-left: 42px; }

.appointment-list { display: grid; gap: 12px; }
.appointment-card { padding: 22px; display: grid; grid-template-columns: minmax(175px, .9fr) minmax(190px, 1fr) minmax(160px, .8fr) minmax(210px, 1.1fr); gap: 22px; align-items: start; background: var(--white); border-left: 3px solid var(--gold); box-shadow: 0 8px 30px rgba(11,33,30,.055); }
.appointment-card.status-confirmed { border-left-color: #3d7f6c; }
.appointment-card.status-completed { border-left-color: #7e9189; }
.appointment-card.status-cancelled { border-left-color: var(--danger); opacity: .72; }
.appointment-person strong { display: block; margin-bottom: 6px; color: var(--ink); font-family: var(--serif); font-size: 1.25rem; }
.appointment-person small, .appointment-contact a, .appointment-case p, .appointment-case small { display: block; margin-bottom: 5px; color: var(--muted); font-size: .66rem; line-height: 1.5; text-decoration: none; }
.appointment-contact a:hover { color: var(--green); text-decoration: underline; }
.appointment-date { margin-bottom: 9px; color: var(--ink); font-size: .76rem; font-weight: 700; }
.appointment-case strong { display: block; margin-bottom: 7px; color: var(--green); font-size: .68rem; }
.appointment-controls { display: grid; gap: 8px; }
.appointment-controls select, .appointment-controls textarea { padding: 9px 10px; font-size: .66rem; }
.appointment-controls textarea { min-height: 62px; resize: vertical; }
.control-actions { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.save-appointment, .delete-appointment { min-height: 34px; border: 0; font-size: .62rem; font-weight: 700; }
.save-appointment { color: var(--white); background: var(--green); }
.delete-appointment { width: 38px; color: var(--danger); background: #f3e8e4; }
.empty-state { padding: 65px 30px; text-align: center; background: var(--white); }
.empty-state strong { color: var(--ink); font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.empty-state p { color: var(--muted); font-size: .72rem; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) .8fr; gap: 28px; }
.settings-card, .security-card { position: relative; padding: clamp(28px, 4vw, 44px); background: var(--white); box-shadow: 0 15px 45px rgba(11,33,30,.07); }
.card-number { position: absolute; top: 22px; right: 25px; color: var(--gold); font-family: var(--serif); }
.settings-card h2, .security-card h2, .settings-info h2 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.settings-card > p, .security-card > p { margin: -5px 0 10px; color: var(--muted); font-size: .72rem; line-height: 1.7; }
.setting-preview { padding: 17px; color: var(--white); background: var(--green); }
.setting-preview small { display: block; margin-bottom: 5px; color: var(--gold); font-size: .58rem; text-transform: uppercase; }
.setting-preview strong { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; }
.settings-info { padding: clamp(30px, 5vw, 55px); color: var(--white); background: var(--green); }
.settings-info h2 { color: var(--white); }
.settings-info ol { margin: 38px 0 0; padding: 0; display: grid; gap: 24px; list-style: none; }
.settings-info li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; color: rgba(255,255,255,.68); font-size: .7rem; line-height: 1.6; }
.settings-info li span { width: 30px; height: 30px; display: grid; place-items: center; color: var(--gold); border: 1px solid rgba(195,163,111,.5); font-family: var(--serif); }
.security-card { max-width: 650px; }

@media (max-width: 1120px) {
  .appointment-card { grid-template-columns: 1fr 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 42vh; padding: 45px 28px; }
  .login-brand > p { margin-bottom: 28px; }
  .login-brand h1 { font-size: 3.25rem; }
  .admin-app { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform 220ms ease; }
  .sidebar.open { transform: translateX(0); }
  .admin-main { grid-column: 1; }
  .admin-header { height: 74px; padding: 0 18px; }
  .mobile-sidebar-toggle { display: block; width: 38px; height: 38px; color: var(--ink); background: transparent; border: 1px solid var(--line); }
  .admin-user { display: none; }
  .password-warning { margin-inline: 16px; }
  .admin-panel { padding: 38px 16px 60px; }
  .panel-heading h1 { font-size: 3rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .appointment-card { grid-template-columns: 1fr; gap: 16px; }
  .appointment-controls { padding-top: 14px; border-top: 1px solid var(--line); }
}

/* Expanded site settings */
.settings-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.settings-fields label { margin:0; }
.settings-field-wide { grid-column:1/-1; }
.settings-fields textarea { width:100%; resize:vertical; border:1px solid var(--line); background:#f8f5ee; padding:14px 16px; color:var(--ink); font:inherit; }
@media (max-width:720px) { .settings-fields { grid-template-columns:1fr; } .settings-field-wide { grid-column:auto; } }

.settings-section-title { grid-column:1/-1; margin:12px 0 0; padding-top:22px; border-top:1px solid var(--line); font-family:var(--font-display); font-size:1.65rem; font-weight:500; }
