/* F2MG unified visual refresh 3.42.0. Visual-only overrides; app workflows remain in their existing files. */
:root {
  --navy: #111827;
  --blue: #1f2937;
  --ink: #17202e;
  --muted: #748091;
  --line: #e4e7eb;
  --soft: #f4f5f7;
  --white: #fff;
  --gold: #c6a76b;
  --danger: #b94c4c;
  --shadow: 0 12px 34px rgba(17, 24, 39, .08);
  color-scheme: light;
}

html { scroll-padding-top: 82px; }
body { color: var(--ink); background: #f4f5f7; font-family: "Pretendard", "Noto Sans KR", Arial, sans-serif; }
body:not(.workspace-mode) .brand-panel {
  background: radial-gradient(ellipse at 85% 78%, rgba(198,167,107,.11), transparent 34%), linear-gradient(145deg,#101725,#151b26 65%,#242629);
}
body:not(.workspace-mode) .brand-copy h1 { max-width: 10em; font-size: clamp(38px,4.5vw,58px); line-height: 1.08; letter-spacing: -.055em; }
body:not(.workspace-mode) .brand-copy h1 span { color: #c6a76b; }
body:not(.workspace-mode) .brand-copy .eyebrow { color: #c6a76b; }
body:not(.workspace-mode) .auth-panel { background: #f4f5f7; }
#login-view.auth-card {
  border: 1px solid #e7e8eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(17,24,39,.08);
}
#login-view .primary-button { background: #111827; box-shadow: none; }
#login-view .primary-button:hover { background: #202b3b; }
#login-view .field-wrap input { background: #fff; }
.f2mg-wordmark, .workspace-mode .f2mg-wordmark { color: #111827; }

/* Shared workspace frame and centered brand. */
body.workspace-mode { overflow-x: clip; background: #f4f5f7; }
body.workspace-mode::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 64px;
  pointer-events: none;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(17,24,39,.035);
}
body.workspace-mode #dashboard-view::before {
  content: "F2MG";
  position: fixed;
  z-index: 103;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #111827;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.06em;
  line-height: 26px;
  pointer-events: none;
}
body.workspace-mode .auth-panel {
  display: block;
  min-height: 100vh;
  height: auto;
  padding: 84px 24px 36px;
  overflow: visible;
  background: #f4f5f7;
}
body.workspace-mode .dashboard-card:not(.embed-workspace),
body.workspace-mode .data-view,
body.workspace-mode .account-view,
body.workspace-mode .role-portal {
  width: min(100%, 1200px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.workspace-mode .dash-head { align-items: center; gap: 16px; margin-bottom: 16px; }
body.workspace-mode .dash-head h2,
body.workspace-mode .view-head h2 { color: #17202e; font-size: 20px; font-weight: 750; letter-spacing: -.035em; }
body.workspace-mode .dash-head p:not(.eyebrow),
body.workspace-mode .view-head p:last-child { color: #748091; font-size: 13px; line-height: 1.55; }
body.workspace-mode .eyebrow { margin-bottom: 5px; color: #9a8051; font-size: 10px; letter-spacing: .14em; }
body.workspace-mode .status-banner { margin: 12px 0 16px; padding: 10px 12px; border-radius: 7px; }
body.workspace-mode .status-banner p { font-size: 12px; }

/* Top-left menu and drawer. */
#workspace-menu-toggle {
  display: none;
  position: fixed;
  z-index: 112;
  top: 10px;
  left: 12px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #e4e7eb;
  border-radius: 7px;
  background: #fff;
  color: #17202e;
  box-shadow: 0 2px 7px rgba(17,24,39,.06);
}
body.workspace-mode #workspace-menu-toggle { display: flex; flex-direction: row; }
#workspace-menu-toggle b { display: none; }
#workspace-menu-toggle svg { width: 19px; height: 19px; }
#workspace-menu-toggle:hover { background: #f7f7f5; border-color: #c6a76b; }
#workspace-side-menu {
  z-index: 120;
  width: 310px;
  max-width: min(310px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-right: 1px solid #e2e5e9;
  background: #fff;
  color: #17202e;
  box-shadow: 16px 0 44px rgba(17,24,39,.16);
}
#workspace-side-menu::backdrop { background: rgba(17,24,39,.48); }
#workspace-side-menu header { padding: 20px 18px; background: #111827; border: 0; color: #fff; }
#workspace-side-menu header .eyebrow { color: #c6a76b; }
#workspace-side-menu header h2 { color: #fff; font-size: 18px; }
#workspace-side-menu header .f2mg-wordmark { color: #fff; }
#side-menu-close { width: 38px; height: 38px; border: 1px solid #ffffff2a; border-radius: 6px; background: #ffffff0d; color: #fff; }
#side-menu-user { padding: 12px 18px; background: #f5f6f7; color: #657183; font-size: 12px; }
#side-menu-list { padding: 8px 12px 16px; }
#workspace-side-menu .wm-shortcuts { border-color: #e8eaed; }
#workspace-side-menu .wm-link { min-height: 40px; color: #465163; }
#workspace-side-menu .wm-link b { font-size: 13px; }
#workspace-side-menu .wm-group-toggle { min-height: 42px; color: #17202e; }
#workspace-side-menu .wm-group-toggle b { font-size: 13px; font-weight: 700; }
#workspace-side-menu .wm-link[aria-current="page"] { background: #f5f0e5; color: #342c1b; }
#workspace-side-menu .wm-group-toggle:hover,
#workspace-side-menu .wm-link:hover,
#workspace-side-menu .wm-sub-toggle:hover { background: #f5f6f7; }
#workspace-side-menu footer { position: sticky; bottom: 0; padding: 10px 14px max(12px,env(safe-area-inset-bottom)); border-top: 1px solid #e8eaed; background: #fff; }
#side-menu-logout { min-height: 40px; border-radius: 6px; background: #111827; }
body.side-menu-open { overflow: hidden; }

/* Cards, navigation tabs, forms, tables and dialogs share one compact system. */
.module-grid, body.workspace-mode .module-grid { gap: 10px; }
.module-grid button, body.workspace-mode .module-grid button {
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #e3e6ea;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(17,24,39,.035);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.module-grid button:hover { transform: translateY(-1px); border-color: #c6a76b; box-shadow: 0 6px 16px rgba(17,24,39,.08); }
.module-grid b, body.workspace-mode .module-grid b { margin-top: 7px; color: #17202e; font-size: 14px; }
.module-grid small, body.workspace-mode .module-grid small { color: #7b8492; font-size: 11px; }
.role-page-nav-wrap { margin: 12px 0 16px; }
.role-page-nav, body.workspace-mode .role-page-nav {
  gap: 5px;
  padding: 5px;
  border: 1px solid #e3e6ea;
  border-radius: 7px;
  background: #fff;
}
.role-page-nav button {
  min-height: 38px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #596576;
  font-size: 12px;
}
.role-page-nav button.active { border-color: #111827; background: #111827; color: #fff; }
.role-page-nav button small { color: #8b94a1; }
.role-page-nav button.active small { color: #d6dbe2; }
.search-form { gap: 7px; margin: 14px 0 10px; }
.search-form input,
.field-wrap input,
.editor-field input,
.editor-field select,
.editor-field textarea,
.view-filters input,
.view-filters select,
.view-filters textarea,
.student-toolbar input,
.student-toolbar select,
.account-toolbar input,
.account-toolbar select {
  border-color: #dfe3e8;
  border-radius: 6px;
  background-color: #fff;
  color: #17202e;
  box-shadow: none;
}
.search-form input:focus,
.field-wrap input:focus,
.editor-field :is(input,select,textarea):focus,
.view-filters :is(input,select,textarea):focus {
  border-color: #9b8355;
  outline: 2px solid rgba(198,167,107,.18);
  outline-offset: 0;
}
.search-form button,
.primary-button,
.add-button.compact,
.add-button,
.student-toolbar button,
.records-toolbar button:not(.text-button),
.modal-actions .primary-button {
  border-radius: 6px;
  background: #111827;
  color: #fff;
  box-shadow: none;
}
.search-form button:hover,
.primary-button:hover,
.records-toolbar button:hover { background: #253145; }
.secondary-button,.mini-button,.detail-button,.edit-button,.text-button,.back-button {
  border-color: #dfe3e8;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  box-shadow: none;
}
.secondary-button,.mini-button,.detail-button,.edit-button,.text-button,
.search-form button,.primary-button,.add-button.compact { min-height: 36px; height: 36px; padding-inline: 14px; font-size: 13px; }
.back-button { width: 36px; height: 36px; }
.view-filters { gap: 8px; margin: 8px 0 12px; padding: 12px; border-color: #e3e6ea; border-radius: 7px; background: #fff; }
.view-filters label,.editor-field>span { color: #687486; font-size: 12px; }
.records-list,.student-list { gap: 7px; }
.record-card,.student-card,.roster-card,.qualification-group,.management-panel,.qnet-form,
.weekly-card,.schedule-record,.modal-card,.confirm-list {
  border-color: #e3e6ea;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(17,24,39,.035);
}
.record-card { padding: 12px 14px; }
.record-card .record-title span { color: #17202e; font-size: 14px; }
.record-card b,.student-card dt { color: #7a8492; }
.record-card span,.student-card dd { color: #354153; }
.student-card { padding: 12px; }
.student-avatar { border-radius: 6px; background: #f5f0e5; color: #816a3e; }
.student-card dl { border-color: #eaecf0; }
.record-actions { gap: 5px; }
.record-actions .edit-button,.record-actions .detail-button,.record-actions button {
  min-height: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
}
.modal { background: rgba(17,24,39,.52); }
.modal-card { width: min(720px,100%); max-height: 90dvh; padding: 20px; }
.modal-card h2 { color: #17202e; font-size: 18px; }
.modal-card>header { border-color: #e6e8ec; }
.modal-card header button { border-radius: 6px; background: #f3f4f6; color: #344054; }
.modal-actions { gap: 6px; }
.toast { border-radius: 6px; background: #111827; }
:is(button,input,select,textarea,a,[tabindex]):focus-visible { outline-color: rgba(155,131,85,.48); }

/* ERP workspace dialog follows the same navy, warm-neutral and gold system. */
#management-dashboard-dialog {
  border-color: #e1e4e8;
  border-radius: 8px;
  background: #f4f5f7;
  color: #17202e;
  box-shadow: 0 18px 54px rgba(17,24,39,.2);
}
#management-dashboard-dialog .md-header { border-color: #e5e7eb; background: #fff; }
#management-dashboard-dialog .md-brandText strong { color: #17202e; }
#management-dashboard-dialog .md-logo { border-color: #e3e6ea; border-radius: 6px; }
#management-dashboard-dialog .md-nav { border-color: #253143; background: #111827; }
#management-dashboard-dialog .md-navGroup { border-color: #ffffff17; }
#management-dashboard-dialog .md-navGroupToggle { color: #e7ebf0; }
#management-dashboard-dialog .md-navGroupToggle:hover,
#management-dashboard-dialog .md-navItem:hover { background: #ffffff12; color: #fff; }
#management-dashboard-dialog .md-navArrow { color: #9ca7b5; }
#management-dashboard-dialog .md-navItem { color: #b8c1cd; }
#management-dashboard-dialog .md-navItem[aria-current="page"] { background: #ffffff12; color: #e8d4a8; }
#management-dashboard-dialog .md-main { background: #f4f5f7; }
#management-dashboard-dialog .md-pageHead h2 { color: #17202e; }
#management-dashboard-dialog .md-card,
#management-dashboard-dialog .md-panel,
#management-dashboard-dialog .md-branchCard {
  border-color: #e3e6ea;
  border-radius: 7px;
  box-shadow: 0 2px 7px rgba(17,24,39,.04);
}
#management-dashboard-dialog .md-tabs { border-color: #e3e6ea; }
#management-dashboard-dialog .md-tab[aria-selected="true"] { border-bottom-color: #c6a76b; color: #806a42; }
#management-dashboard-dialog .md-table th { background: #f6f6f4; }
#management-dashboard-dialog .md-control :is(input,select) { border-color: #dfe3e8; border-radius: 6px; }
#management-dashboard-dialog .md-button { border-radius: 6px; }
#management-dashboard-dialog .md-status { border-color: #d5e8df; background: #f1f8f4; color: #287255; }
@media (max-width: 767px) {
  #management-dashboard-dialog .md-nav { border-color: #253143; }
}

/* CBT opens as one continuous workspace below the shared portal bar. */
body.workspace-mode:has(.embed-workspace) .auth-panel {
  height: 100dvh;
  min-height: 100dvh;
  padding: 64px 0 0;
  overflow: hidden;
  background: #f4f5f7;
}
body.workspace-mode .dashboard-card.embed-workspace {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.embed-workspace .dash-head { display: none !important; }
#cbt-workspace-view {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: #f4f5f7;
}
#cbt-workspace-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #f4f5f7;
}
body.focus-mode-active #dashboard-view::before { display: none !important; }
body.focus-mode-active .dashboard-card.embed-workspace { min-height: 100dvh; }

@media (min-width: 1024px) {
  body.workspace-mode .auth-panel:not(:has(.embed-workspace)) { padding-inline: 38px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  body.workspace-mode .auth-panel { padding-inline: 20px; }
  .module-grid,body.workspace-mode .module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .role-page-nav,body.workspace-mode .role-page-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 767px) {
  body.workspace-mode::before { height: 58px; }
  body.workspace-mode #dashboard-view::before { top: 17px; font-size: 15px; line-height: 24px; }
  body.workspace-mode .auth-panel { min-height: 100svh; padding: 72px 12px max(20px,env(safe-area-inset-bottom)); }
  body.workspace-mode .dashboard-card:not(.embed-workspace),body.workspace-mode .data-view,
  body.workspace-mode .account-view,body.workspace-mode .role-portal { padding: 8px 0 20px; }
  body.workspace-mode .dash-head { align-items: flex-start; }
  body.workspace-mode .dash-head h2,body.workspace-mode .view-head h2 { font-size: 18px; }
  .module-grid,body.workspace-mode .module-grid { grid-template-columns: minmax(0,1fr); gap: 7px; }
  .module-grid button,body.workspace-mode .module-grid button { min-height: 62px; padding: 10px 12px; }
  .role-page-nav,body.workspace-mode .role-page-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .role-page-nav button { min-height: 40px; }
  .view-filters { grid-template-columns: minmax(0,1fr); padding: 10px; }
  .search-form { position: sticky; top: 58px; z-index: 5; padding: 6px 0; background: rgba(244,245,247,.96); }
  .records-list,.student-list { max-height: none; overflow: visible; }
  .record-actions { flex-wrap: wrap; }
  .record-actions .edit-button,.record-actions .detail-button,.record-actions button { min-height: 40px; height: 40px; flex: 1 1 auto; }
  #workspace-menu-toggle { top: 8px; left: 9px; width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  #workspace-side-menu { width: min(310px,86vw); max-width: 86vw; }
  body.workspace-mode:has(.embed-workspace) .auth-panel { padding: 58px 0 0; }
}
@media print {
  body.workspace-mode::before,body.workspace-mode #dashboard-view::before { display: none !important; }
  body.workspace-mode .auth-panel { padding: 0 !important; }
}
