/* ============================================================================
   TaxBaik Admin UI - Enterprise Grade Design System
   - CSS Custom Properties (Design Tokens)
   - Material Design 3 Principles
   - WCAG 2.1 AA Accessibility
   - Modern responsive design
   ============================================================================ */

/* ============================================================================
   Design Tokens (Color, Spacing, Typography, Shadow)
   ============================================================================ */

:root {
  /* Color System */
  --primary-color: #1F4E79;
  --primary-light: #E8F0F7;
  --primary-lighter: #D6E3F0;
  --primary-dark: #163A5C;
  --primary-darker: #102D47;
  --primary-contrast: #FFFFFF;

  --secondary-color: #2B6F6A;
  --secondary-light: #E6F2F1;
  --secondary-dark: #1F5854;
  --secondary-contrast: #FFFFFF;

  --tertiary-color: #A96A3B;
  --tertiary-light: #F4E9DF;
  --tertiary-dark: #7E4D28;
  --tertiary-contrast: #FFFFFF;

  --success-color: #16A34A;
  --success-light: #DCFCE7;
  --success-dark: #15803D;

  --warning-color: #F59E0B;
  --warning-light: #FEF3C7;
  --warning-dark: #B45309;

  --error-color: #DC2626;
  --error-light: #FEE2E2;
  --error-dark: #991B1B;

  --info-color: #06B6D4;
  --info-light: #CFFAFE;
  --info-dark: #0E7490;

  /* Semantic Colors */
  --text-primary: #1A1A1A;
  --text-secondary: #64748B;
  --text-tertiary: #94A3B8;
  --text-disabled: #CBD5E1;
  --text-inverse: #FFFFFF;

  --bg-primary: #FFFFFF;
  --bg-secondary: #F4F7FA;
  --bg-tertiary: #E9EEF4;
  --bg-overlay: rgba(15, 23, 42, 0.08);
  --bg-overlay-strong: rgba(15, 23, 42, 0.12);

  --border-color: #D6DFE8;
  --border-color-light: #E6EDF3;
  --border-color-strong: #B7C4D1;

  /* Spacing Scale */
  --space-0: 0;
  --space-1: 3px;
  --space-2: 6px;
  --space-3: 10px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 20px;
  --space-7: 24px;
  --space-8: 28px;
  --space-10: 34px;
  --space-12: 40px;
  --space-16: 52px;

  /* Border Radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* Typography Scale */
  --font-family-base: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.7rem;
  --font-size-sm: 0.75rem;
  --font-size-base: 0.82rem;
  --font-size-lg: 0.95rem;
  --font-size-xl: 1.1rem;
  --font-size-2xl: 1.3rem;
  --font-size-3xl: 1.6rem;
  --font-size-4xl: 2rem;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Shadow System (Elevation) */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-modal-backdrop: 1000;
  --z-modal: 1001;
  --z-popover: 1050;
  --z-tooltip: 1100;
}

/* ============================================================================
   Global Reset & Base Styles
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  font-family: var(--font-family-base);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-space-between {
  justify-content: space-between;
}

.pa-8 {
  padding: var(--space-8) !important;
}

.mb-4 {
  margin-bottom: var(--space-4) !important;
}

.mb-6 {
  margin-bottom: var(--space-6) !important;
}

.mt-4 {
  margin-top: var(--space-4) !important;
}

.text-center {
  text-align: center;
}

.ml-3 {
  margin-left: var(--space-3) !important;
}

.cursor-pointer {
  cursor: pointer;
}

.admin-row-clickable {
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.admin-row-clickable:hover {
  background-color: rgba(31, 78, 121, 0.05);
}

.admin-native-select {
  width: 100%;
  min-height: 56px;
  padding: 16px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font: inherit;
}

.admin-native-select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.faq-col-order { width: 110px; }
.faq-col-category { width: 130px; }
.faq-col-status { width: 90px; }
.faq-col-actions { width: 160px; }

.admin-season-panel {
  overflow: hidden;
}

.admin-season-table {
  margin-top: 0;
}

.admin-season-date-picker {
  width: 100%;
}

.admin-season-jump-button {
  justify-content: flex-start;
}

.admin-season-hero {
  background: linear-gradient(135deg, #1a365d 0%, #2a4365 100%);
  border-radius: 12px;
  padding: 2rem;
  color: #fff;
  margin-bottom: 1.5rem;
}

.admin-season-hero--inactive {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.admin-season-badge {
  background: #f59e0b;
  color: #1a202c;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.admin-season-hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  white-space: pre-line;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.admin-season-hero-subtext {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1.5rem;
}

.admin-season-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-season-cta {
  background: #e53e3e;
  color: #fff;
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.admin-season-secondary-cta {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.admin-season-row.is-active {
  background: rgba(66, 153, 225, 0.1);
}

.admin-nowrap {
  white-space: nowrap;
}

.admin-code-sm {
  font-size: 0.8rem;
}

.admin-muted-label {
  color: #a0aec0;
  font-size: 0.85rem;
}

.admin-faq-empty-icon {
  font-size: 3rem;
  opacity: 0.3;
}

.admin-faq-sort-button {
  padding: 2px;
}

.admin-faq-question {
  max-width: 480px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-pre-wrap {
  white-space: pre-wrap;
}

.admin-login-page-shell {
  min-height: 100vh;
}

.admin-shell {
  background: #f6f8fb;
}

.admin-topbar {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.88) !important;
  border-bottom: 1px solid rgba(214, 223, 232, 0.85);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.admin-sidebar-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-sidebar-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color-light);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.admin-sidebar-body {
  background: #fff;
}

.admin-sidebar-card .accordion-button {
  font-weight: var(--font-weight-semibold);
  font-size: 0.75rem;
  color: var(--text-primary);
  background: #fff;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.admin-sidebar-card .accordion-button:not(.collapsed) {
  color: var(--primary-dark);
  background: #f7f9fc;
  box-shadow: inset 3px 0 0 var(--primary-color);
}

.admin-sidebar-card .list-group-item {
  border: 0;
  border-radius: 0;
  padding: 0.55rem 0.75rem;
  color: var(--text-primary);
  background: transparent;
  font-size: 0.74rem;
}

.admin-sidebar-card .list-group-item:hover {
  background: rgba(31, 78, 121, 0.06);
  color: var(--primary-dark);
}

.admin-sidebar-card .list-group-item.active {
  background: #eef4fb;
  color: var(--primary-dark);
  font-weight: var(--font-weight-semibold);
}

.admin-main-surface {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: none !important;
  border: 1px solid var(--border-color);
}

.admin-breadcrumb-header {
  background: #ffffff;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.admin-breadcrumb-header .breadcrumb {
  margin-bottom: 0;
}

.admin-content-card .card-body {
  min-height: calc(100vh - 140px);
}

.admin-page-shell {
  display: grid;
  gap: 1rem;
}

.details-grid dt {
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.35rem;
}

.details-grid dd {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.blog-editor-shell .card,
.admin-page-shell .card {
  border-radius: var(--radius-lg);
  box-shadow: none !important;
  border: 1px solid var(--border-color-light);
}

.blog-editor-shell .card-header,
.admin-page-shell .card-header {
  background: #ffffff;
}

.blog-editor-shell .card-footer,
.admin-page-shell .card-footer {
  background: #fff;
}

.admin-empty-state {
  padding-block: 1.5rem;
}

.admin-empty-state .empty-img {
  margin-bottom: 0.75rem;
}

.blog-editor-shell .editor-toolbar .btn {
  border-radius: var(--radius-full);
}

.blog-editor-shell .blog-preview-pane {
  border-radius: var(--radius-lg);
  background: #fff;
}

.admin-metric-card,
.admin-sidebar-card {
  box-shadow: none !important;
  border: 1px solid var(--border-color-light) !important;
  border-radius: var(--radius-lg) !important;
}

.admin-metric-card .card-body {
  padding: 0.8rem 0.85rem;
}

.admin-page-header-title {
  font-size: 1.02rem;
  line-height: 1.15;
  font-weight: 600;
}

.admin-page-header-subtitle {
  font-size: 0.76rem;
}

.admin-page-header-eyebrow {
  font-size: 0.66rem;
}

.breadcrumb-muted {
  --bs-breadcrumb-divider-color: var(--text-tertiary);
  margin-bottom: 0;
}

.breadcrumb-muted a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb-muted a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.admin-faq-edit-panel {
  max-width: 720px;
}

.admin-empty-state-icon {
  font-size: 3rem;
  opacity: 0.3;
}

.admin-consultation-item {
  width: 100%;
}

.admin-dashboard-tile {
  border: 1px solid var(--border-color);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.admin-dashboard-summary {
  border: 1px solid var(--border-color);
}

.admin-table-id-column {
  width: 80px;
}

.admin-table-message-column {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-weight-bold {
  font-weight: var(--font-weight-bold) !important;
}

/* ============================================================================
   Focus Visible (Accessibility)
   ============================================================================ */

:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ============================================================================
   Login Page Styles
   ============================================================================ */

.admin-login-page.mud-container {
  width: 100%;
  margin: 0 auto;
}

.admin-login-page.mud-container-maxwidth-small {
  max-width: 480px !important;
}

.admin-login-page .mud-paper {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-8);
}

.admin-login-page .mud-paper.elevation-3 {
  box-shadow: var(--shadow-lg);
}

.admin-login-page .mud-typography {
  color: var(--text-primary);
  line-height: var(--line-height-normal);
}

.admin-login-page .mud-typography--h4 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
  color: var(--primary-color);
  margin-bottom: var(--space-4);
}

.admin-login-page .mud-typography--body1 {
  font-size: var(--font-size-base);
}

.admin-login-page input[type="text"],
.admin-login-page input[type="password"] {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 44px;
}

.admin-login-page input[type="text"]:focus,
.admin-login-page input[type="password"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.admin-login-page label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.admin-login-page button {
  width: 100%;
  padding: var(--space-3) var(--space-6);
  margin-top: var(--space-4);
  background-color: var(--primary-color);
  color: var(--primary-contrast);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  min-height: 44px;
}

.admin-login-page button:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.admin-login-page button:active {
  transform: translateY(0);
}

.admin-login-page button:disabled {
  background-color: var(--text-disabled);
  cursor: not-allowed;
  transform: none;
}

.admin-login-page .mud-alert {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  border-left: 4px solid transparent;
}

.admin-login-page .mud-alert--error {
  background-color: var(--error-light);
  color: var(--error-dark);
  border-left-color: var(--error-color);
}

.admin-login-page .mud-alert--success {
  background-color: var(--success-light);
  color: var(--success-dark);
  border-left-color: var(--success-color);
}

.admin-login-page .mud-alert--info {
  background-color: var(--info-light);
  color: var(--info-dark);
  border-left-color: var(--info-color);
}

.admin-login-shell {
  min-height: calc(100vh - 72px);
  padding: 48px 20px;
  display: grid;
  place-items: center;
  gap: 20px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.08), transparent 24%),
    linear-gradient(180deg, #F8FAFC 0%, #EEF4FF 100%);
}

.admin-login-hero {
  width: min(640px, 100%);
  text-align: left;
  padding: 8px 4px 0;
}

.admin-login-kicker {
  margin: 0 0 8px;
  color: var(--primary-color);
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-login-hero h1 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.1;
  font-weight: var(--font-weight-bold);
}

.admin-login-hero p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.admin-login-card {
  width: min(640px, 100%);
  overflow: hidden;
}

.admin-login-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-login-summary > div {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.admin-login-summary strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.admin-login-form {
  max-width: 100%;
}

.admin-login-footnote {
  margin: 16px 0 0;
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

/* Reconnect Modal */
.admin-reconnect-modal {
  display: none;
}

.admin-reconnect-modal.components-reconnect-show,
.admin-reconnect-modal.components-reconnect-failed,
.admin-reconnect-modal.components-reconnect-rejected {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.admin-reconnect-card {
  width: min(420px, 100%);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--bg-primary);
  box-shadow: var(--shadow-2xl);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-reconnect-card strong,
.admin-reconnect-card span {
  display: block;
}

.admin-reconnect-card strong {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.admin-reconnect-card span {
  margin-top: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   Admin Shell (Main Layout)
   ============================================================================ */

.admin-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--bg-secondary);
}

.admin-shell .mud-typography--h4 {
  font-size: 1.35rem;
  line-height: 1.2;
}

.admin-shell .mud-typography--h6 {
  font-size: 0.88rem;
  line-height: 1.2;
}

.admin-shell .mud-typography--subtitle1 {
  font-size: 0.82rem;
  line-height: 1.3;
}

.admin-shell .mud-typography--body1 {
  font-size: 0.82rem;
  line-height: 1.4;
}

.admin-shell .mud-typography--body2 {
  font-size: 0.75rem;
  line-height: 1.35;
}

.admin-shell .mud-typography--caption {
  font-size: 0.68rem;
  line-height: 1.2;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  min-height: 40px !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFCFE 100%);
  border-bottom: 1px solid var(--border-color);
  z-index: var(--z-dropdown);
  box-shadow: none !important;
}

.admin-topbar-branding {
  min-width: 0;
}

.admin-topbar-breadcrumb {
  min-width: 0;
}

.admin-topbar-breadcrumb .breadcrumb {
  font-size: 0.76rem;
}

.admin-menu-button {
  margin-right: var(--space-2);
}

.admin-topbar-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.admin-topbar-title span {
  color: var(--text-primary);
}

.admin-brand-text {
  font-size: 0.82rem !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-brand-subtitle {
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  color: #1F2937 !important;
}

.admin-topbar-action {
  white-space: nowrap;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.8rem;
}

.admin-shell .mud-button-root {
  min-height: 32px;
  font-size: 0.8rem;
}

.admin-drawer {
  width: 192px;
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-color-light);
}

.admin-drawer-context {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px 5px;
  border-bottom: 1px solid var(--border-color-light);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04), rgba(255, 255, 255, 0));
}

.admin-drawer-context-label {
  color: var(--text-tertiary);
  font-size: 0.68rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-drawer-context-value {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
}

.admin-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--primary-contrast);
  font-weight: var(--font-weight-bold);
  font-size: 1rem;
  flex-shrink: 0;
}

.admin-nav {
  padding: 2px 0;
  flex: 1;
  overflow-y: auto;
}

.admin-nav .mud-nav-link,
.admin-nav .mud-nav-group-header {
  margin: 1px 4px !important;
  border-radius: 6px !important;
  transition: all var(--transition-base) !important;
}

.admin-nav .mud-nav-link {
  min-height: 28px;
  font-size: 0.72rem;
}

.admin-nav .mud-nav-link .mud-stack {
  width: 100%;
  gap: 8px;
}

.admin-nav-badge {
  margin-left: auto;
  height: 18px;
  font-size: 0.65rem;
}

.admin-body {
  display: flex;
  min-height: 0;
  flex: 1;
}

.admin-nav .mud-nav-group-header {
  min-height: 28px;
  font-size: 0.72rem;
}

.admin-sidebar-title {
  font-size: 0.82rem;
}

.admin-nav .mud-nav-link:hover {
  background-color: var(--primary-light) !important;
}

.admin-nav .mud-nav-link.active {
  background-color: var(--primary-light) !important;
  color: var(--primary-dark) !important;
  font-weight: var(--font-weight-semibold) !important;
}

.admin-nav .mud-nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--primary-color);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.admin-nav .mud-nav-link.active::before {
  opacity: 1;
}

.admin-drawer-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-color-light);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.admin-drawer-version {
  margin-top: auto;
  padding: var(--space-4);
  border-top: 1px solid var(--border-color-light);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.35;
}

.admin-drawer-version-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
}

.admin-drawer-version-value {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.admin-drawer-version-built {
  margin-top: 2px;
  word-break: break-word;
}

.admin-main {
  flex: 1;
  overflow-y: auto;
  background-color: var(--bg-secondary);
}

.admin-content {
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.admin-dashboard-grid {
  margin-top: 0;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat {
  padding: 14px;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.admin-stat-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.admin-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-chart {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-lg);
  background: #fff;
}

.admin-chart-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.admin-chart-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-chart-row {
  display: grid;
  grid-template-columns: 56px 1fr 28px;
  gap: 10px;
  align-items: center;
  font-size: 0.75rem;
}

.admin-chart-track {
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.admin-chart-fill {
  height: 100%;
  border-radius: inherit;
}

.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.admin-quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color-strong);
}

.admin-quick-card .mud-icon-root {
  color: var(--primary-color);
}

.admin-note-list {
  display: grid;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.admin-note-list div {
  padding-left: 14px;
  position: relative;
}

.admin-note-list div::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--primary-color);
}

.admin-dashboard-status {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.admin-status-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-status-chip .mud-typography--overline {
  color: var(--text-tertiary);
  line-height: 1.1;
}

.admin-status-chip .mud-typography--body2 {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

/* ============================================================================
   Shared Admin UI
   ============================================================================ */

.admin-page-shell {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.admin-page-shell .page-header {
  margin-bottom: 0.5rem !important;
}

.admin-page-header-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.admin-page-header-title {
  font-size: 1.08rem;
  line-height: 1.15;
}

.admin-page-header-subtitle {
  font-size: 0.78rem;
}

.admin-dashboard-header {
  margin-bottom: 0.5rem !important;
}

.admin-dashboard-user {
  text-align: right;
  line-height: 1.2;
}

.admin-dashboard-metrics .card-body {
  padding: 0.8rem;
}

.admin-metric-card--compact .card-body {
  padding: 0.8rem 0.85rem;
}

.admin-metric-card .h4 {
  font-size: 0.88rem;
}

.admin-metric-card .h6 {
  font-size: 0.88rem;
  margin-bottom: 0.25rem !important;
}

.admin-metric-card p {
  font-size: 0.73rem;
}

.admin-metric-card .avatar {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.7rem;
}

.admin-dashboard-metrics .card {
  min-height: 100%;
  background: #ffffff;
}

.blog-editor-header .badge-sm {
  font-size: 0.72rem;
  padding: 0.35rem 0.55rem;
}

.admin-page-card {
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.admin-page-card-body {
  background: #fff;
}

.admin-coming-soon-card {
  text-align: center;
}

.admin-coming-soon-card .card-body {
  padding: 3rem 1.5rem;
}

.blog-editor-shell .editor-block {
  margin-bottom: 1.25rem;
}

.blog-editor-shell .editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.blog-editor-shell .editor-surface,
.blog-editor-shell .blog-preview-pane {
  min-height: 320px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  padding: 1rem 1.1rem;
}

.blog-editor-shell .editor-surface:focus {
  outline: 2px solid rgba(31, 78, 121, 0.18);
  border-color: var(--primary-color);
}

.blog-editor-shell .blog-meta-grid {
  margin-top: 0.25rem;
}

.blog-editor-shell .admin-editor-source {
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.blog-editor-shell .admin-editor-source dt {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.blog-editor-shell .admin-editor-source dd {
  color: var(--text-primary);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

/* ============================================================================
   Responsive Design - Mobile First
   ============================================================================ */

/* Desktop XXL: 1920px+ */
@media (min-width: 1920px) {
  .admin-content {
    padding: var(--space-10);
    max-width: 100%;
  }

  .admin-metric-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }

  .admin-metric-card {
    min-height: 180px;
    padding: var(--space-7);
  }

  .admin-page-hero {
    gap: var(--space-8);
    margin-bottom: var(--space-10);
    padding-bottom: var(--space-8);
  }
}

/* Desktop XL: 1440px */
@media (min-width: 1440px) and (max-width: 1919px) {
  .admin-metric-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }

  .admin-metric-card {
    min-height: 170px;
    padding: var(--space-6);
  }
}

/* Desktop L: 1024px */
@media (min-width: 1024px) and (max-width: 1439px) {
  .admin-drawer {
    width: 280px;
  }

  .admin-content {
    padding: var(--space-7);
  }

  .admin-metric-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
  }

  .admin-metric-card {
    min-height: 160px;
    padding: var(--space-5);
  }

  .admin-page-hero {
    gap: var(--space-6);
  }

  .admin-topbar {
    padding: var(--space-3) var(--space-5);
  }
}

/* Tablet L: 960px */
@media (min-width: 960px) and (max-width: 1023px) {
  .admin-drawer {
    width: 260px;
  }

  .admin-content {
    padding: var(--space-6);
  }

  .admin-metric-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }

  .admin-metric-card {
    min-height: 150px;
    padding: var(--space-5);
  }

  .admin-page-title {
    font-size: var(--font-size-2xl);
  }

  .admin-surface {
    padding: var(--space-5) !important;
  }

  .admin-table thead th,
  .admin-table tbody td {
    padding: var(--space-3) var(--space-3);
  }
}

/* Tablet M: 768px */
@media (min-width: 768px) and (max-width: 959px) {
  .admin-shell {
    flex-direction: row;
  }

  .admin-drawer {
    width: 240px;
    min-width: 240px;
  }

  .admin-content {
    padding: var(--space-5);
  }

  .admin-metric-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  .admin-metric-card {
    min-height: 140px;
    padding: var(--space-4);
    font-size: 0.95rem;
  }

  .admin-page-title {
    font-size: var(--font-size-2xl);
  }

  .admin-page-hero {
    gap: var(--space-4);
    margin-bottom: var(--space-6);
  }

  .admin-surface {
    padding: var(--space-4) !important;
  }

  .admin-table thead th {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }

  .admin-table tbody td {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
  }

  .admin-topbar {
    padding: var(--space-3) var(--space-4);
  }

  .admin-section-header {
    flex-direction: column;
    gap: var(--space-3);
  }
}

/* Tablet S: 600px */
@media (min-width: 600px) and (max-width: 767px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-drawer {
    width: 100%;
    height: auto;
    max-height: 60px;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
  }

  .admin-drawer-brand {
    padding: var(--space-3) var(--space-4);
    border-bottom: none;
    border-right: 1px solid var(--border-color-light);
    flex-shrink: 0;
  }

  .admin-brand-mark {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .admin-nav {
    display: flex;
    flex-direction: row;
    padding: var(--space-2);
    gap: var(--space-1);
    overflow-x: auto;
    flex: 1;
  }

  .admin-drawer-footer {
    display: none;
  }

  .admin-main {
    flex: 1;
  }

  .admin-content {
    padding: var(--space-4);
  }

  .admin-metric-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .admin-metric-card {
    min-height: 130px;
    padding: var(--space-4);
  }

  .admin-page-title {
    font-size: var(--font-size-xl);
  }

  .admin-page-hero {
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
  }

  .admin-surface {
    padding: var(--space-4) !important;
  }

  .admin-section-header {
    flex-direction: column;
    gap: var(--space-3);
  }

  .admin-topbar {
    padding: var(--space-2) var(--space-4);
  }

  .admin-topbar-title {
    display: none;
  }

  .admin-table thead th {
    padding: var(--space-2) var(--space-2);
    font-size: var(--font-size-xs);
  }

  .admin-table tbody td {
    padding: var(--space-2) var(--space-2);
    font-size: var(--font-size-sm);
  }
}

/* Mobile L: 480px */
@media (min-width: 480px) and (max-width: 599px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-drawer {
    width: 100%;
    height: auto;
    max-height: auto;
    flex-direction: column;
  }

  .admin-drawer-brand {
    padding: var(--space-3) var(--space-4);
  }

  .admin-brand-mark {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .admin-nav {
    display: flex;
    flex-direction: row;
    padding: var(--space-2);
    gap: var(--space-1);
    overflow-x: auto;
  }

  .admin-drawer-footer {
    display: none;
  }

  .admin-content {
    padding: var(--space-3);
  }

  .admin-metric-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .admin-metric-card {
    min-height: 110px;
    padding: var(--space-3);
  }

  .admin-page-title {
    font-size: var(--font-size-lg);
  }

  .admin-page-subtitle {
    font-size: var(--font-size-sm);
  }

  .admin-surface {
    padding: var(--space-3) !important;
  }

  .admin-section-header {
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
  }

  .admin-table thead th {
    padding: var(--space-2) var(--space-1);
    font-size: var(--font-size-xs);
  }

  .admin-table tbody td {
    padding: var(--space-2) var(--space-1);
    font-size: var(--font-size-sm);
  }

  .admin-topbar {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }

  .admin-topbar-action {
    padding: var(--space-2) var(--space-2) !important;
    font-size: var(--font-size-xs);
    min-height: 36px;
  }
}

/* Mobile S: <480px */
@media (max-width: 479px) {
  .admin-login-page.mud-container-maxwidth-small {
    max-width: 100% !important;
    padding: var(--space-3);
  }

  .admin-login-page .mud-typography--h4 {
    font-size: var(--font-size-2xl);
  }

  .admin-shell {
    flex-direction: column;
    height: auto;
  }

  .admin-topbar {
    padding: var(--space-2);
    gap: var(--space-2);
  }

  .admin-topbar-action {
    padding: var(--space-2) var(--space-2) !important;
    font-size: var(--font-size-xs);
    min-height: 36px;
  }

  .admin-drawer {
    position: fixed;
    inset: 56px 12px auto 12px;
    width: auto;
    max-height: calc(100vh - 72px);
    height: auto;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    overflow-y: auto;
    z-index: 20;
    background: var(--bg-primary);
  }

  .admin-drawer-brand {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-2);
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid var(--border-color-light);
  }

  .admin-brand-mark {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-base);
  }

  .admin-nav {
    display: flex;
    flex-direction: column;
    padding: var(--space-2);
    gap: var(--space-1);
    overflow-y: auto;
  }

  .admin-nav .mud-nav-link {
    min-width: 100px;
    font-size: var(--font-size-xs);
  }

  .admin-drawer-footer {
    display: none;
  }

  .admin-main {
    flex: 1;
    padding-top: 0;
  }

  .admin-content {
    padding: var(--space-3);
    max-width: 100%;
    margin: 0;
  }

  .admin-page-hero {
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
  }

  .admin-dashboard-status {
    flex-direction: column;
  }

  .admin-page-title {
    font-size: var(--font-size-lg);
  }

  .admin-page-subtitle {
    font-size: var(--font-size-sm);
    display: block;
  }

  .admin-eyebrow {
    font-size: var(--font-size-xs);
  }

  .admin-metric-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .admin-metric-card {
    min-height: 100px;
    padding: var(--space-3);
    border-radius: var(--radius-md);
  }

  .admin-surface {
    padding: var(--space-3) !important;
    border-radius: var(--radius-md) !important;
  }

  .admin-section-header {
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
  }

  .admin-section-header h6 {
    font-size: var(--font-size-base) !important;
  }

  .admin-section-header .mud-button {
    width: 100%;
  }

  .admin-table {
    font-size: var(--font-size-xs);
  }

  .admin-table thead th {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
  }

  .admin-table tbody tr {
    line-height: var(--line-height-tight);
  }

  .admin-table tbody td {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
  }

  /* Touch Target Sizing (WCAG 2.5.5) */
  .mud-button,
  .mud-icon-button,
  a,
  input,
  select,
  textarea {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ============================================================================
   Reduced Motion Support (Accessibility)
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  .admin-topbar,
  .admin-drawer,
  .admin-topbar-action {
    display: none;
  }

  .admin-shell {
    height: auto;
  }

  .admin-content {
    padding: 0;
    max-width: 100%;
  }

  .admin-metric-card {
    break-inside: avoid;
  }

  .admin-table {
    break-inside: avoid;
  }
}

/* ============================================================================
   Blazor Loading Indicator
   ============================================================================ */

#blazor-loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#blazor-loading.show {
    display: flex;
    animation: overlayFadeIn 0.15s ease-out;
    pointer-events: none;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Page content fade-in on each route mount */
.admin-page-hero,
.admin-login-page {
  animation: adminPageIn 0.25s ease-out;
}

@keyframes adminPageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.blazor-loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.blazor-loading-spinner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.blazor-loading-spinner p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Reconnection Modal */
.admin-reconnect-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  align-items: center;
  justify-content: center;
}

.admin-reconnect-modal.components-reconnect-modal {
  display: flex;
}

.admin-reconnect-card {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-align: center;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: slideIn 0.3s ease-out;
}

.admin-reconnect-card strong {
  font-size: 1.25rem;
  color: var(--text-primary);
  display: block;
}

.admin-reconnect-card span {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

