:root { color-scheme: light; font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif; color: #182133; background: #f3f6fa; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f3f6fa; }
.login-panel { width: min(100%, 420px); padding: 34px; border: 1px solid #dbe3ed; border-radius: 14px; background: #fff; box-shadow: 0 18px 45px rgb(20 31 48 / 10%); }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 8px; border-radius: 8px; background: #2267e8; color: #fff; font-weight: 700; }
.login-panel h1 { margin: 18px 0 6px; font-size: 25px; }
.login-panel p, .muted { color: #68768a; }
.login-panel form, .login-panel label { display: grid; gap: 7px; }
.login-panel form { gap: 16px; margin-top: 24px; }
.login-panel input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #dbe3ed; border-radius: 7px; }
.login-panel button { min-height: 44px; border: 0; border-radius: 7px; background: #2267e8; color: #fff; cursor: pointer; }
.alert { margin-top: 16px; padding: 10px 12px; border-radius: 7px; background: #fff0f2; color: #b43c49; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0,1fr); }
.sidebar { padding: 20px 14px; background: #14233a; color: #dce5f3; }
.sidebar-brand { display: flex; align-items: center; margin-bottom: 22px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav span { margin: 15px 10px 5px; color: #94a4bb; font-size: 12px; }
.sidebar nav a { padding: 9px 10px; border-radius: 7px; color: inherit; text-decoration: none; font-size: 13px; }
.sidebar nav a.active { background: #2b3a52; color: #fff; }
.main-content header { min-height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid #dbe3ed; background: #fff; }
.main-content header form { display: flex; align-items: center; gap: 10px; }
.header-title-group { display: flex; min-width: 0; align-items: center; gap: 11px; }
.header-title-group strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu-button, .sidebar-close, .sidebar-backdrop { display: none; }
.link-button { border: 0; background: transparent; color: #2267e8; cursor: pointer; }
.page-content { padding: 24px; }
.page-content h1 { margin: 0 0 5px; }
.summary-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 22px; }
.summary-grid article { padding: 18px; border: 1px solid #dbe3ed; border-radius: 9px; background: #fff; }
.summary-grid span { display: block; color: #68768a; font-size: 13px; }
.summary-grid strong { display: block; margin-top: 8px; font-size: 20px; }
.notice { margin-top: 16px; padding: 13px; border-radius: 8px; background: #eaf1ff; color: #2354a6; }
@media (max-width: 760px) { .app-shell { grid-template-columns: 1fr; } .sidebar { display: none; } .summary-grid { grid-template-columns: 1fr; } }

.sidebar nav a[aria-disabled="true"] { color: #77869a; cursor: default; }
.login-user { color: #415069; font-size: 14px; }
.page-content { min-width: 0; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 0 0 6px; font-size: 27px; }
.page-heading p { margin: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 17px; border: 1px solid transparent; border-radius: 7px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.button-primary { border-color: #2267e8; background: #2267e8; color: #fff; }
.button-secondary { border-color: #cfd8e5; background: #fff; color: #34435a; }
.filter-panel { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(150px, .8fr) minmax(140px, .7fr) auto; gap: 14px; align-items: end; margin-bottom: 18px; padding: 18px; border: 1px solid #dbe3ed; border-radius: 10px; background: #fff; }
.filter-panel label, .form-panel label { display: grid; gap: 7px; color: #3c4960; font-size: 14px; font-weight: 600; }
.filter-panel input, .filter-panel select, .form-panel input[type="text"], .form-panel input[type="password"], .form-panel input[type="number"], .form-panel input[type="date"], .form-panel input[type="datetime-local"], .form-panel select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #cfd8e5; border-radius: 7px; background: #fff; color: #182133; }
.form-panel input[readonly] { background: #f4f6f9; color: #647188; }
.form-panel textarea { width: 100%; min-height: 112px; padding: 11px 12px; border: 1px solid #cfd8e5; border-radius: 7px; background: #fff; color: #182133; line-height: 1.55; resize: vertical; }
.filter-panel input:focus, .filter-panel select:focus, .form-panel input:focus, .form-panel select:focus, .form-panel textarea:focus { border-color: #2267e8; outline: 3px solid rgb(34 103 232 / 12%); }
.filter-actions { display: flex; gap: 8px; }
.table-panel { overflow: hidden; border: 1px solid #dbe3ed; border-radius: 10px; background: #fff; }
.table-summary { padding: 15px 18px; border-bottom: 1px solid #e5ebf2; color: #59677b; font-size: 14px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 15px; border-bottom: 1px solid #e8edf3; text-align: left; vertical-align: middle; }
th { background: #f7f9fc; color: #536176; font-size: 13px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }
.empty-cell { height: 150px; color: #7a8799; text-align: center; }
.table-link { color: #2267e8; font-weight: 600; text-decoration: none; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-blue { background: #e8f0ff; color: #1d5bce; }
.badge-green { background: #e6f7ef; color: #168458; }
.badge-gray { background: #edf0f4; color: #667286; }
.badge-red { background: #ffeaed; color: #c62f43; }
.badge-yellow { background: #fff4d6; color: #946800; }
.form-panel { overflow: hidden; border: 1px solid #dbe3ed; border-radius: 10px; background: #fff; }
.form-panel fieldset { margin: 0; padding: 22px; border: 0; border-bottom: 1px solid #e7ecf2; }
.form-panel legend { width: 100%; margin: 0 0 17px; padding: 0; color: #202b3e; font-size: 17px; font-weight: 700; }
.form-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }
.form-panel small { color: #7a8799; font-size: 12px; font-weight: 400; }
.required { color: #df3545; }
.field-note { margin: -8px 0 16px; color: #7a8799; font-size: 13px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 17px; }
.radio-row label, .check-grid label { display: flex; align-items: center; gap: 8px; color: #334158; font-weight: 500; }
.radio-row input, .check-grid input { width: 17px; height: 17px; accent-color: #2267e8; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.check-grid label { min-height: 42px; padding: 9px 12px; border: 1px solid #dbe3ed; border-radius: 7px; background: #fafbfd; }
.inline-notice { padding: 13px 14px; border-radius: 7px; background: #fff8e5; color: #8b6712; font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 18px 22px; background: #f8fafc; }
.validation-errors, .flash { margin-bottom: 18px; padding: 14px 16px; border: 1px solid; border-radius: 8px; }
.validation-errors, .flash-error { border-color: #f2c9cf; background: #fff3f5; color: #a92b3c; }
.validation-errors ul { margin: 8px 0 0; padding-left: 20px; }
.flash-success { border-color: #bfe7d3; background: #effaf5; color: #14744c; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.dashboard-card { min-height: 260px; padding: 20px; border: 1px solid #dbe3ed; border-radius: 10px; background: #fff; }
.dashboard-card h2 { margin: 0; font-size: 17px; }
.chart-placeholder { display: grid; min-height: 190px; place-items: center; color: #8a96a7; font-size: 13px; text-align: center; }
.dashboard-filter-panel { grid-template-columns: repeat(2, minmax(180px, 260px)) auto; }
.dashboard-period-note { display: flex; align-items: center; gap: 12px; margin: -4px 0 18px; color: #77859a; font-size: 12px; }
.dashboard-period-note strong { color: #35445b; font-size: 13px; }
.dashboard-summary-grid { margin-top: 0; }
.dashboard-data-grid { align-items: stretch; }
.dashboard-chart-card { min-width: 0; }
.dashboard-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dashboard-card-heading h2 { margin: 0 0 5px; }
.dashboard-card-heading p { margin: 0; color: #7a8799; font-size: 12px; }
.dashboard-card-heading > strong { color: #1f5fc9; font-size: 17px; white-space: nowrap; }
.dashboard-daily-scroll { overflow-x: auto; padding: 8px 2px 0; }
.dashboard-daily-chart { display: grid; grid-template-columns: repeat(var(--dashboard-day-count), minmax(38px, 1fr)); align-items: end; gap: 5px; min-width: max(100%, calc(var(--dashboard-day-count) * 43px)); height: 235px; padding: 24px 2px 0; border-bottom: 1px solid #dce4ef; }
.dashboard-day { position: relative; display: grid; grid-template-rows: 1fr auto; align-items: end; height: 100%; text-align: center; }
.dashboard-bar { display: block; width: min(28px, 76%); min-height: 2px; margin: auto auto 0; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #5b91ef, #2468df); }
.dashboard-bar-value { position: absolute; top: -21px; left: 50%; display: none; padding: 4px 7px; border-radius: 5px; background: #17233a; color: #fff; font-size: 10px; transform: translateX(-50%); white-space: nowrap; z-index: 2; }
.dashboard-day:hover .dashboard-bar-value { display: block; }
.dashboard-day-label { min-height: 29px; padding-top: 7px; color: #728096; font-size: 10px; white-space: nowrap; }
.dashboard-character-chart { display: grid; gap: 17px; }
.dashboard-character-row { display: grid; grid-template-columns: minmax(115px, 165px) minmax(190px, 1fr); gap: 14px; align-items: center; }
.dashboard-character-label { min-width: 0; }
.dashboard-character-label strong, .dashboard-character-label span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-character-label strong { color: #2b394f; font-size: 13px; }
.dashboard-character-label span { margin-top: 4px; color: #8490a1; font-size: 10px; }
.dashboard-character-value { display: grid; grid-template-columns: minmax(90px, 1fr) auto; gap: 10px; align-items: center; }
.dashboard-character-track { height: 19px; overflow: hidden; border-radius: 5px; background: #edf2f8; }
.dashboard-character-track span { display: block; height: 100%; min-width: 2px; border-radius: 5px; background: linear-gradient(90deg, #2f70e5, #76a4f3); }
.dashboard-character-value strong { min-width: 88px; color: #34435a; font-size: 12px; text-align: right; white-space: nowrap; }
.empty-state { display: grid; min-height: 420px; place-items: center; align-content: center; gap: 10px; text-align: center; }
.empty-state h1, .empty-state p { margin: 0; }
.empty-state .button { margin-top: 12px; }
.branch-filter-panel { grid-template-columns: minmax(300px, 1.8fr) minmax(150px, .6fr) auto; }
.cell-address { min-width: 220px; max-width: 360px; }
.count-primary { color: #1768e5; font-weight: 700; }
.table-help { margin: 11px 3px 0; color: #768398; font-size: 12px; }
.page-notice { margin-bottom: 18px; }
.kiosk-filter-panel { grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(140px, .7fr)) auto; }
.maintenance-filter-panel { grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(135px, .7fr)) repeat(2, minmax(145px, .75fr)) auto; }
.character-filter-panel { grid-template-columns: minmax(280px, 1.5fr) repeat(2, minmax(150px, .7fr)) auto; }
.kiosk-table { min-width: 1520px; }
.maintenance-table { min-width: 1260px; }
.character-table { min-width: 1120px; }
.nowrap { white-space: nowrap; }
.cell-subtext { display: block; margin-top: 4px; color: #7b8799; font-size: 11px; font-weight: 400; }
.cell-subtext-label { color: #8a96a6; font-size: 11px; }
.latest-maintenance-cell { min-width: 210px; max-width: 290px; }
.latest-maintenance-cell a { color: #31425d; text-decoration: none; }
.action-links { min-width: 100px; }
.action-links .table-link { display: block; margin: 3px 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading span { color: #7a8799; font-size: 13px; }
.summary-note { margin-left: 8px; color: #8a96a6; font-size: 12px; }
.case-summary-row { cursor: pointer; }
.case-summary-row:focus { outline: 2px solid #2267e8; outline-offset: -2px; }
.case-summary-row[aria-expanded="true"] { background: #f3f7ff; }
.case-toggle { width: 28px; height: 28px; border: 1px solid #d6deea; border-radius: 6px; background: #fff; color: #416083; cursor: pointer; }
.case-subject { min-width: 240px; max-width: 420px; font-weight: 600; }
.case-detail-row td { padding: 0; background: #f8faff; }
.case-detail { display: grid; gap: 18px; padding: 22px 28px 25px 58px; }
.case-original, .reply-item { padding: 16px 18px; border: 1px solid #dce4ef; border-radius: 8px; background: #fff; }
.case-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 11px; color: #768398; font-size: 12px; }
.case-content { color: #303d52; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.reply-list { display: grid; gap: 10px; }
.reply-list > strong { margin-bottom: 2px; }
.empty-replies { padding: 18px; border: 1px dashed #ccd6e4; border-radius: 8px; color: #7c899b; text-align: center; }
.reply-form { display: grid; grid-template-columns: minmax(280px, 1fr) 150px auto; gap: 12px; align-items: end; padding: 16px 18px; border: 1px solid #cad8ed; border-radius: 8px; background: #eef4ff; }
.reply-form label { display: grid; gap: 7px; color: #3c4960; font-size: 13px; font-weight: 600; }
.reply-form textarea, .reply-form select { width: 100%; border: 1px solid #c8d3e2; border-radius: 7px; background: #fff; color: #182133; }
.reply-form textarea { min-height: 86px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.reply-form select { height: 42px; padding: 0 10px; }
.character-thumbnail { display: grid; width: 68px; height: 68px; border: 1px solid #d9e1eb; border-radius: 10px; background: #f5f7fa; object-fit: cover; place-items: center; }
.character-thumbnail-empty { padding: 6px; color: #8a96a6; font-size: 10px; line-height: 1.3; text-align: center; }
.character-badges { min-width: 115px; }
.character-badges .badge { margin: 2px 3px 2px 0; }
.character-image-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 26px; align-items: start; }
.form-label { display: block; margin-bottom: 7px; color: #3c4960; font-size: 14px; font-weight: 600; }
.character-image-preview { display: grid; width: 200px; height: 200px; overflow: hidden; border: 1px dashed #bdc9d9; border-radius: 12px; background: #f6f8fb; color: #8995a6; font-size: 13px; place-items: center; text-align: center; }
.character-image-preview img { width: 100%; height: 100%; object-fit: contain; }
.character-image-fields { display: grid; gap: 18px; }
.form-panel input[type="file"] { width: 100%; padding: 10px 12px; border: 1px solid #cfd8e5; border-radius: 7px; background: #fff; color: #3d4b61; }
.inline-checkbox { display: flex !important; grid-template-columns: auto 1fr; align-items: center; justify-content: flex-start; }
.inline-checkbox input { width: 17px; height: 17px; margin: 0; accent-color: #2267e8; }
.character-flag-grid { grid-template-columns: repeat(2, minmax(160px, 220px)); }
.branch-character-filter-panel { grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(160px, .75fr)) auto; }
.branch-character-table { min-width: 1280px; }
.catid-filter-panel { grid-template-columns: minmax(300px, 1.5fr) repeat(2, minmax(160px, .7fr)) auto; }
.catid-table { min-width: 1500px; }
.catid-summary-row { cursor: pointer; }
.catid-summary-row:focus { outline: 2px solid #2267e8; outline-offset: -2px; }
.catid-summary-row[aria-expanded="true"] { background: #f3f7ff; }
.catid-toggle-column { width: 52px; text-align: center; }
.catid-toggle { width: 28px; height: 28px; padding: 0; border: 1px solid #d6deea; border-radius: 6px; background: #fff; color: #416083; cursor: pointer; }
.catid-history-open { padding: 0; border: 0; background: transparent; cursor: pointer; font-family: inherit; font-size: inherit; }
.terminal-display-name { min-width: 240px; }
.terminal-display-name strong, .terminal-display-name small { display: block; }
.terminal-display-name small { margin-top: 5px; color: #7b8799; font-size: 11px; }
.terminal-current-location { min-width: 190px; }
.terminal-current-location strong, .terminal-current-location span, .terminal-current-location small { display: block; }
.terminal-current-location span { margin-top: 3px; color: #45536a; font-size: 12px; }
.terminal-current-location small { margin-top: 4px; color: #7b8799; font-size: 11px; }
.terminal-future-location { min-width: 270px; }
.terminal-future-location strong, .terminal-future-location small { display: block; }
.terminal-future-location strong { color: #30435e; font-size: 12px; }
.terminal-future-location small { margin-top: 4px; color: #7b8799; font-size: 11px; }
.terminal-device-info { min-width: 190px; }
.terminal-device-info span { display: block; margin: 2px 0; color: #66758a; font-size: 11px; }
.catid-history-row td { padding: 0; background: #f8faff; }
.catid-history-panel { padding: 20px 24px 24px 54px; }
.catid-history-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 13px; }
.catid-history-heading strong { color: #24334b; font-size: 14px; }
.catid-history-heading span { color: #77859a; font-size: 12px; }
.catid-history-table { min-width: 1240px; border: 1px solid #dce4ef; background: #fff; }
.catid-history-table th { background: #eef3f9; }
.terminal-reference-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.terminal-reference-grid > div { padding: 16px; border: 1px solid #dce4ef; border-radius: 8px; background: #f8fafc; }
.terminal-reference-grid span { display: block; color: #758297; font-size: 12px; }
.terminal-reference-grid strong { display: block; margin-top: 7px; color: #1e2b40; font-size: 19px; }
.matching-filter-panel { grid-template-columns: minmax(230px, 1.35fr) repeat(3, minmax(135px, .65fr)) repeat(2, minmax(145px, .65fr)) auto; }
.terminal-matching-table { min-width: 1580px; }
.matching-reason-cell { min-width: 210px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matching-availability { margin-top: 18px; padding: 13px 14px; border: 1px solid #d4dce7; border-radius: 7px; background: #f6f8fb; color: #66758a; font-size: 13px; }
.matching-availability.available { border-color: #bce7d3; background: #ecf9f3; color: #14744c; }
.matching-availability.unavailable { border-color: #f0c9ce; background: #fff3f5; color: #a92b3c; }
.order-cell { min-width: 112px; }
.order-cell > strong { display: inline-block; min-width: 24px; color: #215fc7; text-align: center; }
.order-buttons { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: middle; }
.order-buttons form { margin: 0; }
.order-buttons button { width: 27px; height: 27px; padding: 0; border: 1px solid #cbd6e4; border-radius: 5px; background: #fff; color: #426184; font-size: 11px; cursor: pointer; }
.order-buttons button:hover { border-color: #2267e8; color: #2267e8; }
.inline-check-row { display: flex; align-items: center; gap: 7px; min-height: 24px; color: #42516a; font-size: 13px; font-weight: 500; }
.inline-check-row input { width: 17px; height: 17px; margin: 0; accent-color: #2267e8; }
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.upload-form-panel fieldset:last-of-type { border-bottom: 0; }
.upload-dropzone { display: grid !important; min-height: 180px; padding: 28px; border: 2px dashed #b9c8dc; border-radius: 10px; background: #f7faff; place-items: center; align-content: center; text-align: center; cursor: pointer; }
.upload-dropzone:hover { border-color: #2267e8; background: #f1f6ff; }
.upload-dropzone strong { color: #24334b; font-size: 16px; }
.upload-dropzone span { color: #718097; font-size: 13px; font-weight: 400; }
.upload-dropzone input { width: min(100%, 410px) !important; height: auto !important; margin-top: 14px; }
.upload-rules { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.upload-rules li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; padding-bottom: 13px; border-bottom: 1px solid #edf1f5; }
.upload-rules li:last-child { padding-bottom: 0; border-bottom: 0; }
.upload-rules strong { color: #2b3b53; font-size: 14px; }
.upload-rules span { color: #6c7a8f; font-size: 13px; line-height: 1.55; }
.upload-side-note { padding: 20px; border: 1px solid #d6e1f0; border-radius: 10px; background: #eef5ff; color: #334865; }
.upload-side-note > strong { font-size: 16px; }
.upload-side-note ol { margin: 15px 0; padding-left: 21px; font-size: 13px; line-height: 1.75; }
.upload-side-note p { margin: 0; padding-top: 13px; border-top: 1px solid #cedcf0; color: #667993; font-size: 12px; line-height: 1.55; }
.upload-result { overflow: hidden; border: 1px solid #bee4d1; border-radius: 10px; background: #fff; }
.upload-result-failed { border-color: #efc8ce; }
.upload-result-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; border-bottom: 1px solid #e7edf3; }
.upload-result-title > div { display: flex; align-items: center; gap: 10px; }
.upload-result-title > span { color: #78869a; font-size: 12px; }
.upload-result-message { margin: 16px 18px 0; }
.upload-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.upload-stat-grid > div { padding: 18px 20px; border-right: 1px solid #e8edf3; border-bottom: 1px solid #e8edf3; }
.upload-stat-grid > div:nth-child(3n) { border-right: 0; }
.upload-stat-grid span { display: block; color: #748197; font-size: 12px; }
.upload-stat-grid strong { display: block; margin-top: 7px; color: #213149; font-size: 17px; }
.upload-error-table { border-top: 1px solid #e7edf3; }
.upload-error-table table, .recent-upload-table { min-width: 860px; }
.button:disabled { opacity: .65; cursor: wait; }
.upload-history-filter-panel { grid-template-columns: repeat(2, minmax(145px, .7fr)) repeat(2, minmax(150px, .75fr)) minmax(250px, 1.35fr) auto; }
.upload-history-summary { margin-top: 0; }
.upload-history-summary em { color: #c62f43; font-style: normal; }
.upload-history-table { min-width: 1540px; }
.history-filename { max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-failure-text { max-width: 240px; overflow: hidden; color: #b23546; text-overflow: ellipsis; white-space: nowrap; }
.history-detail-heading small { margin-left: 8px; color: #718097; font-size: 13px; font-weight: 500; }
.history-detail-heading > div { display: flex; gap: 8px; }
.history-run-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 14px 20px; border-bottom: 1px solid #e7edf3; background: #f8fafc; color: #718097; font-size: 12px; }
.history-run-meta strong { margin-left: 5px; color: #33435b; font-weight: 600; }

@media (max-width: 1100px) {
    .filter-panel, .branch-filter-panel, .kiosk-filter-panel, .maintenance-filter-panel, .character-filter-panel, .branch-character-filter-panel, .catid-filter-panel, .matching-filter-panel, .upload-history-filter-panel, .dashboard-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .upload-layout { grid-template-columns: 1fr; }
    .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reply-form { grid-template-columns: 1fr 150px; }
    .reply-form label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .page-heading { align-items: stretch; flex-direction: column; }
    .filter-actions { flex-wrap: wrap; }
    .filter-panel, .branch-filter-panel, .kiosk-filter-panel, .maintenance-filter-panel, .character-filter-panel, .branch-character-filter-panel, .catid-filter-panel, .matching-filter-panel, .upload-history-filter-panel, .dashboard-filter-panel, .two-columns, .check-grid, .dashboard-grid, .reply-form, .character-image-layout, .terminal-reference-grid { grid-template-columns: 1fr; }
    .dashboard-period-note { align-items: flex-start; flex-direction: column; gap: 4px; }
    .dashboard-character-row { grid-template-columns: 1fr; gap: 7px; }
    .upload-stat-grid { grid-template-columns: 1fr; }
    .upload-stat-grid > div { border-right: 0; }
    .upload-rules li { grid-template-columns: 1fr; gap: 5px; }
    .upload-result-title, .upload-result-title > div { align-items: flex-start; flex-direction: column; }
    .history-detail-heading { align-items: flex-start; }
    .history-detail-heading > div { flex-wrap: wrap; }
    .span-two { grid-column: auto; }
    .reply-form label:first-child { grid-column: auto; }
    .case-detail { padding: 18px; }
    .page-content { padding: 18px; }
    .character-image-preview { width: min(100%, 260px); height: 220px; }
}

.report-filter-panel { grid-template-columns: repeat(3, minmax(145px, 1fr)) repeat(3, minmax(155px, 1fr)) auto; }
.transaction-filter-panel { grid-template-columns: repeat(5, minmax(135px, .75fr)) minmax(260px, 1.4fr) repeat(2, minmax(125px, .65fr)) auto; }
.report-summary-grid { margin-top: 0; }
.report-summary-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.report-summary-grid small { display: block; margin-top: 5px; color: #77859a; font-size: 12px; }
.negative-amount { color: #c62f43 !important; }
.report-chart-panel { margin-top: 18px; padding: 20px; border: 1px solid #dbe3ed; border-radius: 10px; background: #fff; }
.report-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.report-section-title h2 { margin: 0 0 5px; font-size: 18px; }
.report-section-title p { margin: 0; color: #78869a; font-size: 12px; }
.report-section-title > span { color: #68768a; font-size: 13px; white-space: nowrap; }
.chart-empty { display: grid; min-height: 230px; place-items: center; color: #8692a4; font-size: 13px; }
.vertical-chart-scroll { overflow-x: auto; padding: 8px 4px 0; }
.vertical-chart { display: grid; grid-template-columns: repeat(var(--chart-count), minmax(54px, 1fr)); align-items: end; gap: 8px; min-width: max(100%, calc(var(--chart-count) * 62px)); height: 250px; padding: 28px 4px 0; border-bottom: 1px solid #dce4ef; }
.vertical-chart-item { position: relative; display: grid; grid-template-rows: 1fr auto; align-items: end; height: 100%; color: #536176; text-decoration: none; text-align: center; }
.vertical-chart-item:hover .chart-bar { background: #174fae; }
.vertical-chart-item.chart-negative .chart-bar { background: #db4b5c; }
.vertical-chart-item.chart-negative:hover .chart-bar { background: #b92f42; }
.chart-bar { display: block; width: min(34px, 72%); min-height: 3px; margin: auto auto 0; border-radius: 5px 5px 0 0; background: #3a78e8; transition: background .15s; }
.chart-value { position: absolute; top: -22px; left: 50%; display: none; padding: 4px 7px; border-radius: 5px; background: #17233a; color: #fff; font-size: 11px; transform: translateX(-50%); white-space: nowrap; z-index: 2; }
.vertical-chart-item:hover .chart-value { display: block; }
.chart-label { display: block; min-height: 35px; padding-top: 8px; overflow: hidden; color: #68768a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-chart { display: grid; gap: 14px; }
.horizontal-chart-item { display: grid; grid-template-columns: minmax(150px, 220px) minmax(200px, 1fr); gap: 16px; align-items: center; }
.horizontal-chart-label { display: grid; gap: 3px; }
.horizontal-chart-label strong { overflow: hidden; color: #2c3a50; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-chart-label span { color: #7b8799; font-size: 11px; }
.horizontal-chart-track { height: 22px; overflow: hidden; border-radius: 5px; background: #edf2f8; }
.horizontal-chart-track span { display: block; height: 100%; min-width: 2px; border-radius: 5px; background: linear-gradient(90deg, #2f70e5, #6d9df1); }
.horizontal-chart-item.chart-negative .horizontal-chart-track span { background: linear-gradient(90deg, #d94a5a, #ef7b88); }
.report-table { min-width: 980px; }
.transaction-table { min-width: 1550px; }
.number-cell { text-align: right; white-space: nowrap; }
.transaction-summary { display: flex; align-items: center; gap: 28px; margin-bottom: 18px; padding: 16px 19px; border: 1px solid #dbe3ed; border-radius: 10px; background: #fff; }
.transaction-summary > div { min-width: 150px; }
.transaction-summary span { display: block; color: #748197; font-size: 12px; }
.transaction-summary strong { display: block; margin-top: 5px; color: #20314a; font-size: 18px; }
.transaction-summary p { margin: 0 0 0 auto; color: #7c899c; font-size: 12px; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 18px; }
.pagination a { display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center; padding: 0 9px; border: 1px solid #d5deea; border-radius: 6px; background: #fff; color: #47566c; font-size: 12px; text-decoration: none; }
.pagination a.active { border-color: #2267e8; background: #2267e8; color: #fff; }

@media (max-width: 1350px) {
    .report-filter-panel, .transaction-filter-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .report-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .report-filter-panel, .transaction-filter-panel { grid-template-columns: 1fr; }
    .report-section-title, .transaction-summary { align-items: flex-start; flex-direction: column; }
    .transaction-summary p { margin-left: 0; }
    .horizontal-chart-item { grid-template-columns: 1fr; gap: 6px; }
    .report-summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    body.sidebar-open { overflow: hidden; }
    .app-shell { display: block; }
    .sidebar {
        position: fixed;
        z-index: 1001;
        top: 0;
        bottom: 0;
        left: 0;
        display: block;
        width: min(84vw, 300px);
        overflow-y: auto;
        box-shadow: 12px 0 28px rgb(10 22 40 / 24%);
        transform: translateX(-105%);
        transition: transform .2s ease;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-brand { justify-content: flex-start; }
    .sidebar-brand-name { flex: 1; }
    .sidebar-close {
        display: inline-grid;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 0;
        border-radius: 7px;
        background: rgb(255 255 255 / 10%);
        color: #fff;
        font-size: 26px;
        cursor: pointer;
        place-items: center;
    }
    .sidebar-backdrop {
        position: fixed;
        z-index: 1000;
        inset: 0;
        display: block;
        padding: 0;
        border: 0;
        background: rgb(10 20 35 / 48%);
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .main-content header {
        position: sticky;
        z-index: 50;
        top: 0;
        min-height: 58px;
        padding: 0 16px;
    }
    .mobile-menu-button {
        display: inline-grid;
        width: 38px;
        height: 38px;
        flex: 0 0 auto;
        padding: 8px;
        border: 1px solid #d4deeb;
        border-radius: 7px;
        background: #fff;
        cursor: pointer;
        align-content: center;
        gap: 4px;
    }
    .mobile-menu-button span { display: block; width: 100%; height: 2px; border-radius: 2px; background: #30435e; }
    .main-content header form { gap: 6px; }
    .login-user { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
