:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #d9e0ea;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #b42318;
    --success: #027a48;
    --radius: 8px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }

.login-page, .public-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card, .public-card { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 18px 45px rgba(23,32,51,.08); }
.public-shell { width: 100%; max-width: 720px; display: grid; gap: 14px; }
.public-hero { text-align: center; }
.business-logo { width: 76px; height: 76px; object-fit: cover; border-radius: 50%; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; background: #101828; color: #fff; padding: 20px 14px; }
.brand { font-size: 20px; margin: 0 0 20px; }
.nav { display: grid; gap: 4px; }
.nav a, .public-link { display: block; padding: 10px 12px; border-radius: 6px; color: #d0d5dd; }
.nav a:hover, .nav a.is-active, .public-link:hover { background: #1d2939; color: #fff; }
.public-link { margin-top: 20px; border: 1px solid #344054; }
.main { flex: 1; min-width: 0; }
.topbar { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.content { padding: 24px; }

.page-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-title { margin: 0 0 4px; font-size: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-grid { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); align-items: start; }
.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.metric span { color: var(--muted); }
.metric strong { display: block; font-size: 28px; }
.metric-text { font-size: 20px !important; }

label { display: block; margin-bottom: 6px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 9px 11px; font: inherit; background: #fff; color: var(--text); }
textarea { min-height: 88px; resize: vertical; }
.form-row { margin-bottom: 13px; }
.stack-form { display: grid; gap: 10px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-row { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 8px 0 14px; }
.check-row input, .check-list input { width: auto; min-height: auto; }
.check-list { display: grid; gap: 8px; }
.access-box { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #f8fafc; }
.access-box input + input { margin-top: 8px; }
.day-box { padding: 10px 0; border-bottom: 1px solid var(--line); }
.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 0; border-radius: 6px; padding: 0 14px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.button:hover { background: var(--primary-dark); }
.button-light { background: #e7ecf3; color: var(--text); }
.button-light:hover { background: #d9e0ea; }
.button-danger { background: #fee4e2; color: #b42318; }
.button-danger:hover { background: #fecdca; }
.button-small { min-height: 32px; padding: 0 9px; font-size: 13px; }
.button-full { width: 100%; }
.inline-form { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }

.alert, .notice { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; }
.alert { background: #fef3f2; color: var(--danger); }
.notice-success { background: #ecfdf3; color: var(--success); }
.badge { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; background: #eef2f6; color: #475467; }
.badge-success, .status-confirmed, .status-completed { background: #dcfae6; color: #067647; }
.badge-muted, .status-canceled, .status-no_show { background: #f2f4f7; color: #475467; }
.status-scheduled { background: #dbeafe; color: #1d4ed8; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
th { font-size: 13px; color: var(--muted); }
.filter-bar { display: flex; gap: 10px; align-items: end; margin-bottom: 16px; }
.filter-bar label { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); font-weight: 700; }
.tabs a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.list-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.appointment-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.appointment-card p { margin: 4px 0 8px; }
.confirmation-actions { display: grid; gap: 10px; margin: 18px 0 8px; }
.menu-button { display: none; }

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { display: none; width: 100%; }
    .sidebar.is-open { display: block; }
    .menu-button { display: inline-flex; }
    .content, .topbar { padding-left: 16px; padding-right: 16px; }
    .grid-3, .admin-grid, .dashboard-grid { grid-template-columns: 1fr; }
    .filter-bar { display: grid; }
    .appointment-card { display: grid; }
    .page-header { display: block; }
    th, td { white-space: normal; }
}
