:root {
  --bg: #f4f6f8;
  --surface: #fff;
  --text: #132034;
  --muted: #66758a;
  --border: #e3e8ef;
  --accent: #f4567b;
  --accent-dark: #db365d;
  --shadow: 0 16px 40px rgba(15, 32, 52, .08);
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
body.workspace-video { --accent: #6b46c1; --accent-dark: #5534a8; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
aside {
  position: sticky; top: 0; height: 100vh; padding: 24px 18px;
  display: flex; flex-direction: column; background: white; border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.brand > span {
  width: 48px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  color: white; background: linear-gradient(135deg, var(--accent), #ff936d); font-size: 11px; font-weight: 900;
}
.workspace-video .brand > span { background: linear-gradient(135deg, #6b46c1, #9d7af2); }
.brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
aside nav { display: grid; gap: 5px; margin-top: 36px; }
aside nav a { padding: 11px 13px; border-radius: 10px; color: #4d5d72; font-weight: 650; }
aside nav a:hover { color: var(--accent-dark); background: color-mix(in srgb, var(--accent) 10%, white); }
.account { margin-top: auto; display: grid; gap: 6px; padding: 14px 12px 0; border-top: 1px solid var(--border); font-size: 13px; }
.link { padding: 0; color: var(--muted); background: none; border: 0; cursor: pointer; }
.shell > main { min-width: 0; }
header {
  position: sticky; z-index: 5; top: 0; height: 72px; padding: 0 36px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.92); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px);
}
header small, .heading small { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.switcher { display: flex; gap: 4px; padding: 4px; background: #edf1f5; border-radius: 12px; }
.switcher a { padding: 8px 15px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 800; }
.switcher a.active { color: var(--accent-dark); background: white; box-shadow: 0 3px 10px rgba(15, 32, 52, .08); }
.content { max-width: 1280px; margin: auto; padding: 36px; }
.heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 30px; }
h1 { margin: 5px 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
h2 { margin: 0 0 18px; font-size: 19px; }
p { color: var(--muted); }
.button {
  display: inline-flex; align-items: center; justify-content: center; padding: 11px 17px;
  color: white; background: var(--accent); border: 0; border-radius: 11px;
  font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 24%, transparent);
}
.secondary { color: var(--accent-dark); background: white; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: none; }
.danger-button {
  padding: 10px 15px; color: #a51e37; background: #ffe5ea; border: 1px solid #ffc7d1;
  border-radius: 10px; font-weight: 800; cursor: pointer;
}
.record-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.delete-panel { max-width: 920px; margin-top: 18px; padding: 18px; background: #fff7f8; border: 1px solid #ffd4dc; border-radius: 14px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.metrics article, .panel {
  padding: 22px; background: white; border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow);
}
.metrics span, .metrics small { color: var(--muted); }
.metrics strong { display: block; margin: 10px 0 2px; font-size: 30px; }
.section-title { display: flex; justify-content: space-between; margin: 34px 0 14px; }
.section-title a, .back { color: var(--accent-dark); font-weight: 750; }
.events { display: grid; gap: 10px; }
.event {
  display: flex; align-items: center; gap: 18px; padding: 16px 18px;
  background: white; border: 1px solid var(--border); border-radius: 15px; transition: .18s ease;
}
.event:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.event time { min-width: 58px; color: var(--accent-dark); text-align: center; text-transform: uppercase; }
.event time strong { display: block; font-size: 25px; line-height: 1; }
.event-info { min-width: 0; flex: 1; }
.event-info strong, .event-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-info small { margin-top: 4px; color: var(--muted); }
.status {
  display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px;
  color: #7a5d12; background: #fff3c7; font-size: 11px; font-style: normal; font-weight: 800;
}
.status-confirmed, .status-completed { color: #17633a; background: #dcf8e8; }
.status-cancelled { color: #9a2536; background: #ffe2e7; }
.empty { padding: 48px; color: var(--muted); background: white; border: 1px dashed #cbd4df; border-radius: 16px; text-align: center; }

.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 920px; }
.form label, .form-grid label { display: grid; gap: 7px; color: #435167; font-size: 13px; font-weight: 750; }
input:not([type=checkbox]), select, textarea {
  width: 100%; padding: 11px 12px; color: var(--text); background: #fbfcfd;
  border: 1px solid #ccd5df; border-radius: 10px; outline: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
fieldset { border: 1px solid var(--border); border-radius: 10px; }
.check { display: inline-flex !important; grid-template-columns: auto 1fr; margin: 6px 14px 6px 0; }
.wide { grid-column: 1 / -1; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.alert { padding: 11px 13px; color: #a51e37; background: #ffe5ea; border-radius: 10px; }

.detail-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 22px 0; }
.detail-head time { display: grid; gap: 4px; padding: 15px 18px; background: white; border: 1px solid var(--border); border-radius: 14px; text-align: right; }
.shared { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 18px; color: #422b82; background: #eee7ff; border-radius: 15px; }
.shared small { margin-left: auto; opacity: .75; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
dl { display: grid; grid-template-columns: 120px 1fr; gap: 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 650; }
.panel ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.panel li { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.panel li span { color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: minmax(280px, .7fr) 1.3fr; gap: 18px; align-items: start; }
.user-list { display: grid; gap: 2px; }
.user-list > div { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.user-list span, .user-list small { color: var(--muted); }
.search { display: flex; gap: 10px; margin-bottom: 18px; }
.directory, .team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.person-card, .team-card {
  display: flex; align-items: center; gap: 14px; padding: 18px;
  background: white; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.person-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.person-card > span:nth-child(2), .team-card > div { min-width: 0; flex: 1; }
.person-card strong, .person-card small, .team-card strong, .team-card small { display: block; }
.person-card small, .team-card small { margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card em { color: var(--muted); font-size: 12px; font-style: normal; }
.avatar {
  flex: 0 0 auto; width: 46px; height: 46px; display: grid !important; place-items: center;
  color: white; background: linear-gradient(135deg, var(--member-color, var(--accent)), #ff936d);
  border-radius: 14px; font-size: 13px; font-weight: 900;
}
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chips em {
  padding: 4px 7px; color: var(--accent-dark); background: color-mix(in srgb, var(--accent) 10%, white);
  border-radius: 7px; font-size: 10px; font-style: normal; font-weight: 750;
}
.client-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.text-link { color: var(--accent-dark); font-weight: 750; }
.contracts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.contract-card { display: grid; gap: 4px; padding: 16px; background: white; border: 1px solid var(--border); border-radius: 13px; }
.contract-card:hover { border-color: var(--accent); }
.contract-card span { color: var(--muted); font-size: 12px; }
.compact-form { display: grid; grid-template-columns: 1fr 160px 1fr 160px auto; gap: 10px; align-items: end; }
.compact-form h2 { grid-column: 1 / -1; }
.timeline { position: relative; display: grid; gap: 0; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline > div { position: relative; display: grid; grid-template-columns: 145px 1fr; gap: 16px; padding: 0 0 18px; }
.timeline > div::before { content: ""; position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; background: var(--accent); border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px var(--border); }
.timeline time { color: var(--muted); font-size: 11px; }
.timeline span, .timeline strong, .timeline small { display: block; }
.timeline strong { margin-bottom: 3px; }
.timeline small { margin-top: 3px; color: var(--muted); }
.notes { margin-top: 20px; }
.edit-link { display: inline-flex; margin-top: 10px; }
.year-filter { display: flex; gap: 9px; }
.year-filter input { width: 110px; }
.reporting-metrics { grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
table { width: 100%; min-width: 900px; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
td { font-size: 13px; }
.paid, .pending { display: inline-flex; padding: 4px 7px; border-radius: 7px; font-size: 10px; font-weight: 800; }
.paid { color: #17633a; background: #dcf8e8; }
.pending { color: #8a5a12; background: #fff3c7; }
.payment-metrics { grid-template-columns: repeat(2, minmax(0, 320px)); margin-bottom: 24px; }
.pay-button {
  padding: 7px 12px; color: white; background: #16a35a; border: 0;
  border-radius: 8px; font-size: 12px; font-weight: 850; cursor: pointer;
}
.pay-button:hover { background: #128449; }
td small { display: block; margin-top: 3px; color: var(--muted); }
.actions-cell { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.thank-you-card { max-width: 720px; }
.thank-you-message {
  white-space: pre-wrap; margin: 0 0 18px; padding: 18px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 14px;
  font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.6;
}
.form-hint { color: var(--muted); font-size: 13px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.mirror-box { padding: 18px; background: #f4f0ff; border-color: #d8ccf7; }
.schedule-editor { display: grid; gap: 14px; }
.schedule-row { padding: 18px; background: #f8fafc; border: 1px solid var(--border); border-radius: 15px; }
.schedule-toggle { display: flex !important; grid-template-columns: auto 1fr; align-items: center; margin-bottom: 12px; font-size: 15px !important; }
.schedule-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.schedule-team { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.schedule-team > span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.schedule-member {
  display: grid; grid-template-columns: minmax(160px, 1.3fr) repeat(3, 1fr);
  gap: 8px; align-items: end; padding: 10px; background: white; border: 1px solid var(--border); border-radius: 11px;
}
.schedule-member label { font-size: 11px; }
.schedule-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
.schedule-card { padding: 18px; background: white; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.schedule-card h3 { margin: 5px 0; }
.schedule-card p { margin: 3px 0 10px; }
.schedule-date { color: var(--accent-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.route-link { display: inline-flex; margin-bottom: 12px; color: var(--accent-dark); font-size: 12px; font-weight: 800; }
.schedule-payments { display: grid; gap: 7px; }
.schedule-payments > div { display: grid; grid-template-columns: 1.2fr repeat(4, auto); gap: 9px; padding: 9px; background: #f8fafc; border-radius: 9px; font-size: 11px; }
.schedule-payments span { color: var(--muted); }

.login-card {
  width: min(calc(100% - 32px), 430px); margin: max(5vh, 32px) auto; padding: 36px;
  background: white; border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow);
}
.login-card .brand { margin-bottom: 34px; }
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .reporting-metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { display: block; }
  aside { display: none; }
  header { height: 62px; padding: 0 16px; }
  .content { padding: 24px 16px 90px; }
  .heading, .detail-head { align-items: stretch; flex-direction: column; }
  .record-actions { align-items: stretch; flex-direction: column; }
  .record-actions .button, .record-actions form, .record-actions button { width: 100%; }
  .year-filter { width: 100%; }
  .year-filter input { flex: 1; width: auto; }
  .heading .button { width: 100%; }
  .metrics, .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .payment-metrics { grid-template-columns: 1fr 1fr; }
  .directory, .team-grid, .client-grid, .contracts { grid-template-columns: 1fr; }
  .schedule-fields, .schedule-cards { grid-template-columns: 1fr; }
  .schedule-member { grid-template-columns: 1fr 1fr; }
  .schedule-payments > div { grid-template-columns: 1fr 1fr; }
  .compact-form { grid-template-columns: 1fr; }
  .compact-form h2 { grid-column: auto; }
  .timeline > div { grid-template-columns: 1fr; gap: 4px; }
  .wide { grid-column: auto; }
  .event { padding: 14px 12px; gap: 12px; }
  .event > .status { display: none; }
  .detail-head time { text-align: left; }
  .shared { align-items: stretch; flex-direction: column; }
  .shared small { margin-left: 0; }
  .user-list > div { grid-template-columns: 1fr; }
  .mobile-nav {
    display: flex; position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
    justify-content: space-around; padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96); border-top: 1px solid var(--border); backdrop-filter: blur(14px);
  }
  .mobile-nav a { padding: 8px; color: var(--muted); font-size: 12px; font-weight: 800; }
}
@media (max-width: 430px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .metrics, .reporting-metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metrics article { padding: 15px; border-radius: 14px; }
  .metrics strong { font-size: 22px; }
  .event time { min-width: 48px; }
  .switcher a { padding: 7px 10px; }
}
