/* HostingRDM.com Client Panel
 * Palette: Brand Identity (#012455 Deep Navy, #012755 Corporate Navy, #0180F1 Electric Blue, #F7FBFF Cloud White)
 * Typography: Single font Plus Jakarta Sans (holding invariant) with tabular numerals for data
 * Dials: ENERGY 1 | RHYTHM 2 | MOTION 1
 */

:root {
  --navy-deep: #012455;
  --navy-corp: #012755;
  --navy-dark: #001B3D;
  --blue-accent: #0180F1;
  --blue-accent-hover: #006AD1;
  --blue-soft: #EBF5FF;
  --bg-page: #F7FBFF;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F0F5FA;
  --border: #DCE6F2;
  --border-strong: #C2D4E8;
  --text-primary: #0B1F3A;
  --text-secondary: #4A5E78;
  --text-on-navy: #F7FBFF;
  --text-on-navy-muted: #B8CEE8;

  --status-ok-bg: #E7F7EE;
  --status-ok-fg: #0D6838;
  --status-warn-bg: #FFF5E5;
  --status-warn-fg: #9A4E00;
  --status-err-bg: #FDECEC;
  --status-err-fg: #A61B1B;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-elevated: 0 12px 32px rgba(1, 36, 85, 0.14);

  --sidebar-w: 256px;
  --topbar-h: 64px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.55;
  caret-color: var(--blue-accent);
}

::selection {
  background: var(--blue-soft);
  color: var(--navy-deep);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy-deep);
  color: #FFFFFF;
  padding: 10px 16px;
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: var(--radius-sm);
}

:focus-visible {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}

.icon-sm {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.icon-md {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--blue-accent);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue-accent-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--navy-deep);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--navy-corp);
}

.btn-ghost {
  background: transparent;
  color: var(--navy-corp);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
}

.text-btn {
  background: none;
  border: none;
  padding: 6px 4px;
  min-height: 36px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue-accent);
  cursor: pointer;
}

.text-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(1, 36, 85, 0.08);
}

.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--navy-corp);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.icon-action-btn:hover {
  background: var(--blue-soft);
  border-color: var(--blue-accent);
  color: var(--blue-accent);
}

.icon-action-danger:hover {
  background: var(--status-err-bg);
  border-color: var(--status-err-fg);
  color: var(--status-err-fg);
}

.btn-danger {
  background: var(--status-err-fg);
  color: #FFFFFF;
}

.btn-danger:hover:not(:disabled) {
  background: #881414;
}

.inline-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==================== FORMS ==================== */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.field-hint {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.field-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 140ms ease;
}

.field-input:focus {
  border-color: var(--blue-accent);
}

.field-input:user-invalid,
.field-input[aria-invalid="true"] {
  border-color: var(--status-err-fg);
}

.field-textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

.field-file {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.input-action-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-action-wrap .field-input {
  padding-right: 48px;
}

.input-icon-btn {
  position: absolute;
  right: 4px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.input-icon-btn:hover {
  color: var(--navy-deep);
  background: var(--bg-subtle);
}

.field-error {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--status-err-fg);
  min-height: 18px;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}

.inline-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.5;
}

.inline-alert-error {
  background: var(--status-err-bg);
  color: var(--status-err-fg);
  border: 1px solid #F5C2C2;
}

.inline-alert-warn {
  background: var(--status-warn-bg);
  color: var(--status-warn-fg);
  border: 1px solid #F3D5A3;
}

.file-preview {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.file-preview img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  margin-top: 8px;
  border-radius: 4px;
}

/* ==================== AUTH VIEW ==================== */
.auth-shell {
  min-height: 100dvh;
  display: flex;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(320px, 44%) 1fr;
  width: 100%;
  min-height: 100dvh;
}

.auth-brand-col {
  background: var(--navy-deep);
  color: var(--text-on-navy);
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-wordmark {
  height: 21px;
  width: auto;
  display: block;
}

.brand-wordmark-light {
  filter: brightness(0) invert(1);
}

.auth-brand-copy {
  max-width: 44ch;
  margin: 40px 0;
}

.auth-brand-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.auth-brand-copy p {
  margin: 0 0 28px;
  color: var(--text-on-navy-muted);
  font-size: 0.975rem;
}

.auth-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--text-on-navy);
}

.auth-checklist svg {
  color: #5EC2FF;
  margin-top: 3px;
}

.auth-brand-foot {
  font-size: 0.875rem;
  color: var(--text-on-navy-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 18px;
}

.auth-wa-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-form-col {
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
}

.auth-form-wrap {
  width: 100%;
  max-width: 420px;
}

.auth-mobile-brand {
  display: none;
  margin-bottom: 24px;
}

.auth-form-wrap h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--navy-deep);
}

.auth-subtitle {
  margin: 0 0 24px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.auth-help-links {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-help-links a {
  color: var(--blue-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-help-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-help-sep {
  color: var(--border-strong);
}

.inline-alert-ok {
  background: var(--status-ok-bg);
  color: var(--status-ok-fg);
  border: 1px solid #B6E3C8;
}

/* ==================== APP SHELL ==================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100dvh;
}

.sidebar {
  background: var(--navy-deep);
  color: var(--text-on-navy);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 40;
}

.sidebar-header {
  height: var(--topbar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
}

.sidebar-close-btn {
  display: none;
  color: var(--text-on-navy);
}

.sidebar-account {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.account-school {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  color: #FFFFFF;
}

.account-nsm {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--text-on-navy-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-on-navy-muted);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-item.is-active {
  background: var(--blue-accent);
  color: #FFFFFF;
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-mode-note {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-navy-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.nav-item-logout:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #FFD7D7;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  padding: 0 28px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  color: var(--navy-deep);
}

.page-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy-deep);
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1180px;
  width: 100%;
}

/* ==================== SURFACES & SECTIONS ==================== */
.view-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.surface {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.surface-head-wrap {
  flex-wrap: wrap;
  align-items: flex-start;
}

.surface-head h2,
.section-h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy-deep);
  letter-spacing: -0.015em;
}

.muted-text {
  margin: 0;
  color: var(--text-secondary);
}

.small-copy {
  font-size: 0.875rem;
}

.note-top {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.meta-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

/* ==================== STATUS BADGES ==================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-active {
  background: var(--status-ok-bg);
  color: var(--status-ok-fg);
}

.status-warn {
  background: var(--status-warn-bg);
  color: var(--status-warn-fg);
}

.status-error {
  background: var(--status-err-bg);
  color: var(--status-err-fg);
}

.server-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy-deep);
  white-space: nowrap;
}

/* ==================== OVERVIEW LAYOUT ==================== */
.notice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--status-warn-bg);
  border: 1px solid #F3D5A3;
  color: var(--status-warn-fg);
}

.notice-strip p {
  margin: 2px 0 0;
  font-size: 0.875rem;
}

.overview-primary {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}

.access-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.domain-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.domain-bar-meta {
  min-width: 0;
}

.domain-url {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-accent);
  text-decoration: none;
  word-break: break-all;
}

.domain-url:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.domain-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.meta-cell dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.meta-cell dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cred-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.cred-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.cred-val {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--navy-deep);
  word-break: break-all;
}

.overview-secondary,
.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.action-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.action-row {
  width: 100%;
  padding: 14px 4px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.action-row:hover {
  background: var(--bg-subtle);
}

.action-row-text strong {
  display: block;
  font-size: 0.9375rem;
  color: var(--navy-deep);
}

.action-row-text span {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.action-row-tag {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--blue-accent);
  flex-shrink: 0;
}

/* ==================== DETAIL KV & BANK ==================== */
.detail-kv {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.detail-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.detail-kv-row:last-child {
  border-bottom: none;
}

.detail-kv-row dt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.detail-kv-row dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.detail-kv-spacious .detail-kv-row {
  padding: 13px 0;
}

.surface-foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.bank-box {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  border: 1px solid #C6E2FF;
  margin-bottom: 16px;
}

.bank-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bank-number-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.bank-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy-deep);
  letter-spacing: 0.02em;
}

.transfer-exact-box {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--status-warn-bg);
  border: 1px solid #F3D5A3;
  margin-bottom: 16px;
}

.transfer-exact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.exact-amount {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--navy-deep);
  letter-spacing: 0.01em;
}

.unique-digits {
  background: #FDE047;
  color: var(--navy-deep);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 800;
}

/* ==================== TABLES ==================== */
.table-section {
  padding-bottom: 16px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 11px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.text-right {
  text-align: right !important;
}

.empty-inline {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ==================== SUPPORT GUIDES ==================== */
.guide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--bg-subtle);
}

.guide-item summary {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--navy-deep);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.guide-item summary::after {
  content: "+";
  font-size: 1.125rem;
  color: var(--blue-accent);
  font-weight: 700;
}

.guide-item[open] summary::after {
  content: "-";
}

.guide-item p {
  margin: 10px 0 2px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ==================== STATES ==================== */
.state-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== NATIVE DIALOG ==================== */
.modal-dialog {
  width: min(520px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-elevated);
}

.modal-dialog-wide {
  width: min(720px, calc(100vw - 24px));
}

.modal-dialog::backdrop {
  background: rgba(0, 27, 61, 0.52);
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--navy-deep);
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-foot-flush {
  padding: 14px 0 0;
  margin-top: 4px;
}

.health-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  text-align: center;
}

.health-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.renew-summary {
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

/* ==================== INVOICE SHEET ==================== */
.invoice-sheet {
  padding: 24px;
}

.invoice-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--navy-deep);
  margin-bottom: 18px;
}

.invoice-logo {
  height: 18px;
  width: auto;
  margin-bottom: 6px;
}

.invoice-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.invoice-parties p {
  margin: 4px 0 0;
}

.invoice-table {
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--navy-deep);
  margin-bottom: 16px;
}

.invoice-bank-note {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ==================== TOAST ==================== */
.toast-region {
  position: fixed;
  right: 20px;
  bottom: 84px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
  max-width: min(360px, calc(100vw - 32px));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================== FLOATING CS BOT WIDGET ==================== */
.cs-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.cs-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--navy-deep);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-elevated);
  transition: background-color 140ms ease;
}

.cs-fab:hover {
  background: var(--blue-accent);
}

.cs-panel {
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100dvh - 104px));
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cs-panel-head {
  background: var(--navy-deep);
  color: #FFFFFF;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cs-panel-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.cs-panel-sub {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-on-navy-muted);
}

.cs-head-btn {
  width: 36px;
  height: 36px;
  color: #FFFFFF;
}

.cs-head-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.cs-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-msg {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.55;
}

.cs-msg-p {
  margin: 0 0 10px;
}

.cs-msg-p:last-child {
  margin-bottom: 0;
}

.cs-msg-bot {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.cs-msg-user {
  align-self: flex-end;
  background: var(--blue-accent);
  color: #FFFFFF;
}

.cs-msg-action {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.cs-panel-footer {
  padding: 8px 12px 12px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
}

.btn-wa {
  background: #15803D;
  color: #FFFFFF;
  border-color: #15803D;
}

.btn-wa:hover:not(:disabled) {
  background: #166534;
  border-color: #166534;
}

.cs-wa-footer-btn {
  min-height: 40px;
}

.cs-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.cs-chip {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--navy-deep);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.cs-chip:hover {
  background: var(--blue-soft);
  border-color: var(--blue-accent);
  color: var(--blue-accent);
}

.cs-form {
  padding: 10px 12px 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.cs-input-hint {
  margin: 0 0 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.cs-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cs-input {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
}

.cs-send-btn {
  min-height: 40px;
  padding: 0 12px;
  flex-shrink: 0;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--navy-deep);
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-elevated);
}

.toast-error {
  background: var(--status-err-fg);
}

/* ==================== DRAWER BACKDROP ==================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 27, 61, 0.48);
  z-index: 35;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 960px) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-brand-col {
    display: none;
  }

  .auth-mobile-brand {
    display: block;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 84vw);
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close-btn,
  .mobile-menu-btn {
    display: inline-flex;
  }

  .overview-primary,
  .overview-secondary,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 16px;
  }

  .main-content {
    padding: 18px 16px 32px;
  }
}

@media (max-width: 600px) {
  .topbar-right .btn-sm {
    display: none;
  }

  .meta-strip,
  .invoice-parties {
    grid-template-columns: 1fr;
  }

  .detail-kv-row {
    flex-direction: column;
    gap: 2px;
  }

  .detail-kv-row dd {
    text-align: left;
  }

  .surface {
    padding: 18px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #invoice-printable,
  #invoice-printable * {
    visibility: visible;
  }

  #invoice-printable {
    position: fixed;
    inset: 0;
    background: #FFFFFF;
    padding: 24px;
  }
}
