:root {
  color-scheme: light;
  --bg: #f5f6f7; --surface: #fff; --soft: #f1f3f4; --text: #192321;
  --muted: #566461; --line: #e2e8e5; --accent: #d9ff48; --accent-soft: #edf7cb;
  --shadow: 0 2px 6px #142b2210; --sidebar: #172725; --sidebar-text: #e5eeea;
  --danger: #a3293a;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121b1a; --surface: #1b2725; --soft: #23322f; --text: #edf3ee;
  --muted: #aebdb6; --line: #364540; --accent-soft: #38482c; --shadow: 0 2px 8px #0003;
  --sidebar: #14201e; --danger: #ffa2aa;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: clamp(1.9rem, 3vw, 2.45rem); }
svg { width: 21px; height: 21px; flex: none; }
:focus-visible { outline: 2px solid #65a02b; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 27px 15px 15px; background: var(--sidebar); color: var(--sidebar-text); z-index: 4; }
.brand { display: flex; align-items: center; gap: 11px; width: fit-content; color: #f7fff9; }
.sidebar .brand { margin: 0 0 41px 9px; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; background: var(--accent); color: #18251a; border-radius: 13px; flex: none; }
.brand-mark svg { width: 24px; height: 24px; fill: currentColor; }
.brand-word { font-size: 1.43rem; font-weight: 750; line-height: 1.07; letter-spacing: -.035em; }
.brand-word small, .sidebar-user small { display: block; color: #a8bcb3; font-size: .79rem; letter-spacing: 0; font-weight: 500; margin-top: 5px; }
.menu-caption { margin: 0 0 10px 11px; font-size: .76rem; color: #a5bcb1; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 46px; background: transparent; border: 0; border-radius: 10px; padding: 8px 11px; color: inherit; font-size: .94rem; text-align: left; }
.nav-link:hover { background: #ffffff13; }
.nav-link.active { background: #d9ff4820; color: #e3ff7c; font-weight: 650; }
.nav-link .count { margin-left: auto; }
.sidebar-footer { margin-top: auto; display: grid; gap: 7px; }
.demo-label { color: #abc2b8; font-size: .78rem; padding: 8px 11px; display: flex; align-items: center; gap: 7px; }
.demo-label i { width: 7px; height: 7px; border-radius: 100%; background: var(--accent); }
.sidebar-user { display: flex; align-items: center; min-width: 0; gap: 10px; border-top: 1px solid #ffffff25; padding: 13px 6px 6px; }
.sidebar-user strong { font-size: .88rem; overflow-wrap: anywhere; }
.sidebar-user small { margin-top: 0; }
.exit { color: #b6c8c0; }
.topbar { height: 65px; padding: 0 clamp(16px, 3vw, 34px); display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.crumb, .top-actions { display: flex; gap: 13px; align-items: center; min-width: 0; }
.crumb { color: var(--muted); font-size: .88rem; }
.crumb strong { color: var(--text); }
.crumb-divider { color: var(--muted); opacity: .6; }
.top-actions { gap: 8px; }
.top-actions a { display: grid; place-items: center; }
.workspace { padding: clamp(18px, 3vw, 34px); max-width: 1680px; margin: auto; }
.sidebar-scrim, button.mobile-menu { display: none; }
.icon-button { position: relative; display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.icon-button:hover { background: var(--soft); }
.top-bell .count { position: absolute; right: -4px; top: -4px; }
.count { display: grid; place-items: center; min-width: 19px; height: 19px; border-radius: 12px; padding: 0 4px; background: var(--accent); color: #1b2314; font-size: .72rem; line-height: 1; font-weight: 700; }
.avatar { position: relative; display: inline-grid; place-items: center; width: var(--avatar-size); height: var(--avatar-size); flex: 0 0 var(--avatar-size); overflow: hidden; border-radius: 50%; font-size: calc(var(--avatar-size)*.34); font-weight: 700; color: #153129; background: #c1e3d6; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; color: transparent; }
.tone-1 { background: #dfd6fb; } .tone-2 { background: #ffddc6; } .tone-3 { background: #dcecb7; } .tone-4 { background: #c6e4ff; } .tone-5 { background: #f7d8e6; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); padding: 8px 14px; min-height: 40px; font-size: .94rem; font-weight: 650; text-align: center; }
.button:hover { background: var(--soft); }
.button.primary { background: var(--accent); color: #1b2516; border-color: transparent; }
.button.primary:hover { background: #c9ef33; }
.button.danger { color: var(--danger); }
.field { display: grid; gap: 6px; min-width: 0; font-weight: 600; font-size: .93rem; }
.field span, .muted { color: var(--muted); }
.field span { font-size: .83rem; font-weight: 400; }
input, select, textarea { color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-width: 0; max-width: 100%; }
select { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%237d9188' stroke-width='1.8'%3E%3Cpath d='m5 7 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; background-size: 17px; }
textarea { min-height: 78px; resize: vertical; }
.form-grid { display: grid; gap: 13px; }
.form-error { color: var(--danger); font-size: .88rem; }
.form-error:empty { display: none; }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); }
.view-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 21px; flex-wrap: wrap; }
.view-heading p { margin-top: 7px; color: var(--muted); }
.view-heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#dialog { width: min(96vw, 570px); max-height: min(88dvh, 780px); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 22px 65px #0005; overflow: auto; }
#dialog::backdrop { background: #0c1716a1; }
.dialog-header { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 21px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 1.33rem; }
.dialog-body { padding: 20px; }
#toast { position: fixed; bottom: 20px; right: 20px; max-width: calc(100vw - 40px); z-index: 10; padding: 11px 16px; border-radius: 10px; color: #fff; background: #213c32; box-shadow: 0 4px 24px #0004; visibility: hidden; }
#toast.shown { visibility: visible; }
#toast.error { background: #8e2635; }
.loading { padding: 36px; text-align: center; }
.login-layout { display: grid; min-height: 100dvh; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.login-editorial { display: flex; padding: clamp(26px, 5vw, 74px); flex-direction: column; min-width: 0; gap: 40px; color: #f4fcf6; background: radial-gradient(ellipse at 92% 10%, #355047 0%, transparent 55%), #172725; }
.editorial-copy { margin-top: auto; }
.editorial-copy h1 { font-size: clamp(2.5rem, 5.2vw, 5.1rem); line-height: 1.01; max-width: 10ch; letter-spacing: -.062em; }
.editorial-copy p { margin-top: 21px; color: #afc5ba; font-size: clamp(1rem, 1.5vw, 1.23rem); max-width: 36ch; }
.sample { width: min(100%, 520px); margin-bottom: auto; background: #ffffff0f; border: 1px solid #ffffff23; border-radius: 17px; padding: clamp(11px, 2vw, 21px); }
.sample-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-bottom: 15px; }
.sample-top span, .sample-grid span { color: #abc3b6; font-size: .78rem; }
.sample-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; text-align: center; }
.sample-grid b { border-radius: 6px; padding: 7px 2px; background: #d9ff4826; color: #e6ff99; font-size: clamp(.65rem, 1vw, .85rem); }
.sample-grid b:nth-child(3n) { background: #c8b3ff35; color: #eadbff; }
.sample-grid b:nth-child(3n + 2) { background: #9aceff29; color: #c0e0ff; }
.login-main { display: grid; place-items: center; padding: 65px 22px 40px; position: relative; }
.login-theme { position: absolute; top: 20px; right: 22px; }
.login-card { width: min(100%, 400px); padding: clamp(20px,4vw,36px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.login-card h2 { font-size: 1.9rem; }
.login-card > p { margin-top: 9px; color: var(--muted); }
.login-card form { margin-top: 24px; display: grid; gap: 15px; }
@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; width: 248px; transform: translateX(-105%); transition: transform .18s ease; visibility: hidden; }
  .sidebar.sidebar-open { transform: translateX(0); visibility: visible; }
  .sidebar-open + .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 3; background: #0c17168a; }
  button.mobile-menu { display: inline-grid; }
  .crumb > span { display: none; }
  .crumb, .top-actions { gap: 7px; }
  .topbar { height: 58px; }
}
@media (max-width: 660px) {
  .login-layout { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .login-editorial { padding: 22px 20px 27px; gap: 20px; }
  .editorial-copy h1 { font-size: clamp(2.35rem, 9.5vw, 3.4rem); }
  .editorial-copy p { margin-top: 9px; }
  .sample { display: none; }
  .login-main { padding-top: 55px; }
  .login-theme { top: 9px; }
}

/* Shared form controls across account, team and schedule screens. */
:root {
  --control-surface: color-mix(in srgb, var(--soft) 55%, var(--surface));
  --control-border: color-mix(in srgb, var(--muted) 32%, var(--surface));
  --control-focus: #749d32;
}
:root[data-theme="dark"] { --control-focus: var(--accent); }
input:not([type="checkbox"], [type="radio"]), select, textarea {
  min-height: 42px;
  background-color: var(--control-surface);
  border-color: var(--control-border);
  border-radius: 12px;
}
:is(input, select, textarea):focus-visible {
  border-color: var(--control-focus);
  outline: 2px solid color-mix(in srgb, var(--control-focus) 53%, transparent);
  outline-offset: 2px;
}
input[type="checkbox"] {
  appearance: none;
  display: inline-grid;
  place-items: center;
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  padding: 0;
  background: var(--control-surface);
  border: 1px solid var(--control-border);
  border-radius: 6px;
  vertical-align: middle;
  cursor: pointer;
}
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after {
  content: "";
  width: .56rem;
  height: .33rem;
  border: solid #243217;
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}
input[type="radio"] { accent-color: var(--control-focus); }
input[type="file"] { width: 100%; padding: 5px 8px; }
input::file-selector-button {
  margin-right: 8px;
  padding: 6px 10px;
  background: var(--accent-soft);
  border: 0;
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

@supports (appearance: base-select) and selector(::picker(select)) {
  select, select::picker(select) { appearance: base-select; }
  select, .schedule-select, .schedule-form select {
    background-image: none;
    padding-inline: 12px;
  }
  select::picker-icon {
    color: var(--muted);
    transition: rotate .15s ease;
  }
  select:open::picker-icon { rotate: 180deg; }
  select::picker(select) {
    max-block-size: min(320px, 50dvh);
    padding: 5px;
    margin-block: 4px;
    border: 1px solid var(--control-border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 12px 32px #0004, var(--shadow);
    scrollbar-width: thin;
    overscroll-behavior: contain;
  }
  select option {
    gap: 8px;
    min-block-size: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-weight: 500;
  }
  select option::checkmark { order: 1; margin-inline-start: auto; color: var(--text); }
  select option:checked { background: var(--accent-soft); font-weight: 650; }
  select option:is(:hover, :focus-visible) {
    background: color-mix(in srgb, var(--accent-soft) 65%, var(--soft));
    outline: none;
  }
  select option:focus-visible { box-shadow: inset 0 0 0 1px var(--control-focus); }
  select option:disabled { color: var(--muted); opacity: .65; }
}
@media (prefers-reduced-motion: reduce) {
  select::picker-icon { transition: none; }
}
