:root {
  --auth-navy: #0b2f47;
  --auth-blue: #087ea4;
  --auth-teal: #0aa6a6;
  --auth-ink: #173247;
  --auth-muted: #647989;
  --auth-line: #d8e5ec;
  --auth-soft: #f3f8fa;
  --auth-danger: #a83a46;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 28px;
  background:
    radial-gradient(circle at 10% 10%, rgba(10, 166, 166, .22), transparent 28%),
    linear-gradient(135deg, #08283e 0%, #0b3c58 52%, #0a5668 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(310px, .9fr) minmax(430px, 1.1fr);
  width: min(980px, 100%);
  min-height: 610px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 17, 28, .35);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(rgba(8, 40, 61, .05), rgba(8, 40, 61, .28)),
    linear-gradient(145deg, #0b405c, #087d8b);
}

.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand strong { display: block; font-size: 21px; letter-spacing: -.02em; }
.auth-brand small { display: block; margin-top: 2px; color: rgba(255,255,255,.72); }
.auth-brand-mark { position: relative; width: 43px; height: 43px; border-radius: 13px; background: #fff; }
.auth-brand-mark i { position: absolute; inset: 10px 8px 8px; border: 2px solid #087e94; border-radius: 5px; }
.auth-brand-mark i::before { content: ""; position: absolute; left: -2px; right: -2px; top: 5px; border-top: 2px solid #087e94; }
.auth-brand-mark b { position: absolute; left: 13px; right: 10px; top: 25px; height: 2px; background: #e05e66; transform: skew(-28deg); }

.auth-intro-copy { margin: auto 0; }
.auth-eyebrow { margin: 0 0 12px; color: #9de6e2; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-intro h1 { margin: 0; max-width: 430px; font-size: clamp(34px, 4vw, 52px); line-height: 1.02; letter-spacing: -.045em; }
.auth-intro-copy > p:last-child { max-width: 420px; margin: 22px 0 0; color: rgba(255,255,255,.79); font-size: 16px; line-height: 1.65; }
.auth-security { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.78); font-size: 13px; }
.auth-security span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #07515a; background: #a6eee9; font-weight: 900; }

.auth-workspace { padding: 34px 48px 38px; color: var(--auth-ink); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 13px; background: var(--auth-soft); }
.auth-tab { min-height: 42px; border: 0; border-radius: 9px; color: var(--auth-muted); background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
.auth-tab.active { color: var(--auth-navy); background: #fff; box-shadow: 0 2px 10px rgba(20, 60, 80, .09); }
.auth-heading { grid-column: 1 / -1; margin: 5px 0 3px; }
.auth-heading h2 { margin: 0; font-size: 27px; letter-spacing: -.025em; }
.auth-heading p { margin: 7px 0 0; color: var(--auth-muted); line-height: 1.5; }
.auth-form { display: grid; gap: 17px; margin-top: 27px; }
.auth-register-form { grid-template-columns: 1fr 1fr; }
.auth-wide { grid-column: 1 / -1; }
.auth-field { display: grid; gap: 7px; color: #38546a; font-size: 13px; font-weight: 750; }
.auth-field input, .auth-field select {
  width: 100%;
  min-height: 45px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  outline: none;
  color: var(--auth-ink);
  background: #fff;
  font: inherit;
  font-weight: 500;
}
.auth-field input:focus, .auth-field select:focus { border-color: var(--auth-teal); box-shadow: 0 0 0 3px rgba(10, 166, 166, .13); }
.auth-primary { min-height: 48px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--auth-blue), var(--auth-teal)); font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 9px 24px rgba(8, 126, 164, .2); }
.auth-primary:hover { filter: brightness(.97); transform: translateY(-1px); }
.auth-primary:disabled { cursor: wait; opacity: .7; transform: none; }
.auth-demo { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--auth-line); }
.auth-demo > div:first-child { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.auth-demo strong { font-size: 13px; }
.auth-demo span { color: var(--auth-muted); font-size: 12px; }
.auth-demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.auth-demo-grid button { min-height: 37px; border: 1px solid var(--auth-line); border-radius: 9px; color: #315368; background: #fff; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.auth-demo-grid button:hover { color: var(--auth-blue); border-color: #9dcbd9; background: #f6fbfc; }
.auth-profile-fields { padding: 15px; border: 1px solid var(--auth-line); border-radius: 13px; background: var(--auth-soft); }
.auth-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.auth-footnote { margin: -3px 0 0; color: var(--auth-muted); font-size: 12px; line-height: 1.45; text-align: center; }
.auth-message { display: none; margin-top: 15px; padding: 11px 13px; border-radius: 9px; font-size: 13px; line-height: 1.4; }
.auth-message.show { display: block; }
.auth-message.error { color: var(--auth-danger); background: #fff0f2; border: 1px solid #f1c6cc; }
.auth-message.ok { color: #087064; background: #eafaf7; border: 1px solid #b9e8df; }

.auth-connection-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--auth-line); }
.auth-connection-toggle { width: 100%; border: 0; color: #547083; background: transparent; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.auth-connection-toggle::before { content: "⚙"; margin-right: 7px; color: var(--auth-teal); }
.auth-connection-toggle.active { color: var(--auth-blue); }
.auth-connection-form { display: grid; gap: 12px; margin-top: 13px; padding: 14px; border: 1px solid var(--auth-line); border-radius: 12px; background: var(--auth-soft); }
.auth-connection-form[hidden] { display: none !important; }
.auth-connection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.auth-connection-actions .auth-primary, .auth-connection-actions .auth-secondary { min-height: 39px; font-size: 12px; }
.auth-secondary { min-height: 40px; padding: 0 13px; border: 1px solid var(--auth-line); border-radius: 10px; color: #315368; background: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.auth-secondary:hover { color: var(--auth-blue); border-color: #9dcbd9; background: #f8fcfd; }
.auth-connection-help { margin: 0; color: var(--auth-muted); font-size: 11px; line-height: 1.45; }
.auth-connection-message { font-size: 12px; line-height: 1.4; }
.auth-connection-message.ok { color: #087064; }
.auth-connection-message.error { color: var(--auth-danger); }

.actor-picker select { pointer-events: none; }
.auth-logout, .auth-profile, .auth-connection-button { min-height: 37px; padding: 0 13px; border: 1px solid #d5e2e9; border-radius: 10px; color: #38556a; background: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.auth-logout:hover { color: #a83a46; border-color: #ebc2c7; background: #fff7f8; }
.auth-profile:hover, .auth-connection-button:hover { color: var(--auth-blue); border-color: #9dcbd9; background: #f6fbfc; }
.dashboard-grid, .audit-layout { grid-template-columns: minmax(0, 1fr) !important; }
.system-panel, .audit-explanation { display: none !important; }

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: rgba(5, 27, 42, .72);
  backdrop-filter: blur(5px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.doctor-profile-modal { width: min(980px, 100%); max-height: calc(100vh - 48px); overflow: auto; border-radius: 22px; color: var(--auth-ink); background: #f4f8fa; box-shadow: 0 28px 80px rgba(0, 17, 28, .38); }
.doctor-profile-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 25px 28px 20px; border-bottom: 1px solid var(--auth-line); background: rgba(255,255,255,.97); backdrop-filter: blur(8px); }
.doctor-profile-header h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.doctor-profile-header p:not(.auth-eyebrow) { margin: 6px 0 0; color: var(--auth-muted); font-size: 13px; }
.auth-modal-close { width: 38px; height: 38px; border: 1px solid var(--auth-line); border-radius: 11px; color: #496478; background: #fff; font: inherit; font-size: 25px; line-height: 1; cursor: pointer; }
.doctor-profile-message { display: none; margin: 18px 28px 0; padding: 11px 13px; border-radius: 10px; font-size: 13px; }
.doctor-profile-message.show { display: block; }
.doctor-profile-message.ok { color: #087064; border: 1px solid #b9e8df; background: #eafaf7; }
.doctor-profile-message.error { color: var(--auth-danger); border: 1px solid #f1c6cc; background: #fff0f2; }
.doctor-profile-content { display: grid; gap: 18px; padding: 22px 28px 30px; }
.doctor-schedule-card, .doctor-files-card { padding: 22px; border: 1px solid var(--auth-line); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(24, 61, 82, .06); }
.doctor-section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.doctor-section-heading strong { display: block; font-size: 16px; }
.doctor-section-heading span:not(.doctor-section-badge) { display: block; margin-top: 4px; color: var(--auth-muted); font-size: 12px; }
.doctor-section-badge { padding: 6px 10px; border-radius: 999px; color: #087064; background: #e4f7f3; font-size: 11px; font-weight: 850; white-space: nowrap; }
.doctor-section-badge.pending { color: #8a6214; background: #fff4d9; }
.doctor-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.doctor-weekdays label { cursor: pointer; }
.doctor-weekdays input { position: absolute; opacity: 0; pointer-events: none; }
.doctor-weekdays span { display: grid; place-items: center; min-height: 39px; border: 1px solid var(--auth-line); border-radius: 10px; color: #577084; background: #fff; font-size: 12px; font-weight: 800; }
.doctor-weekdays input:checked + span { color: #fff; border-color: var(--auth-teal); background: linear-gradient(135deg, var(--auth-blue), var(--auth-teal)); box-shadow: 0 5px 14px rgba(8, 126, 164, .18); }
.doctor-shift-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 17px; }
.doctor-shift-grid fieldset { margin: 0; padding: 15px; border: 1px solid var(--auth-line); border-radius: 13px; background: var(--auth-soft); }
.doctor-shift-toggle { display: flex; align-items: center; gap: 8px; color: #315368; font-size: 13px; font-weight: 850; }
.doctor-shift-toggle input { width: 17px; height: 17px; accent-color: var(--auth-teal); }
.doctor-time-row, .doctor-date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.doctor-time-row { margin-top: 12px; }
.doctor-date-row { margin-top: 15px; }
.doctor-time-row label, .doctor-date-row label { display: grid; gap: 6px; color: #506b7e; font-size: 11px; font-weight: 800; }
.doctor-time-row input, .doctor-date-row input { min-height: 41px; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--auth-line); border-radius: 9px; color: var(--auth-ink); background: #fff; font: inherit; }
.doctor-time-row input:disabled { opacity: .48; }
.doctor-save-schedule { width: 100%; margin-top: 17px; }
.doctor-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.doctor-upload { display: grid; grid-template-columns: 54px 1fr; gap: 11px 13px; align-items: center; padding: 16px; border: 1px solid var(--auth-line); border-radius: 13px; background: var(--auth-soft); }
.doctor-upload-icon, .doctor-upload img { grid-row: span 2; width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.doctor-upload-icon { display: grid; place-items: center; color: #087d8b; background: #dff4f2; font-size: 22px; }
.doctor-upload strong { display: block; font-size: 13px; }
.doctor-upload [data-file-status] { display: block; margin-top: 4px; color: var(--auth-muted); font-size: 11px; line-height: 1.35; }
.doctor-upload input[type="file"] { grid-column: 1 / -1; width: 100%; color: #526d80; font-size: 11px; }
.doctor-upload [data-upload-button] { grid-column: 1 / -1; width: 100%; }
.doctor-upload small { grid-column: 1 / -1; color: var(--auth-muted); font-size: 10px; }

@media (max-width: 800px) {
  .auth-screen { padding: 14px; align-items: start; }
  .auth-card { grid-template-columns: 1fr; min-height: 0; }
  .auth-intro { min-height: 230px; padding: 27px; }
  .auth-intro-copy { margin: 45px 0 25px; }
  .auth-intro h1 { font-size: 35px; }
  .auth-security { display: none; }
  .auth-workspace { padding: 27px; }
  .doctor-shift-grid, .doctor-upload-grid { grid-template-columns: 1fr; }
  .doctor-profile-modal { max-height: none; }
}

@media (max-width: 520px) {
  .auth-register-form, .auth-profile-grid { grid-template-columns: 1fr; }
  .auth-register-form > *, .auth-profile-grid > * { grid-column: 1; }
  .auth-demo > div:first-child { display: block; }
  .auth-demo span { display: block; margin-top: 4px; }
  .topbar-actions .status-pill { display: none; }
  .auth-logout, .auth-profile, .auth-connection-button { padding: 0 9px; font-size: 11px; }
  .auth-connection-actions, .doctor-date-row { grid-template-columns: 1fr; }
  .doctor-weekdays { grid-template-columns: repeat(4, 1fr); }
  .auth-modal-backdrop { padding: 0; place-items: start; }
  .doctor-profile-modal { width: 100%; min-height: 100vh; border-radius: 0; }
  .doctor-profile-header, .doctor-profile-content { padding-left: 18px; padding-right: 18px; }
}
