* { box-sizing: border-box; }
:root {
    --ink:#1f2937; --muted:#667085; --line:#e7ebf0; --surface:#fff;
    --canvas:#f5f7fb; --primary:#3157a4; --primary-dark:#244583;
    --sidebar:#17243a; --sidebar-muted:#9ba9bd;
}
body { margin:0; font-family:Inter,Segoe UI,Arial,sans-serif; color:var(--ink); background:var(--canvas); }
button,input,select { font:inherit; }
button { cursor:pointer; }
.app-shell { min-height:100vh; }
.sidebar { position:fixed; inset:0 auto 0 0; width:246px; background:var(--sidebar); color:white; padding:25px 17px 18px; display:flex; flex-direction:column; z-index:30; }
.brand { display:flex; align-items:center; gap:12px; padding:0 10px 34px; }
.brand-mark { width:39px; height:39px; border-radius:12px; display:grid; place-items:center; background:#fff; color:#254783; font-weight:800; font-size:21px; }
.brand strong { display:block; font-size:16px; letter-spacing:.2px; }
.brand small,.sidebar-bottom small { display:block; margin-top:4px; color:var(--sidebar-muted); font-size:11px; }
.sidebar-section-label { padding:0 11px 12px; color:#8292aa; font-size:10px; font-weight:700; letter-spacing:1.2px; }
.sidebar-nav { display:grid; gap:7px; }
.nav-link { min-height:45px; display:flex; align-items:center; gap:12px; padding:0 12px; color:#d5deeb; text-decoration:none; border-radius:9px; font-size:13px; }
.nav-link.active { background:#2b4267; color:#fff; box-shadow:inset 3px 0 #91b4ff; }
.nav-link.disabled { color:#718198; cursor:default; }
.nav-link small { margin-left:auto; font-size:9px; color:#8292aa; }
.nav-icon { width:20px; text-align:center; font-size:17px; }
.sidebar-bottom { margin-top:auto; border-top:1px solid #314057; padding:17px 9px 0; display:flex; align-items:center; gap:11px; font-size:12px; }
.sidebar-user-avatar { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:#344c70; font-weight:700; }
.main-content { margin-left:246px; min-height:100vh; }
.topbar { height:64px; background:#fff; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 35px; font-size:12px; }
.breadcrumb { color:#8993a3; }.breadcrumb-separator { color:#c0c6d0; margin:0 10px; }
.topbar-tag { font-size:9px; letter-spacing:1px; color:#6f7e94; background:#f3f5f8; padding:7px 10px; border-radius:5px; font-weight:700; }
.mobile-menu { display:none; border:0; background:none; font-size:22px; }
.page-content { max-width:1600px; margin:auto; padding:33px 35px 50px; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:25px; }
.eyebrow { color:#6f83a7; font-size:9px; font-weight:800; letter-spacing:1.5px; margin:0 0 8px; }
h1 { margin:0; font-size:26px; letter-spacing:-.7px; color:#1e293b; }
.page-subtitle { margin:8px 0 0; color:var(--muted); font-size:13px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 2px 8px rgba(20,35,60,.025); }
.btn-primary { border:0; border-radius:8px; background:var(--primary); color:white; padding:11px 16px; font-size:12px; font-weight:650; }
.btn-primary:hover,.btn-search:hover { background:var(--primary-dark); }
.toolbar { padding:17px 20px; display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:19px; }
.search-wrap { width:min(520px,100%); }.search-wrap label { display:block; margin-bottom:8px; font-size:11px; font-weight:700; color:#485467; }
.search-controls { display:flex; align-items:center; position:relative; }
.search-symbol { position:absolute; left:12px; color:#8a96a8; font-size:21px; }
.search-controls input { height:39px; min-width:0; flex:1; border:1px solid #dfe4eb; border-radius:7px 0 0 7px; padding:0 12px 0 36px; outline:none; font-size:12px; }
.search-controls input:focus,.form-group input:focus,.form-group select:focus { border-color:#8ba5d6; box-shadow:0 0 0 3px rgba(49,87,164,.09); }
.btn-search { height:39px; border:0; border-radius:0 7px 7px 0; padding:0 17px; background:var(--primary); color:white; font-size:11px; font-weight:650; }
.toolbar-summary { display:flex; align-items:center; gap:8px; color:#657187; font-size:11px; padding-bottom:10px; }
.summary-dot,.history-live-dot { width:7px; height:7px; border-radius:50%; background:#35a477; display:inline-block; }
.table-card { overflow:hidden; }
.table-heading { display:flex; justify-content:space-between; align-items:center; padding:20px 21px 17px; }
.table-heading h2 { margin:0; font-size:15px; }.table-heading p { margin:6px 0 0; color:#8a94a5; font-size:11px; }
.table-heading-icon { color:#8b9bb3; font-size:21px; }
.table-scroll { overflow-x:auto; }
table { border-collapse:collapse; width:100%; min-width:1000px; }
thead { background:#f8f9fb; }
th { padding:12px 14px; text-align:left; color:#778397; font-size:9px; text-transform:uppercase; letter-spacing:.55px; font-weight:750; white-space:nowrap; border-top:1px solid #edf0f4; border-bottom:1px solid #edf0f4; }
td { padding:13px 14px; border-bottom:1px solid #eff1f4; font-size:11px; vertical-align:middle; white-space:nowrap; }
tbody tr:hover { background:#fbfcfe; }
.order-number { font-weight:750; color:#2d4774; font-size:12px; }.order-id { display:block; color:#9aa3b1; margin-top:4px; font-size:9px; }
.status { display:inline-flex; align-items:center; border-radius:20px; padding:6px 9px; font-size:10px; font-weight:700; }
.status-unknown { background:#f0f1f3; color:#667085; }
.table-select { max-width:160px; width:100%; border:1px solid #e0e5ec; background:#fff; border-radius:6px; padding:7px 25px 7px 8px; color:#475467; font-size:10px; outline:none; }
.status-controls,.row-actions { display:flex; align-items:center; gap:6px; }
.arrow-btn { width:27px; height:27px; border:1px solid #e0e5ec; border-radius:6px; background:#fff; color:#52637d; font-size:17px; line-height:1; }
.arrow-btn:hover:not(:disabled),.page-btn:hover:not(:disabled) { background:#edf2fb; border-color:#c8d5eb; }
.arrow-btn:disabled,.page-btn:disabled { opacity:.35; cursor:not-allowed; }
.btn-save-order { border:0; border-radius:6px; background:#eaf0fb; color:#3157a4; padding:8px 10px; font-size:10px; font-weight:700; }
.btn-save-order:hover { background:#dce7fa; }
.btn-history { width:29px; height:29px; border:1px solid #e0e6ef; border-radius:7px; color:#526b96; background:white; font-size:18px; }
.btn-history:hover { background:#f0f4fb; border-color:#cbd8eb; }
.muted { color:#98a1af; font-size:10px; }
.empty { padding:35px; text-align:center; color:#8b95a5; font-size:12px; }
.page-error,.form-error,.history-error { color:#b42318; font-size:11px; padding:0 20px; }
.page-error:empty,.form-error:empty,.history-error:empty { display:none; }
.pagination { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:14px 20px; border-top:1px solid #edf0f4; color:#778397; font-size:10px; }
.pagination-controls,.page-numbers { display:flex; align-items:center; gap:5px; }
.page-btn { min-width:29px; height:29px; border:1px solid #e2e7ee; border-radius:6px; background:white; color:#53627a; font-size:13px; }
.page-number { font-size:10px; }.page-number.active { background:var(--primary); border-color:var(--primary); color:#fff; }
.page-size-label { display:flex; align-items:center; gap:7px; }
.page-size-label select { border:1px solid #e1e6ed; border-radius:5px; padding:5px; color:#53627a; background:white; font-size:10px; }
.drawer-backdrop { position:fixed; inset:0; z-index:50; background:rgba(15,23,42,.35); opacity:0; visibility:hidden; transition:.22s; }
.drawer-backdrop.visible { opacity:1; visibility:visible; }
.history-drawer { position:fixed; z-index:51; top:0; right:0; height:100vh; width:min(480px,100%); background:#fff; box-shadow:-12px 0 35px rgba(16,24,40,.12); transform:translateX(105%); transition:transform .25s ease; display:flex; flex-direction:column; }
.history-drawer.open { transform:translateX(0); }
.drawer-header { display:flex; justify-content:space-between; gap:15px; padding:27px 25px 21px; border-bottom:1px solid var(--line); }
.drawer-header h2 { margin:0; font-size:19px; }.drawer-subtitle { margin:7px 0 0; color:#7c8798; font-size:11px; }
.drawer-close { border:0; background:#f3f5f8; color:#526071; width:32px; height:32px; border-radius:8px; font-size:22px; line-height:1; }
.drawer-content { overflow-y:auto; padding:22px 24px; flex:1; }
.history-state { padding:25px 10px; color:#8792a2; text-align:center; font-size:12px; }
.timeline { position:relative; padding-left:19px; }
.timeline:before { content:""; position:absolute; top:8px; bottom:10px; left:5px; width:1px; background:#dce4ef; }
.timeline-item { position:relative; padding-bottom:19px; }
.timeline-marker { position:absolute; left:-19px; top:4px; width:11px; height:11px; border-radius:50%; background:#fff; border:3px solid #5277b8; z-index:1; }
.timeline-card { border:1px solid #e8edf3; border-radius:9px; padding:13px 14px; background:#fff; }
.timeline-top { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:12px; }
.timeline-top strong { font-size:12px; color:#344767; }.timeline-top time { font-size:9px; color:#8994a4; white-space:nowrap; }
.timeline-detail { display:flex; justify-content:space-between; gap:12px; padding:6px 0; border-top:1px solid #f0f2f5; font-size:10px; }
.timeline-detail span { color:#8a95a5; }.timeline-detail strong { color:#46546a; font-weight:600; text-align:right; }
.timeline-comment { margin:10px 0 0; padding:9px; background:#f7f9fc; border-radius:6px; color:#667085; font-size:10px; line-height:1.5; }
.drawer-footer { border-top:1px solid var(--line); padding:15px 24px; color:#8993a2; font-size:10px; display:flex; align-items:center; gap:8px; }
.modal-overlay { position:fixed; inset:0; z-index:60; background:rgba(15,23,42,.45); display:none; align-items:center; justify-content:center; padding:20px; }
.modal-overlay.active { display:flex; }
.modal-container { width:min(480px,100%); max-height:90vh; overflow:auto; background:#fff; border-radius:13px; box-shadow:0 20px 60px rgba(0,0,0,.2); }
.modal-header { display:flex; justify-content:space-between; padding:23px 24px 17px; border-bottom:1px solid var(--line); }
.modal-header h2 { margin:0; font-size:18px; }.modal-header p { margin:6px 0 0; color:#8993a2; font-size:11px; }
.modal-close { border:0; background:none; font-size:25px; color:#788496; }
#create-order-form { padding:19px 24px 22px; }
.form-group { margin-bottom:15px; }.form-group label { display:block; margin-bottom:7px; color:#475467; font-size:11px; font-weight:650; }
.form-group input,.form-group select { width:100%; height:39px; border:1px solid #dfe4eb; border-radius:7px; padding:0 11px; outline:none; background:#fff; font-size:12px; color:#344054; }
.form-divider { padding:12px 0; margin:2px 0 14px; border-top:1px solid #edf0f4; color:#75839a; font-size:10px; text-transform:uppercase; letter-spacing:.8px; font-weight:750; }
.modal-footer { display:flex; justify-content:flex-end; gap:8px; margin-top:17px; }
.btn-secondary { border:1px solid #dfe4eb; background:#fff; color:#586579; padding:10px 14px; border-radius:7px; font-size:11px; }
.form-error { padding:0; }
body.drawer-open { overflow:hidden; }
@media (max-width:1050px) {
    .sidebar { width:210px; }.main-content { margin-left:210px; }.page-content { padding:27px 22px; }.topbar { padding:0 22px; }
}
@media (max-width:760px) {
    .sidebar { transform:translateX(-100%); transition:transform .2s; box-shadow:8px 0 30px rgba(0,0,0,.15); }
    .sidebar.mobile-open { transform:translateX(0); }
    .main-content { margin-left:0; }.topbar { justify-content:flex-start; gap:12px; padding:0 16px; }.mobile-menu { display:block; }.topbar-tag { margin-left:auto; }
    .page-content { padding:23px 13px 35px; }.page-heading { align-items:flex-start; flex-direction:column; }.page-heading .btn-primary { align-self:stretch; }
    .toolbar { align-items:stretch; flex-direction:column; }.toolbar-summary { padding:0; }
    .pagination { flex-wrap:wrap; }.pagination-info { width:100%; }
}
@media (max-width:430px) {
    .topbar-tag { display:none; }.page-heading h1 { font-size:23px; }.pagination { justify-content:center; }.pagination > span { width:100%; text-align:center; }
    .drawer-header { padding:22px 18px 17px; }.drawer-content { padding:18px; }
}
