* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; background: #f5f7fb; color: #172033; }
button { border: none; border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 600; background: #173b74; color: white; }
button:hover { filter: brightness(1.05); }
button.ghost { background: white; color: #173b74; border: 1px solid #d7deea; margin-left: 8px; }
button.danger { background: #a53d3d; }
button.secondary { background: #eef3fb; color: #173b74; }
button.icon { background: transparent; color: #172033; font-size: 24px; padding: 2px 8px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #d7deea; border-radius: 10px; background: #fff; font-size: 14px; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 13px; color: #5e6b82; margin: 10px 0 6px; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 12px 30px rgba(16, 42, 89, 0.05); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #edf1f7; font-size: 13px; vertical-align: top; }
th { background: #f0f4fb; color: #39475e; font-weight: 700; }
tr:hover td { background: #fafcff; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at top left, #e8f0ff, #f7f9fd 42%, #dce7f8); }
.login-card { width: 390px; background: rgba(255,255,255,0.92); border: 1px solid rgba(255,255,255,.75); box-shadow: 0 24px 80px rgba(29, 60, 108, .16); padding: 34px; border-radius: 24px; }
.login-card h1 { margin: 8px 0 2px; font-size: 32px; letter-spacing: -0.5px; }
.login-card p { color: #65758e; margin-bottom: 24px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 18px; border-radius: 999px; background: #173b74; color: #fff; font-weight: 800; letter-spacing: .5px; }
.login-card button { width: 100%; margin-top: 18px; height: 46px; }
.msg { margin-top: 12px; color: #a53d3d; font-size: 13px; }
.main-shell { display: flex; min-height: 100vh; }
.sidebar { width: 238px; background: #101e33; color: white; padding: 24px 18px; position: fixed; inset: 0 auto 0 0; }
.logo { font-size: 23px; line-height: 1.15; font-weight: 800; margin-bottom: 32px; letter-spacing: .4px; }
.logo span { color: #9bb0d0; font-size: 14px; font-weight: 600; }
.nav { display: block; width: 100%; text-align: left; background: transparent; color: #c9d4e7; margin: 7px 0; padding: 12px 14px; border-radius: 12px; }
.nav.active, .nav:hover { background: #1d3761; color: white; }
.content { margin-left: 238px; width: calc(100% - 238px); padding: 26px 30px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topbar h2 { margin: 0; font-size: 28px; }
#userInfo { color: #6d7b91; font-size: 13px; }
.warning { background: #fff6dd; color: #8c5a00; padding: 13px 16px; border: 1px solid #f3d99a; border-radius: 13px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 14px; margin: 18px 0; }
.card { background: white; padding: 20px; border-radius: 18px; box-shadow: 0 12px 30px rgba(16,42,89,.06); border: 1px solid #eef2f7; }
.card .num { font-size: 30px; font-weight: 800; margin-bottom: 4px; }
.card .label { color: #6e7a8c; font-size: 13px; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 16px 0; flex-wrap: wrap; }
.toolbar .filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: 180px; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #eaf1ff; color: #173b74; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.urgent { background: #ffe9e9; color: #9b2c2c; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.modal { position: fixed; inset: 0; background: rgba(10, 18, 32, .42); display: flex; align-items: center; justify-content: center; padding: 30px; z-index: 20; }
.modal-card { width: min(920px, 96vw); max-height: 92vh; overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 28px 90px rgba(0,0,0,.25); padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf1f7; padding-bottom: 10px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.small { color: #7a879b; font-size: 12px; }
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .logo { width: 100%; margin-bottom: 8px; }
  .main-shell { display: block; }
  .content { margin-left: 0; width: 100%; padding: 18px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
.danger-text { color: #a53d3d !important; border-color: #f2caca !important; }
#optionTableBox h3 { margin-top: 10px; }
.option-section { background: #fff; border: 1px solid #eef2f7; border-radius: 18px; padding: 18px; margin: 16px 0; box-shadow: 0 12px 30px rgba(16,42,89,.04); }
.option-section h3 { margin: 0 0 8px; }
.option-section h4 { margin: 12px 0 8px; }

.brand-logo-img { max-width: 150px; max-height: 70px; object-fit: contain; display: block; }
.login-card .brand-logo-img { margin: 0 auto 8px; max-width: 180px; max-height: 90px; }
.sidebar .brand-logo-img { margin-bottom: 8px; max-width: 170px; max-height: 76px; }
.inline-link { border: 0; background: transparent; color: #2f66c5; padding: 0 0 0 6px; font-size: 12px; font-weight: 700; }
.inline-link:hover { text-decoration: underline; background: transparent; color: #1d4fa3; }
.option-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px; }
.option-tab { border: 1px solid #d9e3f2; background: #f7faff; color: #24466f; padding: 10px 13px; border-radius: 12px; }
.option-tab.active { background: #173b74; color: #fff; border-color: #173b74; }
.option-help { background: #f4f8ff; border: 1px solid #dbe8fb; color: #31537c; border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.logo-preview { min-height: 100px; display: flex; align-items: center; justify-content: center; border: 1px dashed #c8d6ea; border-radius: 16px; background: #f8fbff; margin: 10px 0 16px; padding: 16px; }
.logo-preview img { max-width: 260px; max-height: 110px; object-fit: contain; }
.settings-card { background: #fff; border: 1px solid #eef2f7; border-radius: 18px; padding: 18px; margin: 16px 0; box-shadow: 0 12px 30px rgba(16,42,89,.04); }

.row-action { margin-top: 6px; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
#dashboardCustomerId, #sampleCustomerId { width: 260px; }
.address-note { color: #6b7a90; font-size: 12px; margin-top: 4px; }
.option-section table td:nth-child(5) { max-width: 260px; }

.workflow-card { background: #f8fbff; border: 1px solid #dbe8fb; border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.workflow-steps { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; margin: 14px 0; }
.workflow-step { min-width: 92px; background: #eef3fb; color: #60718a; border: 1px solid #dce6f3; border-radius: 14px; padding: 10px; text-align: center; }
.workflow-step span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #d8e2f2; margin-bottom: 6px; font-weight: 800; }
.workflow-step b { display: block; font-size: 13px; }
.workflow-step.done { background: #eaf1ff; color: #173b74; border-color: #bfd3f5; }
.workflow-step.done span { background: #173b74; color: white; }
.workflow-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; padding: 14px; background: #fbfcff; border: 1px solid #edf1f7; border-radius: 14px; }
.workflow-log-box { margin-top: 16px; }
.workflow-log-box h4 { margin: 0 0 10px; }
.workflow-log-item { border-left: 4px solid #b9cdf0; background: #f8fbff; margin: 8px 0; padding: 10px 12px; border-radius: 10px; }
