:root {
  --ink: #06131c;
  --muted: #6c747c;
  --line: #d7e0e5;
  --cyan: #08add4;
  --paper: #f2f5f7;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #e7ecef; }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: Arial, "Noto Sans TC", sans-serif; }
button, input, select { font: inherit; }

.login-page {
  background-color: #e8edf0;
  background-image: linear-gradient(rgba(6, 19, 28, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(6, 19, 28, .035) 1px, transparent 1px);
  background-size: 32px 32px;
}

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 42%) 1fr; }
.brand-panel { position: relative; min-height: 100vh; padding: 54px 48px 44px; color: white; background: linear-gradient(145deg, #06131c 0%, #071c28 70%, #083144 100%); border-right: 5px solid var(--cyan); }
.brand-mark { display: inline-block; min-width: 280px; padding: 23px 44px; color: var(--ink); background: white; text-decoration: none; font-weight: 800; letter-spacing: 2px; }
.brand-mark span { color: var(--cyan); }
.brand-copy { position: absolute; left: 48px; top: 42%; transform: translateY(-50%); }
.brand-copy small, .secure-label, .login-card > small, .eyebrow { letter-spacing: 2.3px; font: 700 10px/1.5 monospace; }
.brand-copy h1 { margin: 20px 0 8px; font-size: clamp(58px, 7vw, 92px); line-height: .9; }
.brand-copy p { margin: 0; letter-spacing: 6px; color: #c6d2d8; }
.secure-label { position: absolute; left: 48px; bottom: 44px; color: #9eb4bf; }

.form-zone { position: relative; display: grid; place-items: center; padding: 64px 8vw 90px; }
.login-card { width: min(520px, 100%); padding: 56px 52px 48px; background: rgba(255,255,255,.96); border: 1px solid #edf1f3; box-shadow: 22px 22px 0 rgba(3, 23, 34, .055); }
.accent-line { display: flex; height: 6px; margin: -56px -52px 52px; background: var(--ink); }
.accent-line span { width: 34%; background: var(--cyan); }
.login-card h2 { margin: 20px 0 10px; font-size: 36px; font-weight: 400; letter-spacing: 3px; }
.login-card > p { margin: 0 0 34px; color: var(--muted); }
.login-card label { display: block; margin: 18px 0 9px; font-size: 13px; font-weight: 700; }
.login-card input { width: 100%; height: 62px; padding: 0 18px; border: 1px solid #aab9c0; border-left: 5px solid var(--cyan); background: white; outline: none; }
.login-card input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(8,173,212,.14); }
.password-field { display: grid; grid-template-columns: 1fr auto; }
.password-field input { border-right: 0; }
.password-field button { min-width: 64px; border: 1px solid #aab9c0; background: #eef3f5; cursor: pointer; }
.submit { width: 100%; height: 62px; margin-top: 36px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; color: white; background: #020b11; border: 0; border-bottom: 5px solid var(--cyan); cursor: pointer; }
.submit:hover { background: #0b2735; }
.forgot { display: inline-block; margin-top: 18px; color: #314d5a; font-size: 12px; }
.alert { margin: 0 0 20px; padding: 13px 15px; color: #7a1520; background: #fff1f2; border-left: 4px solid #b42331; }
.copyright { position: absolute; bottom: 36px; color: #87949a; letter-spacing: 2px; font: 9px monospace; }

.dashboard-page { background: var(--paper); }
.dashboard-header { min-height: 78px; padding: 0 6vw; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--ink); border-bottom: 4px solid var(--cyan); }
.dashboard-header div { display: flex; align-items: center; gap: 24px; }
.dashboard-header div span { color: #b9c7ce; }
.dashboard-header button { padding: 10px 16px; color: white; background: transparent; border: 1px solid #6f848e; cursor: pointer; }
.dashboard-main { width: min(1040px, 88vw); margin: 80px auto; }
.dashboard-main h1 { font-size: 42px; font-weight: 500; }
.status-card { margin-top: 38px; padding: 28px; display: grid; gap: 10px; background: white; border-left: 5px solid var(--cyan); box-shadow: 12px 12px 0 #dfe6e9; }

.portal-page {
  min-width: 320px;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(7, 24, 32, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(7, 24, 32, .045) 1px, transparent 1px);
  background-size: 32px 32px;
}
.portal-page a, .portal-page button { -webkit-tap-highlight-color: transparent; }
.portal-masthead { color: var(--white); background: var(--ink); border-top: 5px solid var(--cyan); }
.masthead-bar { min-height: 126px; padding: 22px max(24px, calc((100vw - 1280px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid #263b45; }
.portal-brand { display: flex; align-items: center; gap: 20px; color: var(--white); text-decoration: none; }
.brand-plate { min-width: 190px; padding: 19px 23px; color: var(--ink); background: var(--white); border: 1px solid var(--white); font-size: 13px; font-weight: 900; letter-spacing: 2px; text-align: center; }
.brand-plate i { color: var(--cyan); font-style: normal; }
.brand-divider { width: 3px; height: 52px; background: var(--cyan); }
.brand-title { display: grid; gap: 5px; }
.brand-title small, .masthead-context .eyebrow { color: var(--cyan); font: 700 10px/1.5 Consolas, monospace; letter-spacing: 2.1px; }
.brand-title strong { font-size: 23px; font-weight: 600; letter-spacing: 4px; }
.portal-user { display: flex; align-items: center; gap: 26px; }
.user-state { display: grid; grid-template-columns: 12px auto; column-gap: 8px; align-items: center; }
.user-state .status-dot { grid-row: 1; width: 9px; height: 9px; background: #39d79f; border: 2px solid #193d37; border-radius: 50%; }
.user-state small { grid-column: 2; color: #7de5bd; font-size: 11px; }
.user-state strong { grid-column: 2; margin-top: 3px; font-size: 13px; font-weight: 600; }
.portal-user form { display: flex; }
.portal-user button { min-height: 44px; padding: 0 17px; color: var(--white); background: transparent; border: 1px solid #536873; cursor: pointer; }
.portal-user button:hover { color: var(--cyan); border-color: var(--cyan); }
.masthead-context { min-height: 174px; padding: 32px max(24px, calc((100vw - 1280px) / 2)) 38px; position: relative; overflow: hidden; }
.masthead-context::after { content: "BD"; position: absolute; right: max(24px, calc((100vw - 1280px) / 2)); bottom: -38px; color: rgba(255,255,255,.035); font-size: 172px; font-weight: 900; line-height: 1; letter-spacing: -12px; }
.masthead-context .eyebrow { margin: 0 0 12px; }
.masthead-context h1 { margin: 0; display: flex; align-items: baseline; gap: 18px; font-size: clamp(31px, 4vw, 48px); font-weight: 500; letter-spacing: 1px; }
.masthead-context h1 em { color: var(--cyan); font: 700 11px/1.4 Consolas, monospace; letter-spacing: 2.2px; }
.masthead-context > p:last-child { max-width: 700px; margin: 12px 0 0; color: #acbbc2; line-height: 1.7; }
.portal-nav { position: sticky; top: 0; z-index: 30; color: var(--white); background: #0b212b; border-bottom: 4px solid var(--cyan); box-shadow: 0 5px 0 rgba(7,24,32,.08); }
.nav-track { width: min(1280px, 100%); min-height: 68px; margin: 0 auto; padding: 0 24px; display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: thin; }
.portal-nav a { min-width: 112px; padding: 13px 16px 11px; display: grid; align-content: center; gap: 2px; color: #c1cdd2; border-right: 1px solid #203741; border-bottom: 4px solid transparent; text-decoration: none; font-size: 13px; white-space: nowrap; }
.portal-nav a small { color: #6f929f; font: 700 9px/1.2 Consolas, monospace; letter-spacing: 1.3px; }
.portal-nav a:hover, .portal-nav a.active { color: var(--white); background: #122f3b; border-bottom-color: var(--cyan); }
.portal-nav a.active small { color: var(--cyan); }
.portal-shell { min-height: 60vh; }
.portal-main { width: min(1280px, calc(100% - 48px)); min-width: 0; margin: 0 auto; padding: 52px 0 90px; }
.page-heading { margin-bottom: 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading .eyebrow, .section-intro .eyebrow { margin: 0 0 8px; color: #47616d; font: 700 10px/1.4 Consolas, monospace; letter-spacing: 2px; }
.page-heading h2, .section-intro h2 { margin: 0; font-size: clamp(28px, 4vw, 43px); font-weight: 400; letter-spacing: 1.5px; }
.environment-badge { padding: 9px 12px; display: inline-flex; align-items: center; gap: 8px; color: #31535f; background: var(--white); border: 1px solid #9fb2bb; font-size: 12px; }
.environment-badge i { width: 8px; height: 8px; background: #39b983; border-radius: 50%; }
.notice { margin: 0 0 24px; padding: 14px 18px; border-left: 5px solid; }
.notice.success { color: #145c3a; background: #e9f8f0; border-color: #2e9d68; }
.notice.error { color: #7a1520; background: #fff1f2; border-color: #b42331; }
.workbench, .operations-directory { margin-top: 22px; }
.section-intro { margin-bottom: 24px; }
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 24px; }
.next-actions, .quick-access { min-height: 380px; padding: 28px; }
.next-actions { color: var(--white); background: var(--ink); border-bottom: 5px solid var(--cyan); position: relative; overflow: hidden; }
.next-actions::after { content: "TODAY"; position: absolute; top: 28px; right: 20px; color: rgba(255,255,255,.035); font-size: 72px; font-weight: 900; }
.next-actions > div, .quick-access > div { min-height: 108px; padding-bottom: 22px; }
.next-actions .eyebrow, .quick-access .eyebrow { margin: 0 0 8px; color: var(--cyan); font: 700 9px/1.4 Consolas, monospace; letter-spacing: 1.8px; }
.next-actions h3, .quick-access h3 { margin: 0 0 7px; font-size: 27px; font-weight: 400; }
.next-actions p, .quick-access p { margin: 0; color: #97abb5; font-size: 13px; line-height: 1.6; }
.next-actions > a { min-height: 67px; padding: 14px 0; display: grid; grid-template-columns: 48px 1fr auto 28px; align-items: center; gap: 10px; color: var(--white); border-top: 1px solid #2b414c; text-decoration: none; }
.next-actions > a span { color: var(--cyan); font: 700 11px Consolas, monospace; }
.next-actions > a strong { font-size: 14px; font-weight: 600; }
.next-actions > a b { min-width: 30px; color: #9eb0b8; font-size: 18px; font-weight: 400; text-align: right; }
.next-actions > a i, .quick-access > a i { color: var(--cyan); font-style: normal; font-size: 20px; text-align: right; }
.next-actions > a:hover strong { color: var(--cyan); }
.quick-access { background: var(--white); border: 1px solid var(--line); }
.quick-access > div { border-bottom: 1px solid var(--line); }
.quick-access p { color: var(--muted); }
.quick-access > a { min-height: 62px; padding: 11px 14px; display: grid; grid-template-columns: 1fr auto; align-content: center; column-gap: 14px; color: var(--ink); background: #f1f5f6; border-bottom: 1px solid #d3dde1; text-decoration: none; }
.quick-access > a small { color: #526c78; font: 700 9px/1.3 Consolas, monospace; letter-spacing: 1px; }
.quick-access > a strong { font-size: 15px; font-weight: 600; }
.quick-access > a i { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.quick-access > a:hover { background: #e7f8fb; }
.operations-directory { margin-top: 64px; }
.operations-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #b8c6cc; border-left: 1px solid #b8c6cc; }
.operations-grid > a { min-height: 240px; padding: 25px; display: grid; grid-template-rows: auto auto auto 1fr auto; color: var(--ink); background: rgba(255,255,255,.94); border-right: 1px solid #b8c6cc; border-bottom: 1px solid #b8c6cc; text-decoration: none; position: relative; }
.operations-grid > a span { position: absolute; top: 20px; right: 22px; color: #c2ced3; font: 700 28px/1 Consolas, monospace; }
.operations-grid > a small { margin-bottom: 16px; color: #526c78; font: 700 9px/1.4 Consolas, monospace; letter-spacing: 1.5px; }
.operations-grid > a strong { font-size: 24px; font-weight: 500; }
.operations-grid > a p { max-width: 280px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.operations-grid > a i { padding-top: 13px; color: #274651; border-top: 1px solid var(--line); font-size: 12px; font-style: normal; text-align: right; }
.operations-grid > a:hover { z-index: 1; box-shadow: inset 5px 0 0 var(--cyan); }
.operations-grid > a:hover i { color: #057e98; }
.panel { margin-top: 24px; padding: 28px; background: rgba(255,255,255,.97); border: 1px solid #cbd6da; box-shadow: 7px 7px 0 rgba(7,24,32,.075); }
.panel h2 { margin: 0 0 18px; font-weight: 500; letter-spacing: .5px; }
.migration-panel { margin-top: 48px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; border-left: 5px solid var(--cyan); box-shadow: none; }
.migration-panel p { color: var(--muted); line-height: 1.7; }
.migration-panel ul { margin: 0; padding-left: 20px; line-height: 2; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 24px; align-items: start; }
.workspace-grid .panel { margin-top: 0; }
.section-heading, .line-toolbar, .inline-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-heading > span { color: var(--muted); }
.inline-actions { justify-content: flex-end; }
.inline-actions a { color: #16687c; }
.search-row { margin-bottom: 18px; display: grid; grid-template-columns: minmax(150px, 1fr) auto; }
.search-row input { min-height: 46px; padding: 0 13px; background: #f8fafb; border: 1px solid #aebcc3; border-left: 4px solid var(--cyan); }
.search-row button { padding: 0 18px; color: white; background: var(--ink); border: 0; cursor: pointer; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 10px; color: #b9c8ce; background: var(--ink); text-align: left; white-space: nowrap; font-size: 11px; font-weight: 600; }
td { padding: 13px 10px; border-bottom: 1px solid #dce5e8; vertical-align: top; }
tbody tr:hover { background: #f0fafc; }
td.empty { padding: 34px 12px; color: var(--muted); text-align: center; }
.record-form { display: grid; gap: 13px; }
.record-form label { display: grid; gap: 7px; color: #36474f; font-size: 12px; font-weight: 700; }
.record-form input, .record-form select { width: 100%; min-height: 42px; padding: 8px 10px; color: var(--ink); background: white; border: 1px solid #aebcc3; }
.record-form input:focus, .record-form select:focus { outline: 3px solid rgba(8,173,212,.15); border-color: var(--cyan); }
.record-form .check { display: flex; align-items: center; gap: 8px; }
.record-form .check input { width: auto; min-height: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.primary { min-height: 48px; padding: 0 18px; color: white; background: var(--ink); border: 0; border-bottom: 4px solid var(--cyan); cursor: pointer; }
.primary:hover, .search-row button:hover { background: #12313d; }
.primary:focus-visible, .search-row button:focus-visible, .portal-nav a:focus-visible, .portal-user button:focus-visible, .operations-grid a:focus-visible, .quick-access a:focus-visible, .next-actions a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.inline-form { display: inline; }
.inline-form button { color: #7a2932; background: none; border: 0; text-decoration: underline; cursor: pointer; }
.order-builder summary { cursor: pointer; font-size: 20px; font-weight: 700; }
.order-builder[open] summary { margin-bottom: 24px; }
.line-toolbar { margin-top: 10px; }
.line-toolbar h3 { margin: 0; }
.line-toolbar button, .remove-line { color: #135d70; background: #e2f5f9; border: 1px solid #99d6e3; cursor: pointer; }
.line-toolbar button { padding: 8px 12px; }
.line-table { min-width: 1180px; }
.line-table input { min-width: 112px; min-height: 35px; margin-bottom: 5px; }
.remove-line { width: 30px; height: 30px; }
.integration-panel { max-width: 840px; border-left: 5px solid var(--cyan); }
.integration-panel p { line-height: 1.75; color: var(--muted); }
.privacy-note { margin: 22px 0 0; padding: 14px; color: #51646c; background: #edf5f7; border-left: 4px solid var(--cyan); font-size: 12px; line-height: 1.6; }

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: 270px; padding: 28px; border-right: 0; border-bottom: 5px solid var(--cyan); }
  .brand-mark { min-width: 0; padding: 15px 24px; }
  .brand-copy { position: static; transform: none; margin-top: 45px; }
  .brand-copy h1 { font-size: 54px; }
  .secure-label { display: none; }
  .form-zone { padding: 38px 20px 70px; }
  .login-card { padding: 44px 28px 36px; box-shadow: 12px 12px 0 rgba(3,23,34,.055); }
  .accent-line { margin: -44px -28px 40px; }
  .login-card h2 { font-size: 29px; }
  .masthead-bar { min-height: auto; padding: 18px; align-items: flex-start; }
  .portal-brand { gap: 11px; }
  .brand-plate { min-width: auto; padding: 13px 14px; font-size: 10px; }
  .brand-divider { height: 42px; }
  .brand-title small { display: none; }
  .brand-title strong { font-size: 16px; letter-spacing: 2px; }
  .user-state { display: none; }
  .portal-user { gap: 0; }
  .portal-user button { min-height: 40px; padding: 0 12px; }
  .masthead-context { min-height: 154px; padding: 28px 18px 34px; }
  .masthead-context::after { right: 18px; font-size: 120px; }
  .masthead-context h1 { display: grid; gap: 6px; font-size: 33px; }
  .masthead-context > p:last-child { font-size: 13px; }
  .portal-nav { position: sticky; }
  .nav-track { min-height: 62px; padding: 0; }
  .portal-nav a { min-width: 104px; padding: 10px 13px 8px; }
  .portal-main { width: calc(100% - 30px); padding: 34px 0 64px; }
  .page-heading { align-items: flex-start; }
  .environment-badge { display: none; }
  .workbench-grid, .migration-panel, .workspace-grid { grid-template-columns: 1fr; }
  .next-actions, .quick-access { min-height: 0; padding: 22px; }
  .operations-grid { grid-template-columns: 1fr; }
  .operations-grid > a { min-height: 210px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
}

@media (min-width: 821px) and (max-width: 1080px) {
  .masthead-bar, .masthead-context { padding-left: 28px; padding-right: 28px; }
  .portal-main { width: calc(100% - 56px); }
  .operations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
