:root {
  --bg: #06111f;
  --bg-deep: #030b15;
  --surface: rgba(13, 28, 46, 0.82);
  --surface-strong: rgba(16, 34, 55, 0.97);
  --surface-soft: rgba(21, 40, 62, 0.68);
  --border: rgba(144, 170, 203, 0.20);
  --border-strong: rgba(144, 170, 203, 0.34);
  --text: #f6f8fd;
  --muted: #9aa8c2;
  --muted-2: #6f7f9b;
  --blue: #2482ff;
  --blue-2: #0d55e8;
  --blue-soft: rgba(36, 130, 255, 0.13);
  --green: #2fd05a;
  --orange: #ff8a16;
  --purple: #b54cff;
  --red: #ff5b61;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #eef5ff;
  --bg-deep: #e4eefb;
  --surface: rgba(255, 255, 255, 0.91);
  --surface-strong: rgba(255, 255, 255, 0.99);
  --surface-soft: rgba(237, 245, 255, 0.96);
  --border: rgba(40, 76, 120, 0.14);
  --border-strong: rgba(40, 76, 120, 0.25);
  --text: #0d1b2e;
  --muted: #60728e;
  --muted-2: #8191a8;
  --blue-soft: rgba(36, 130, 255, 0.10);
  --shadow: 0 18px 45px rgba(43, 79, 122, 0.16);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; background: var(--bg-deep); }
body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 86% 18%, rgba(28, 111, 220, 0.16), transparent 34%),
    radial-gradient(circle at 10% 68%, rgba(0, 104, 214, 0.09), transparent 35%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.mobile-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 93%, transparent), var(--bg-deep));
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.22);
}
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface) 75%, transparent));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
:root[data-theme="light"] .panel { background: var(--surface); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: calc(72px + var(--safe-top));
  padding: calc(12px + var(--safe-top)) 18px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(22px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(145deg, #0a6cff, #0e49d8);
  box-shadow: 0 10px 24px rgba(0, 90, 255, 0.30);
  font-weight: 800; color: white;
}
.brand-copy strong { display: block; font-size: 19px; line-height: 1.05; }
.brand-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

.icon-button, .primary-button, .secondary-button, .danger-button, .ghost-button {
  border: 0; border-radius: 14px; cursor: pointer; transition: transform .15s ease, opacity .15s ease, border-color .15s ease;
}
.icon-button:active, .primary-button:active, .secondary-button:active, .danger-button:active, .ghost-button:active { transform: scale(.98); }
.icon-button {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--border-strong); background: var(--surface-soft);
}
.primary-button, .secondary-button, .danger-button, .ghost-button {
  min-height: 48px; padding: 12px 18px; font-weight: 700;
}
.primary-button { background: linear-gradient(145deg, var(--blue), var(--blue-2)); color: white; box-shadow: 0 12px 25px rgba(36, 130, 255, .25); }
.secondary-button { border: 1px solid rgba(36, 130, 255, .65); background: var(--blue-soft); color: var(--text); }
.danger-button { border: 1px solid rgba(255, 91, 97, .55); background: rgba(255, 91, 97, .12); }
.ghost-button { border: 1px solid var(--border); background: transparent; }
button[disabled] { opacity: .55; cursor: wait; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button-row > * { flex: 1 1 160px; }

.page-main { padding: 24px 18px calc(108px + var(--safe-bottom)); }
.section { padding: 76px 0; }
.section-title { margin: 0 0 12px; font-size: clamp(28px, 5vw, 44px); letter-spacing: -1px; }
.section-subtitle { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.6; }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; }

.field { display: grid; gap: 7px; }
.field label, .field-label { color: var(--muted); font-size: 14px; }
.input, .select, .textarea {
  width: 100%; min-width: 0; border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 13px 14px; color: var(--text); background: var(--surface-soft); outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--blue); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { padding: 18px; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { margin-top: 7px; font-size: 30px; font-weight: 800; letter-spacing: -.6px; }
.metric-note { margin-top: 6px; color: var(--muted-2); font-size: 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--blue-soft); }
.table-action { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 700; }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 700; }
.badge.active, .badge.done { background: rgba(47, 208, 90, .14); color: var(--green); }
.badge.suspended, .badge.review { background: rgba(255, 138, 22, .14); color: var(--orange); }
.badge.archived, .badge.requested { background: rgba(181, 76, 255, .14); color: var(--purple); }
.badge.working { background: rgba(36, 130, 255, .14); color: var(--blue); }
.badge.paused, .badge.expired { background: rgba(255, 91, 97, .14); color: var(--red); }

.progress { height: 14px; overflow: hidden; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-soft); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-2), var(--blue)); }

.empty-state { padding: 28px; text-align: center; color: var(--muted); }
.loading { padding: 50px 20px; text-align: center; color: var(--muted); }
.spinner { width: 30px; height: 30px; margin: 0 auto 14px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 440px); padding: 26px; }
.auth-card h1 { margin: 22px 0 8px; font-size: 34px; letter-spacing: -1px; }
.auth-card p { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.auth-form { display: grid; gap: 14px; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-help { margin-top: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.error-box { margin-bottom: 14px; padding: 12px 14px; border: 1px solid rgba(255,91,97,.4); border-radius: 13px; color: var(--red); background: rgba(255,91,97,.08); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px;
  background: rgba(1, 8, 16, .72); backdrop-filter: blur(10px);
}
.modal { width: min(100%, 760px); max-height: calc(100dvh - 36px); overflow-y: auto; padding: 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 25px; }
.modal-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 28px; }

.global-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200; max-width: min(90vw, 520px);
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  padding: 13px 17px; border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--surface-strong); color: var(--text); box-shadow: var(--shadow); transition: .22s ease;
}
.global-toast.show { transform: translate(-50%, 0); opacity: 1; }
.global-toast[data-type="error"] { border-color: rgba(255,91,97,.55); }
.global-toast[data-type="success"] { border-color: rgba(47,208,90,.55); }

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .shell { width: min(100% - 22px, 1180px); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { padding: 15px; }
  .metric-value { font-size: 26px; }
  .section { padding: 54px 0; }
}

/* P24_UNIFIED_CONTROLS_CSS_2_3_21_START */
:root {
  --p24-controls-transition: 520ms cubic-bezier(.22,.61,.36,1);
}
html, body, .panel, .card, .topbar, header, aside, nav, main,
button, input, select, textarea, table, th, td {
  transition: background-color var(--p24-controls-transition),
              color var(--p24-controls-transition),
              border-color var(--p24-controls-transition),
              box-shadow var(--p24-controls-transition),
              opacity var(--p24-controls-transition) !important;
}

.p24-unified-controls-2321 {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px !important;
  margin: 0 !important;
  border: 1px solid var(--border-strong, rgba(95,139,205,.28)) !important;
  border-radius: 15px !important;
  background: var(--surface-strong, rgba(7,22,47,.94)) !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  position: relative !important;
  z-index: 99999 !important;
  flex: 0 0 auto !important;
}
.p24-unified-controls-2321.is-fixed {
  position: fixed !important;
  top: 12px !important;
  right: 12px !important;
}
.p24-unified-controls-2321 .p24-control-2321 {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  min-height: 38px !important;
  width: auto !important;
  padding: 8px 13px !important;
  margin: 0 !important;
  border: 1px solid var(--border-strong, rgba(95,139,205,.30)) !important;
  border-radius: 11px !important;
  background: var(--surface-soft, rgba(11,31,63,.92)) !important;
  color: var(--text, #dce8ff) !important;
  font: 600 13px/1.1 Arial, sans-serif !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transform: none !important;
}
.p24-unified-controls-2321 .p24-control-2321:hover,
.p24-unified-controls-2321 .p24-control-2321.is-active {
  border-color: var(--blue, #2482ff) !important;
}
.p24-control-icon-2321 {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  color: inherit !important;
}
.p24-control-icon-2321 svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
.p24-star-2321 .p24-control-icon-2321 svg {
  fill: currentColor !important;
  stroke: currentColor !important;
  stroke-width: 1 !important;
}
.p24-refresh-2321.is-loading .p24-control-icon-2321 {
  animation: p24-spin-2321 .8s linear infinite !important;
}
@keyframes p24-spin-2321 { to { transform: rotate(360deg); } }

:root[data-p24-star="1"] {
  --bg: #020816;
  --bg-deep: #010510;
  --surface: rgba(7,22,47,.82);
  --surface-strong: rgba(8,25,53,.96);
  --surface-soft: rgba(11,31,63,.82);
  --border: rgba(133,170,224,.18);
  --border-strong: rgba(133,170,224,.30);
  --text: #f3f7ff;
  --muted: #a9b8d1;
  color-scheme: dark;
}
:root[data-p24-star="1"] body {
  background-color: #020816 !important;
  background-image:
    radial-gradient(2px 2px at 8% 12%, #fff 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 18% 28%, #d9e8ff 45%, transparent 50%),
    radial-gradient(2px 2px at 31% 9%, #fff 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 44% 23%, #bcd5ff 45%, transparent 50%),
    radial-gradient(2px 2px at 58% 14%, #fff 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 73% 25%, #d9e8ff 45%, transparent 50%),
    radial-gradient(2px 2px at 88% 11%, #fff 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 12% 56%, #fff 45%, transparent 50%),
    radial-gradient(2px 2px at 27% 66%, #cfe0ff 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 49% 52%, #fff 45%, transparent 50%),
    radial-gradient(2px 2px at 69% 63%, #fff 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 91% 54%, #cfe0ff 45%, transparent 50%),
    radial-gradient(2px 2px at 8% 82%, #fff 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 36% 88%, #d9e8ff 45%, transparent 50%),
    radial-gradient(2px 2px at 61% 81%, #fff 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 86% 89%, #cfe0ff 45%, transparent 50%),
    linear-gradient(180deg,#020816,#06152d) !important;
  background-attachment: fixed !important;
}

[data-p24-hidden-legacy-2321="1"],
[data-p24-hidden-brand-2321="1"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 760px) {
  .p24-unified-controls-2321 {
    gap: 5px !important;
    padding: 5px !important;
  }
  .p24-unified-controls-2321 .p24-control-2321 {
    min-width: 36px !important;
    min-height: 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 10px !important;
  }
  .p24-unified-controls-2321 .p24-control-label-2321 {
    display: none !important;
  }
}
/* P24_UNIFIED_CONTROLS_CSS_2_3_21_END */
