/* ==========================================================================
   Synergein ERP — UI prototype stylesheet
   --------------------------------------------------------------------------
   One file here; in React it splits along the "→" markers:
     → styles/global.css          tokens, reset, base (the ONLY global file)
     → <Component>.module.css     every other section, beside its component
   Class names are camelCase so they work as `styles.panelHeader` in CSS
   Modules. No element selectors outside the global section.
   Light and dark themes (tokens only). English only, left-to-right. Desktop, tablet (≤ 992px), mobile (≤ 600px).
   ========================================================================== */

/* ───────────────────────── → styles/global.css ───────────────────────── */
:root {
  /* brand */
  --navy-900: #0f2647;
  --navy-700: #1b3a6b;
  --navy-500: #2a4d82;
  --navy-100: #e8eef8;
  --navy-50:  #f4f7fc;
  --orange-600: #d14a09;
  --orange-500: #e8500a;
  --orange-100: #fff1e8;
  --orange-50:  #fff8f3;

  /* neutrals */
  --text:        #1b2a41;
  --text-soft:   #475569;
  --text-muted:  #64748b;
  --border:      #e3e8f0;
  --border-strong: #cbd5e1;
  --surface:     #ffffff;
  --surface-alt: #f6f8fb;
  --page-bg:     #f3f5f9;

  /* status */
  --success: #15803d;  --success-bg: #dcfce7;
  --danger:  #b91c1c;  --danger-bg:  #fee2e2;  --danger-border: #fecaca;
  --warning: #b45309;  --warning-bg: #fef3c7;
  --info:    #1b3a6b;  --info-bg:    #e8eef8;

  /* shape and depth */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 3px rgba(15, 38, 71, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 38, 71, 0.10);
  --shadow-lg: 0 20px 48px rgba(15, 38, 71, 0.22);
  --focus-ring: 0 0 0 3px rgba(27, 58, 107, 0.15);

  /* layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;

  /* theme-aware helpers (light values; dark values below) */
  --heading:      #1b3a6b;   /* navy TEXT (titles, names, links); backgrounds keep --navy-700 */
  --badge-muted-bg: #eef1f5;
  --error-bg:     #fff7f7;
  --notice-border: #c7d4ea;
  --input-hover:  #94a3b8;
  --veil:         rgba(243, 245, 249, 0.65);
  --focus-border: #1b3a6b;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231b3a6b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --transition: 150ms ease;
}

/* Dark mode: <html data-theme="dark">. Only the tokens change; every component already uses them.
   Brand surfaces (sidebar brand, page header, table header, modal header) stay navy in both themes. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy-100: #1c2a4a;
  --navy-50:  #142038;
  --orange-100: #3a2113;
  --orange-50:  #2a1a12;

  --text:        #e6ebf5;
  --text-soft:   #b3bfd6;
  --text-muted:  #8593ad;
  --border:      #26324d;
  --border-strong: #33415f;
  --surface:     #111a2e;
  --surface-alt: #16213a;
  --page-bg:     #0b1220;

  --success: #4ade80;  --success-bg: #12391f;
  --danger:  #f87171;  --danger-bg:  #3f1515;  --danger-border: #7f1d1d;
  --warning: #fbbf24;  --warning-bg: #3b2f0a;
  --info:    #9db8e8;  --info-bg:    #1c2a4a;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6);
  --focus-ring: 0 0 0 3px rgba(245, 122, 58, 0.25);

  --heading:      #e6ebf5;
  --badge-muted-bg: #1c2a4a;
  --error-bg:     #2a1215;
  --notice-border: #26324d;
  --input-hover:  #4a5a7d;
  --veil:         rgba(11, 18, 32, 0.65);
  --focus-border: #f57a3a;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23cbd5e1' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--heading); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--navy-500); outline-offset: 2px; }

/* ───────────────────────── → layout/AppLayout.module.css ───────────────────────── */
.appShell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 40;
  transition: transform 200ms ease;
}
.sidebarBrand {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-height); padding: 0 20px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff; text-decoration: none; flex: none;
}
.brandMark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--orange-500); font-weight: 700; font-size: 16px;
}
.brandName { font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }
.brandSub { font-size: 10.5px; opacity: 0.75; }

.nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.navItem, .navGroupToggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; margin-bottom: 2px;
  border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 13px;
  cursor: pointer; text-align: left; transition: background var(--transition), color var(--transition);
}
.navItem:hover, .navGroupToggle:hover { background: var(--orange-50); color: var(--orange-500); }
.navItemActive { background: var(--orange-50); color: var(--orange-500); box-shadow: inset 3px 0 0 var(--orange-500); }
.navIcon {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-size: 12px;
  background: var(--navy-100); color: var(--heading);
}
.navItemActive .navIcon, .navGroupOpen > .navGroupToggle .navIcon { background: var(--orange-500); color: #fff; }
.navChevron { margin-left: auto; font-size: 10px; color: var(--text-muted); transition: transform var(--transition); }
.navGroupOpen > .navGroupToggle .navChevron { transform: rotate(180deg); color: var(--orange-500); }
.navSub { display: none; margin: 2px 0 8px 26px; padding-left: 12px; border-left: 1px solid var(--border); }
.navGroupOpen > .navSub { display: block; }
.navSubItem {
  display: block; padding: 7px 10px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft); text-decoration: none; font-size: 12.5px;
}
.navSubItem:hover { color: var(--orange-500); background: var(--orange-50); }
.navSubItemActive { color: var(--orange-500); font-weight: 600; background: var(--orange-50); box-shadow: inset 2px 0 0 var(--orange-500); }

.sidebarFooter {
  margin: 10px; padding: 12px; display: flex; align-items: center; gap: 10px;
  background: var(--orange-50); border: 1px solid #fde1d1; border-radius: var(--radius-md);
}

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-height); flex: none;
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.menuToggle {
  display: none; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; color: var(--heading);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); min-width: 0; }
.breadcrumb i { font-size: 10px; }
.breadcrumbHome { color: var(--orange-500); }
.breadcrumbCurrent { color: var(--heading); font-weight: 600; }
.topbarSpacer { flex: 1; }
.userMenu { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--navy-500), var(--navy-700));
  color: #fff; font-weight: 600; font-size: 12px; text-transform: uppercase;
}
.userMenuText { display: flex; flex-direction: column; line-height: 1.2; }
.userMenuName { font-weight: 600; font-size: 12.5px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userMenuRole { font-size: 11px; color: var(--text-muted); }
.signOut {
  height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface);
  color: var(--text-soft); font-weight: 500; font-size: 12.5px; cursor: pointer;
}
.signOut { text-decoration: none; }
.themeToggle {
  width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface);
  color: var(--text-soft); cursor: pointer; transition: border-color var(--transition), color var(--transition);
}
.themeToggle:hover { border-color: var(--orange-500); color: var(--orange-500); }
.signOut:hover { border-color: var(--danger-border); color: var(--danger); }

.content { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 24px 28px 40px; }
.footer { padding: 16px 28px; font-size: 11.5px; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--surface); }

.backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 38, 71, 0.45); z-index: 35; }

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebarOpen .sidebar { transform: none; }
  .sidebarOpen .backdrop { display: block; }
  .main { margin-left: 0; }
  .menuToggle { display: inline-grid; place-items: center; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 32px; }
}
@media (max-width: 600px) {
  .userMenuText, .signOutLabel { display: none; }
}

/* ───────────────────────── → components/PageHeader.module.css ───────────────────────── */
.pageHeader {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 22px 26px; margin-bottom: 20px; border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(232, 80, 10, 0.45), rgba(232, 80, 10, 0) 45%),
    linear-gradient(120deg, var(--navy-900), var(--navy-700) 60%, var(--navy-500));
  color: #fff; box-shadow: var(--shadow-md);
}
.pageTitle { font-size: 22px; font-weight: 700; letter-spacing: -0.2px; }
.pageSubtitle { margin-top: 2px; font-size: 13px; color: #cfd9ea; }
.pageActions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ───────────────────────── → components/Button.module.css ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btnPrimary { background: var(--navy-700); color: #fff; box-shadow: 0 2px 6px rgba(27, 58, 107, 0.25); }
.btnPrimary:hover:not(:disabled) { background: var(--navy-900); }
.btnAccent { background: var(--orange-500); color: #fff; box-shadow: 0 4px 12px rgba(232, 80, 10, 0.3); }
.btnAccent:hover:not(:disabled) { background: var(--orange-600); }
.btnSecondary { background: var(--surface); color: var(--heading); border-color: var(--border-strong); }
.btnSecondary:hover:not(:disabled) { border-color: var(--orange-500); color: var(--orange-500); }
.btnDanger { background: var(--danger); color: #fff; }
.btnDanger:hover:not(:disabled) { background: #991b1b; }
.btnSm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btnBlock { width: 100%; }

.btnIcon {
  width: 30px; height: 30px; display: inline-grid; place-items: center;
  border: 0; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px;
  transition: background var(--transition), color var(--transition);
}
.btnIconEdit { background: var(--navy-100); color: var(--heading); }
.btnIconEdit:hover { background: var(--navy-700); color: #fff; }
.btnIconKey { background: var(--orange-100); color: var(--orange-600); }
.btnIconKey:hover { background: var(--orange-500); color: #fff; }
.btnIconDanger { background: var(--danger-bg); color: var(--danger); }
.btnIconDanger:hover { background: var(--danger); color: #fff; }
.btnIcon:disabled { opacity: 0.4; cursor: not-allowed; }

/* ───────────────────────── → components/Panel.module.css ───────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.panelHeader {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.panelTitleWrap { display: flex; align-items: center; gap: 12px; }
.panelIcon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--orange-500); color: #fff; box-shadow: 0 6px 14px rgba(232, 80, 10, 0.3);
}
.panelTitle { font-size: 15px; font-weight: 700; color: var(--heading); }
.panelMeta { font-size: 11.5px; color: var(--text-muted); }
.panelBody { padding: 22px 20px; }
.panelFooter {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted);
}

/* ───────────────────────── → components/ListToolbar.module.css ───────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--navy-50); border-bottom: 1px solid var(--border);
}
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.searchIcon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 12px; }
.searchInput { padding-left: 34px !important; }
.toolbarSpacer { flex: 1; }
.toolbarLabel { font-size: 12px; color: var(--text-muted); }

/* ───────────────────────── → components/DataTable.module.css ───────────────────────── */
.tableWrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 13px 16px; text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  background: var(--navy-700); color: #fff; border-bottom: 3px solid var(--orange-500);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.table tbody tr:nth-child(even) td { background: var(--surface-alt); }
.table tbody tr:hover td { background: var(--orange-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.colActions { width: 1%; white-space: nowrap; }
.cellStrong { font-weight: 600; color: var(--heading); }
.cellMuted { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.rowActions { display: flex; gap: 6px; }
.who { display: flex; align-items: center; gap: 10px; }
.whoText { display: flex; flex-direction: column; line-height: 1.25; }
.whoName { font-weight: 600; color: var(--heading); }
.whoSub { font-size: 11.5px; color: var(--text-muted); }
.youTag { font-size: 10.5px; color: var(--orange-500); font-weight: 600; }

.emptyState { padding: 48px 16px; text-align: center; color: var(--text-muted); }
.emptyStateIcon { font-size: 28px; color: var(--border-strong); margin-bottom: 8px; }

/* ───────────────────────── → components/Badge.module.css ───────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badgeSuccess { background: var(--success-bg); color: var(--success); }
.badgeMuted   { background: var(--badge-muted-bg); color: var(--text-muted); }
.badgeAccent  { background: var(--orange-100); color: var(--orange-600); }
.badgeInfo    { background: var(--info-bg); color: var(--info); }

/* ───────────────────────── → components/Pagination.module.css ───────────────────────── */
.pager { display: flex; gap: 6px; }
.pagerBtn {
  min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--heading); font-weight: 600; font-size: 12px; cursor: pointer;
}
.pagerBtn:hover:not(:disabled) { border-color: var(--orange-500); color: var(--orange-500); }
.pagerBtn:disabled { opacity: 0.4; cursor: default; }
.pagerBtnActive { background: var(--orange-500); border-color: var(--orange-500); color: #fff; }

/* ───────────────────────── → components/Form.module.css ───────────────────────── */
.formGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.fieldFull { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.required { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 13px; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: var(--chevron);
  background-repeat: no-repeat; background-position: right 12px center; background-size: 11px;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--input-hover); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus-border); box-shadow: var(--focus-ring); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-alt); color: var(--text-muted); cursor: not-allowed; }
.inputInvalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.08) !important; }
.hint { font-size: 11.5px; color: var(--text-muted); }
.fieldError { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; color: var(--danger); }
.fieldError ul { list-style: none; }
.readonlyValue {
  height: 40px; display: flex; align-items: center; padding: 0 12px;
  border-radius: var(--radius-sm); background: var(--surface-alt); color: var(--heading); font-weight: 600;
}
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--navy-700); cursor: pointer; }
.check input:disabled { cursor: not-allowed; }
.formActions {
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-alt);
}
.sectionTitle {
  grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; color: var(--heading);
  padding-left: 10px; border-left: 3px solid var(--orange-500);
}

@media (max-width: 700px) {
  .formGrid { grid-template-columns: 1fr; }
}

/* ───────────────────────── → components/ErrorBox.module.css ───────────────────────── */
/* The ONE standard error box. Shows an API ProblemDetails (title, detail,
   correlationId) or a network error. Used at the top of a page, a form or a modal. */
.errorBox {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 18px;
  border: 1px solid var(--danger-border); border-left: 4px solid var(--danger);
  border-radius: var(--radius-md); background: var(--error-bg);
}
.errorBoxIcon { color: var(--danger); font-size: 16px; margin-top: 1px; }
.errorBoxBody { flex: 1; min-width: 0; }
.errorBoxTitle { font-weight: 700; color: var(--danger); font-size: 13px; }
.errorBoxMessage { color: var(--text); font-size: 13px; margin-top: 2px; }
.errorBoxRef { margin-top: 6px; font-size: 11px; color: var(--text-muted); word-break: break-all; }
.errorBoxClose { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.errorBoxClose:hover { color: var(--danger); }

/* Neutral notice (read-only explanations, not errors) */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; margin-bottom: 18px;
  border: 1px solid var(--notice-border); border-left: 4px solid var(--navy-500);
  border-radius: var(--radius-md); background: var(--navy-50); font-size: 13px;
}
.noticeIcon { color: var(--heading); margin-top: 2px; }

/* ───────────────────────── → components/Loader.module.css ───────────────────────── */
/* Full-screen loader shown while ANY API request is in flight
   (React: a global counter of pending requests; show after ~150 ms to avoid flicker). */
.loaderOverlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--veil); backdrop-filter: blur(2px);
}
.loaderCard {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 30px; border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid var(--navy-100); border-top-color: var(--orange-500);
  animation: spin 0.8s linear infinite;
}
.loaderText { font-size: 12.5px; color: var(--text-soft); font-weight: 500; }
.btnSpinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────────────────── → components/Toast.module.css ───────────────────────── */
.toastStack { position: fixed; right: 20px; bottom: 20px; z-index: 110; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px;
  padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--success); box-shadow: var(--shadow-lg); font-size: 13px;
}
.toastIcon { color: var(--success); }

/* ───────────────────────── → components/Modal.module.css ───────────────────────── */
.modalBackdrop {
  position: fixed; inset: 0; z-index: 90; padding: 16px;
  display: grid; place-items: center; background: rgba(15, 38, 71, 0.5);
}
.modal {
  width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.modalSm { max-width: 420px; }
.modalHeader {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); color: #fff;
}
.modalTitle { font-size: 15px; font-weight: 700; }
.modalClose {
  width: 30px; height: 30px; border: 0; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer;
}
.modalClose:hover { background: var(--orange-500); }
.modalBody { padding: 20px; overflow: auto; }
.modalFooter { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modalBody:has(> .confirmIcon) { text-align: center; }
.confirmIcon {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px;
  background: var(--danger-bg); color: var(--danger); font-size: 18px;
}

/* ───────────────────────── → pages/RolePermissionsPage.module.css ───────────────────────── */
.permToolbar { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 16px; align-items: end; }
.roleSummary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.permGroup { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-top: 18px; }
.permGroupHeader {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--navy-700); color: #fff;
}
.permGroupTitle { font-weight: 700; font-size: 13.5px; }
.permGroupHeader .check { color: #fff; font-size: 12.5px; }
.permGroupHeader .check input { accent-color: var(--orange-500); }
.permTable { width: 100%; border-collapse: collapse; table-layout: fixed; }
.permTable th {
  padding: 10px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); background: var(--surface-alt); border-bottom: 1px solid var(--border); text-align: center;
}
.permTable th:first-child, .permTable td:first-child { text-align: left; width: 40%; }
.permTable td { padding: 12px; border-bottom: 1px solid var(--border); text-align: center; }
.permTable tbody tr:last-child td { border-bottom: 0; }
.permTable tbody tr:hover td { background: var(--orange-50); }
.permTable input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy-700); cursor: pointer; }
.permTable input[type="checkbox"]:disabled { cursor: not-allowed; }
.permModule { font-weight: 600; color: var(--heading); }
.permCode { display: block; font-size: 10.5px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.3px; }
.permNA { color: var(--border-strong); }
@media (max-width: 700px) {
  .permToolbar { grid-template-columns: 1fr; }
  .roleSummary { justify-content: flex-start; }
  .permTable th:first-child, .permTable td:first-child { width: 34%; }
  .permTable th, .permTable td { padding: 10px 2px; }
  .permTable th { font-size: 9.5px; letter-spacing: 0; text-transform: none; }
}

/* ───────────────────────── → pages/LoginPage.module.css ───────────────────────── */
.loginPage {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 90% 5%, rgba(232, 80, 10, 0.35), rgba(232, 80, 10, 0) 40%),
    linear-gradient(135deg, var(--navy-700), var(--navy-900));
}
.loginCard {
  width: 100%; max-width: 420px; padding: 36px 34px 30px; position: relative;
  background: var(--surface); border-radius: 18px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.loginBrand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.loginBrand .brandMark { width: 48px; height: 48px; font-size: 20px; color: #fff; border-radius: 14px; }
.loginTitle { font-size: 19px; font-weight: 700; color: var(--heading); }
.loginSub { font-size: 12.5px; color: var(--text-muted); }
.loginForm { display: flex; flex-direction: column; gap: 16px; }
.passwordWrap { position: relative; }
.passwordWrap .input { padding-right: 42px; }
.passwordToggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: none; color: var(--text-muted); cursor: pointer;
}
.loginFooter { margin-top: 18px; text-align: center; font-size: 11.5px; color: var(--text-muted); }

/* ───────────────────────── prototype-only (not ported) ───────────────────────── */
.isHidden { display: none !important; }
.protoNote {
  margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: #fffbea; border: 1px dashed #f59e0b; color: #92400e; font-size: 12px;
}
.stack { display: flex; flex-direction: column; gap: 22px; }

/* small helpers (→ go with the component that uses them) */
.selectNarrow { width: 84px; }
.stackTight { gap: 16px; }
