/* Fdskill — compact design system (entire admin app + shared UI) */

:root {
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow: 0 2px 10px rgba(73, 33, 8, 0.06);

  /*
   * Professional 4-size type scale (entire app).
   * xs 12px · sm 13px · md 14px · lg 16px (max — no display/h1 giants)
   */
  --font-xs: 0.75rem;
  --font-sm: 0.8125rem;
  --font-md: 0.875rem;
  --font-lg: 1rem;

  /* Legacy aliases — components keep working */
  --text-page-title: var(--font-lg);
  --text-section: var(--font-md);
  --text-card-title: var(--font-sm);
  --text-body: var(--font-sm);
  --text-body-lg: var(--font-md);
  --text-muted: var(--font-xs);
  --text-caption: var(--font-xs);
  --text-tab: var(--font-xs);
  --text-stat: var(--font-lg);
  --text-input: var(--font-sm);
  --text-display: var(--font-lg);
  --text-marketing-section: var(--font-md);
  --text-marketing-card: var(--font-md);
  --text-marketing-body: var(--font-sm);
  --text-marketing-muted: var(--font-xs);
  --text-marketing-caption: var(--font-xs);
  --text-marketing-price: var(--font-lg);

  --btn-py: 5px;
  --btn-px: 9px;
  --btn-font: var(--font-xs);
  --btn-radius: 6px;
  --btn-weight: 600;

  --gap-sm: 6px;
  --gap-md: 8px;
  --pad-card: 10px 12px;
  --pad-panel: 12px 14px;
}

/* Global typography — h1 same weight/size as page title, not marketing display */
body {
  font-size: var(--font-sm);
  line-height: 1.45;
}

h1,
h2 {
  font-size: var(--font-lg);
  font-weight: 700;
  line-height: 1.25;
}

h3,
h4 {
  font-size: var(--font-md);
  font-weight: 600;
  line-height: 1.3;
}

h5,
h6 {
  font-size: var(--font-sm);
  font-weight: 600;
  line-height: 1.35;
}

p,
li,
label,
td,
th {
  font-size: inherit;
}

small,
.muted {
  font-size: var(--font-xs);
}

.muted {
  font-size: var(--text-muted);
}

/* —— Admin shell base —— */
.portal-shell {
  font-size: var(--text-body);
  line-height: 1.4;
}

.portal-shell .page-space {
  padding: 12px 0 24px;
}

.portal-shell .admin-panel-card {
  padding: var(--pad-panel);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.portal-shell .admin-panel-card h2,
.portal-shell .panel-head-row h2,
.portal-shell h2.panel-title {
  margin: 0 0 6px;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: var(--text-page-title) !important;
  font-weight: 700 !important;
  line-height: 1.25;
  letter-spacing: 0;
}

.portal-shell .panel-head-row {
  gap: var(--gap-md);
  margin-bottom: 8px;
  align-items: center;
}

.portal-shell h3 {
  font-family: Inter, system-ui, sans-serif;
  font-size: var(--text-section);
  font-weight: 600;
  line-height: 1.3;
}

.portal-shell h4 {
  font-size: var(--text-card-title);
  font-weight: 600;
  line-height: 1.3;
}

.portal-shell .lm-subhead,
.portal-shell h3.lm-subhead,
.portal-shell h4.lm-subhead {
  font-size: var(--text-caption) !important;
  margin: 6px 0 4px !important;
  letter-spacing: 0.03em;
}

/* —— Stats —— */
.portal-shell .admin-stats {
  gap: var(--gap-sm);
  margin-bottom: 8px;
}

.portal-shell .stat-card {
  min-height: 0;
  padding: 4px 6px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.portal-shell .stat-card:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.portal-shell .stat-card h3 {
  font-family: Inter, system-ui, sans-serif !important;
  font-size: var(--text-stat) !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
}

.portal-shell .stat-card p {
  margin-top: 1px;
  font-size: var(--text-caption) !important;
  font-weight: 600 !important;
}

.portal-shell .module-stats {
  gap: var(--gap-sm);
  margin: 8px 0;
}

.portal-shell .module-stat {
  padding: 6px 8px;
  border-radius: var(--radius-md);
}

.portal-shell .module-stat span {
  font-size: var(--text-caption);
  margin-bottom: 2px;
}

.portal-shell .module-stat strong {
  font-size: var(--text-stat);
}

.portal-shell .module-section-title {
  margin: 8px 0 6px;
  font-size: var(--text-section);
  font-weight: 700;
}

/* —— Buttons —— */
.portal-shell .admin-main-action,
.portal-shell .small-admin-btn,
.portal-shell .admin-tool-btn,
.portal-shell button.admin-tool-btn,
.portal-shell a.admin-tool-btn,
.portal-shell a.small-admin-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1.25 !important;
  text-align: center !important;
  padding: var(--btn-py) var(--btn-px) !important;
  font-size: var(--btn-font) !important;
  font-weight: var(--btn-weight) !important;
  border-radius: var(--btn-radius) !important;
  min-height: 0 !important;
  box-shadow: 0 2px 6px rgba(153, 0, 0, 0.1);
}

.portal-shell .admin-main-action:hover,
.portal-shell .small-admin-btn:hover,
.portal-shell .admin-tool-btn:hover {
  transform: none;
}

.portal-shell .portal-task-actions .admin-main-action,
.portal-shell .portal-task-actions .small-admin-btn,
.portal-shell .portal-task-actions .admin-tool-btn,
.portal-shell .dash-quick-grid .admin-tool-btn,
.portal-shell .fin-quick-btns .admin-main-action,
.portal-shell .fin-quick-btns .small-admin-btn {
  min-height: 0 !important;
  padding: var(--btn-py) var(--btn-px) !important;
  font-size: var(--btn-font) !important;
  font-weight: var(--btn-weight) !important;
}

/* —— Tabs —— */
.portal-shell .adm-tabs,
.portal-shell .fees-tabs,
.portal-shell .hr-tabs,
.portal-shell .cc-tabs,
.portal-shell .lm-tabs {
  gap: 4px;
  margin-bottom: 8px;
}

.portal-shell .adm-tabs .admin-tool-btn,
.portal-shell .fees-tabs .admin-tool-btn,
.portal-shell .hr-tabs .admin-tool-btn,
.portal-shell .cc-tabs .admin-tool-btn,
.portal-shell .adm-tabs button,
.portal-shell .lm-tabs button {
  padding: 4px 8px !important;
  font-size: var(--text-tab) !important;
  min-height: 0 !important;
  font-weight: 600 !important;
}

/* —— Toolbars & filters —— */
.portal-shell .adm-toolbar,
.portal-shell .lms-toolbar,
.portal-shell .dt-toolbar {
  gap: var(--gap-sm);
  margin-bottom: 8px;
  padding: 6px 8px;
}

.portal-shell .lms-filter {
  font-size: var(--text-caption);
  gap: 2px;
}

.portal-shell .lms-filter select,
.portal-shell .lms-form-card input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='color']),
.portal-shell .lms-form-card select,
.portal-shell .lms-form-card textarea,
.portal-shell .adm-toolbar input:not([type='checkbox']):not([type='radio']),
.portal-shell .adm-toolbar select,
.portal-shell .dt-search,
.portal-shell .dt-filter select,
.portal-shell .dt-filter input:not([type='checkbox']):not([type='radio']) {
  font-size: var(--text-input) !important;
  min-height: 28px !important;
  padding: 4px 7px !important;
  border-radius: var(--btn-radius) !important;
}

.portal-shell input[type='checkbox'],
.portal-shell input[type='radio'] {
  width: 1rem !important;
  height: 1rem !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--maroon, #990000);
  cursor: pointer;
}

.portal-shell label:has(> input[type='checkbox']),
.portal-shell label:has(> input[type='radio']) {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* —— Forms & cards —— */
.portal-shell .lms-form-card {
  margin-bottom: 10px;
  padding: var(--pad-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.portal-shell .lms-form-card h3 {
  margin: 0 0 8px;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: var(--text-section) !important;
  font-weight: 600 !important;
}

.portal-shell .lms-form-grid {
  gap: var(--gap-sm);
}

.portal-shell .lms-form-grid label,
.portal-shell .lms-full {
  font-size: var(--text-caption);
  gap: 2px;
  font-weight: 600;
}

.portal-shell .lms-form-actions {
  gap: var(--gap-sm);
  margin-top: 8px;
}

/* —— List & entity cards —— */
.portal-shell .lms-student-list,
.portal-shell .lms-course-grid,
.portal-shell .lms-lesson-list {
  gap: var(--gap-sm);
}

.portal-shell .lms-student-card,
.portal-shell .lms-course-card,
.portal-shell .lms-lesson-row {
  padding: var(--pad-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.portal-shell .lms-student-card h3,
.portal-shell .lms-student-card.lm-lead-card h3 {
  font-family: Inter, system-ui, sans-serif !important;
  font-size: var(--text-card-title) !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

.portal-shell .lms-course-card h3 {
  font-family: Inter, system-ui, sans-serif !important;
  font-size: var(--text-section) !important;
  font-weight: 600 !important;
}

.portal-shell .lms-course-card__desc,
.portal-shell .lms-enroll-list li {
  font-size: var(--text-muted);
}

.portal-shell .lms-lesson-row h4 {
  font-size: var(--text-card-title);
  margin: 4px 0 2px;
}

.portal-shell .lms-badge,
.portal-shell .nav-badge {
  font-size: var(--text-caption);
  padding: 1px 6px;
}

/* —— Module tiles & nav —— */
.portal-shell .module-tiles {
  gap: var(--gap-sm);
  margin-bottom: 8px;
}

.portal-shell .module-tile {
  min-height: 64px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
}

.portal-shell .module-tile strong {
  font-size: var(--text-section);
  font-weight: 700;
}

.portal-shell .module-tile span {
  font-size: var(--text-muted);
}

.portal-shell .module-nav-item {
  padding: 5px 8px;
  min-height: 0;
  font-size: var(--text-body);
  font-weight: 600;
}

.portal-shell .module-nav-hint {
  font-size: var(--text-caption);
}

.portal-shell .notify-chip {
  padding: 3px 8px;
  font-size: var(--text-muted);
}

/* —— Tables —— */
.portal-shell table,
.portal-shell .lms-roi-table,
.portal-shell .lm-roi-table {
  font-size: var(--text-muted);
}

.portal-shell th,
.portal-shell td {
  padding: 4px 6px;
}

/* —— Sidebar tools column —— */
.portal-shell .admin-tools-row {
  padding: 10px;
  gap: 4px;
}

.portal-shell .admin-tools-row .admin-tool-btn,
.portal-shell .admin-submenu-btn {
  padding: 5px 8px;
  font-size: var(--text-tab);
  font-weight: 600;
  border-radius: var(--btn-radius);
}

/* —— Layout density —— */
.portal-shell .admin-panel-layout {
  gap: 10px;
}

/* —— Login (slightly compact, still readable) —— */
.login-shell .login-card h1 {
  font-size: var(--font-lg);
  font-weight: 700;
}

.login-shell .login-card label {
  font-size: var(--text-caption);
}

.login-shell .login-card input {
  padding: 8px 10px;
  font-size: var(--text-input);
  border-radius: var(--btn-radius);
}

.login-shell .login-card .admin-main-action {
  padding: 6px 12px;
  font-size: var(--btn-font);
  font-weight: var(--btn-weight);
  border-radius: var(--btn-radius);
}

.login-error {
  font-size: var(--text-body);
  padding: 6px 8px;
}

/* —— Module-specific stat/title harmonization —— */
.portal-shell .dash-hero__title,
.portal-shell .auto-page-title {
  font-size: var(--text-page-title) !important;
  font-weight: 700 !important;
}

.portal-shell .dash-tile__value,
.portal-shell .dash-trainer-stat strong,
.portal-shell .hr-stat strong {
  font-size: var(--text-stat) !important;
}

.portal-shell .dash-tile__label,
.portal-shell .dash-trainer-stat span {
  font-size: var(--text-caption) !important;
}

.portal-shell .auto-steps {
  font-size: var(--text-muted) !important;
}

@media (max-width: 900px) {
  :root {
    --font-xs: 0.75rem;
    --font-sm: 0.8125rem;
    --font-md: 0.875rem;
    --font-lg: 1rem;
    --text-input: 16px;
  }

  .portal-shell .admin-panel-card {
    padding: 10px 12px;
  }

  .portal-shell .adm-tabs .admin-tool-btn,
  .portal-shell .lm-tabs button {
    min-height: 44px !important;
  }

  .portal-shell .admin-main-action,
  .portal-shell .small-admin-btn,
  .portal-shell .admin-tool-btn,
  .portal-shell a.admin-main-action,
  .portal-shell a.small-admin-btn,
  .portal-shell a.admin-tool-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
  }
}

/* —— Public / marketing pages (pricing, signup, landing) —— */
.pricing-shell,
.signup-shell,
.login-shell,
.landing-shell {
  font-size: var(--text-marketing-body);
  line-height: 1.5;
  color: var(--text, #2b1b10);
}

.pricing-shell h1,
.signup-shell h1,
.landing-shell h1 {
  font-size: var(--font-lg);
  font-weight: 700;
  line-height: 1.25;
}

.pricing-shell h2,
.signup-shell h2,
.landing-shell h2 {
  font-size: var(--font-md);
  font-weight: 700;
  line-height: 1.3;
}

.pricing-shell h3,
.signup-shell h3,
.landing-shell h3 {
  font-size: var(--font-md);
  font-weight: 600;
  line-height: 1.35;
}

.pricing-shell .muted,
.signup-shell .muted,
.landing-shell .muted {
  font-size: var(--text-marketing-muted);
}

.pricing-shell p,
.signup-shell p,
.landing-shell p,
.pricing-shell li,
.signup-shell li,
.landing-shell li {
  font-size: inherit;
}

/* Safety net — legacy component CSS cannot exceed 4-size scale */
.portal-shell h1,
.portal-shell h2,
.pricing-shell h1,
.pricing-shell h2,
.signup-shell h1,
.signup-shell h2,
.login-shell h1,
.login-shell h2,
.landing-shell h1,
.landing-shell h2,
.brand h1,
.login-card h1 {
  font-size: var(--font-lg) !important;
  line-height: 1.25 !important;
}

.portal-shell h3,
.portal-shell h4,
.pricing-shell h3,
.pricing-shell h4,
.signup-shell h3,
.signup-shell h4,
.landing-shell h3,
.landing-shell h4,
.stat-card h3,
.module-stat strong,
.lms-course-card h3 {
  font-size: var(--font-md) !important;
  line-height: 1.3 !important;
}
