:root {
    --bg: #edf3f9;
    --card: #ffffff;
    --line: #d7e2ef;
    --text: #0f2340;
    --muted: #64748b;
    --blue: #1d4ed8;
    --blue-dark: #0f2d63;
    --blue-soft: #edf4ff;
    --green: #059669;
    --green-soft: #ecfdf5;
    --orange: #d97706;
    --orange-soft: #fff7ed;
    --rose: #e11d48;
    --rose-soft: #fff1f2;
    --gray-soft: #f8fafc;
    --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 16px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, rgba(29,78,216,.09), transparent 30%), linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}
button, input, textarea, select { font: inherit; }
.hidden { display: none !important; }
.container { max-width: 1260px; margin: 0 auto; padding: 24px; }

.topbar {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(255,255,255,.84);
    border-bottom: 1px solid rgba(215,226,239,.95);
}
.topbar-inner {
    max-width: 1260px; margin: 0 auto; padding: 16px 24px;
    display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-badge {
    width: 52px; height: 52px; border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #0f2d63);
    color: white; font-size: 24px; font-weight: 800; display: grid; place-items: center;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .25);
}
.brand h1 { margin: 0; font-size: 24px; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.tabs {
    display: inline-flex; gap: 6px; padding: 6px;
    border-radius: 18px; border: 1px solid var(--line); background: #f1f5f9;
}
.tab {
    border: 0; background: transparent; border-radius: 14px; padding: 10px 16px; cursor: pointer;
    font-weight: 700; color: #334155; transition: .18s ease;
}
.tab.active { background: #fff; color: var(--blue); box-shadow: 0 2px 10px rgba(15,23,42,.06); }

.tab a{
    text-decoration: none;
    color: #334155;
}

.hero {
    display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) auto;
    padding: 28px; border-radius: 28px; color: white;
    background: linear-gradient(135deg, #0f172a 0%, #0f2d63 52%, #1d4ed8 100%);
    box-shadow: var(--shadow); margin-bottom: 24px;
}
.hero h2 { margin: 0; font-size: 30px; }
.hero p { margin: 12px 0 0; max-width: 820px; color: rgba(255,255,255,.86); line-height: 1.75; }
.hero-stats { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(110px, 1fr)); }
.hero-stat {
    padding: 16px; border-radius: 18px; border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.1); backdrop-filter: blur(8px);
}
.hero-stat .k { font-size: 12px; color: rgba(255,255,255,.8); }
.hero-stat .v { margin-top: 8px; font-size: 24px; font-weight: 800; }

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-xl);
    box-shadow: var(--shadow); padding: 22px;
}
.card h3 { margin: 0 0 6px; font-size: 20px; }
.desc { color: var(--muted); font-size: 14px; line-height: 1.7; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.layout-admin { grid-template-columns: 380px minmax(0, 1fr); }

.stat {
    background: #fff; border: 1px solid var(--line); border-radius: 22px;
    box-shadow: var(--shadow); padding: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { margin-top: 8px; font-size: 28px; font-weight: 800; }
.stat .icon {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
    background: #f8fafc; color: var(--blue-dark); font-size: 20px;
}

.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 700; color: #334155; }
.input, .textarea, .select {
    width: 100%; border: 1px solid var(--line); background: #f8fafc; color: var(--text);
    border-radius: 16px; padding: 13px 14px; outline: none; transition: .18s ease;
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: #8fb2ff; background: #fff; }
.input[disabled] { background: #eef2f7; color: #64748b; cursor: not-allowed; }

.btn {
    border: 0; border-radius: 16px; padding: 13px 18px; cursor: pointer; font-weight: 700; transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #2563eb, #0f2d63); color: white; box-shadow: 0 12px 20px rgba(37, 99, 235, .2); }
.btn-secondary { background: #eef2ff; color: #1e3a8a; }
.btn-light { background: #f8fafc; color: #0f172a; border: 1px solid var(--line); }
.btn-danger { background: linear-gradient(135deg, #fb7185, #e11d48); color: white; box-shadow: 0 12px 20px rgba(225,29,72,.18); }
.btn-full { width: 100%; }

.badge {
    display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 12px;
    font-size: 12px; font-weight: 800; border: 1px solid transparent;
}
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: #bfdbfe; }
.badge-green { background: var(--green-soft); color: var(--green); border-color: #bbf7d0; }
.badge-orange { background: var(--orange-soft); color: var(--orange); border-color: #fed7aa; }
.badge-gray { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.badge-red { background: var(--rose-soft); color: var(--rose); border-color: #fecdd3; }

.state-box {
    padding: 52px 18px; text-align: center; border-radius: 24px; border: 1px dashed #cbd5e1;
    background: rgba(255,255,255,.8);
}
.state-icon {
    width: 64px; height: 64px; border-radius: 999px; margin: 0 auto; display: grid; place-items: center;
    background: #eff6ff; color: var(--blue); font-size: 28px;
}
.state-box h3 { margin: 14px 0 8px; }
.state-box p { margin: 0; color: var(--muted); line-height: 1.7; }

.search-bar-customer { display: grid; gap: 12px; grid-template-columns: 5fr 1fr auto; }
.quick-list { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.quick-list span { color: var(--muted); font-size: 12px; }

.overview { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0,1fr)); }
.overview5 { display: grid; gap: 16px; grid-template-columns: repeat(5, minmax(0,1fr)); }
.overview-item {
    background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 18px;
}
.overview-item .k { font-size: 13px; color: var(--muted); }
.overview-item .v { margin-top: 10px; font-size: 22px; font-weight: 800; word-break: break-word; }

.timeline { display: grid; gap: 18px; }
.timeline-item { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 16px; }
.timeline-left { display: flex; flex-direction: column; align-items: center; }
.timeline-dot {
    width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center;
    border: 2px solid #dbe3ee; background: #f8fafc; color: #94a3b8; font-size: 14px; font-weight: 800;
}
.timeline-dot.done { background: var(--green-soft); color: var(--green); border-color: #bbf7d0; }
.timeline-dot.current { background: var(--blue-soft); color: var(--blue); border-color: #bfdbfe; box-shadow: 0 0 0 5px rgba(37,99,235,.08); }
.timeline-dot.skipped { background: var(--orange-soft); color: var(--orange); border-color: #fed7aa; }
.timeline-line { width: 3px; min-height: 54px; margin-top: 8px; border-radius: 999px; background: #dbe3ee; }
.timeline-line.done { background: #86efac; }
.timeline-card {
    background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px;
}
.timeline-card.done { background: rgba(236,253,245,.76); border-color: #d1fae5; }
.timeline-card.current { background: rgba(239,246,255,.94); border-color: #bfdbfe; }
.timeline-card.skipped { background: rgba(255,247,237,.94); border-color: #fed7aa; }
.timeline-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.timeline-step { font-size: 18px; font-weight: 800; }
.timeline-note { margin-top: 10px; color: var(--muted); line-height: 1.75; }

.thumb-grid { display: grid; gap: 12px; grid-template-columns: repeat(150, minmax(150px, 1fr)); margin-top: 16px; }
.thumb {
    position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.thumb img { width: 100%; height: 128px; object-fit: cover; display: block; }
.thumb span {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
    font-size: 12px; color: #fff; background: linear-gradient(180deg, transparent, rgba(15,23,42,.72));
}

.list { display: grid; gap: 12px; }
.order-search-box {
    margin: 14px 0 16px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: #f8fafc;
}
.order-item {
    border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; padding: 16px; cursor: pointer; transition: .18s ease;
}
.order-item:hover { transform: translateY(-1px); border-color: #94a3b8; background: #fff; }
.order-item.active { background: var(--blue-soft); border-color: #bfdbfe; }
.order-item h4 { margin: 0; font-size: 17px; }
.order-item p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.section-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.muted-small { font-size: 12px; color: var(--muted); }
.check-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.check-card {
    display: flex; gap: 10px; align-items: flex-start; border-radius: 16px; border: 1px solid var(--line);
    background: #f8fafc; padding: 12px;
}
.check-card input { margin-top: 2px; }
.check-card span { font-size: 13px; line-height: 1.55; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.history-item {
    border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; padding: 16px;
}
.history-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }

.upload-box {
    border: 1px dashed #cbd5e1; border-radius: 22px; background: #f8fafc; text-align: center; padding: 26px 18px;
    cursor: pointer; transition: .18s ease;
}
.upload-box:hover { background: #eff6ff; border-color: #93c5fd; }

.notice {
    margin-top: 12px; padding: 12px 14px; border-radius: 16px; font-size: 13px; line-height: 1.65;
}
.notice.success { background: var(--green-soft); color: var(--green); border: 1px solid #bbf7d0; }
.notice.error { background: var(--rose-soft); color: var(--rose); border: 1px solid #fecdd3; }
.notice.info { background: var(--blue-soft); color: var(--blue); border: 1px solid #bfdbfe; }

.modal {
    position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 18px;
    background: rgba(2, 6, 23, .78);
}
.modal.show { display: flex; }
.modal-card {
    width: 100%; max-width: 560px; background: #fff; border-radius: 26px; box-shadow: 0 24px 60px rgba(2,6,23,.35); overflow: hidden;
}
.modal-card.image-modal { max-width: 1000px; background: #0f172a; }
.modal-head {
    padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #e2e8f0;
}
.image-modal .modal-head { border-bottom-color: rgba(255,255,255,.08); color: white; }
.close-btn {
    border: 0; width: 40px; height: 40px; border-radius: 999px; cursor: pointer; font-size: 20px;
    background: #f1f5f9; color: #0f172a;
}
.image-modal .close-btn { background: rgba(255,255,255,.14); color: white; }
.modal-body { padding: 20px; }
.preview-wrap { padding: 12px; }
.preview-wrap img { width: 100%; max-height: 82vh; object-fit: contain; border-radius: 18px; background: #111827; display: block; }

.footer {
    margin-top: 24px; text-align: center; color: var(--muted); font-size: 12px;
}

@media (max-width: 1100px) {
    .hero { grid-template-columns: 1fr; }
    .grid-4, .overview, .layout-admin, .grid-2 { grid-template-columns: 1fr 1fr; }
    .search-bar-customer { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .container, .topbar-inner { padding: 16px; }
    .grid-4, .overview, .layout-admin, .grid-2, .hero-stats { grid-template-columns: 1fr; }
    .hero { padding: 22px; }
    .hero h2 { font-size: 24px; }
    .brand h1 { font-size: 20px; }
    .timeline-item { grid-template-columns: 42px minmax(0,1fr); gap: 12px; }
    .timeline-dot { width: 34px; height: 34px; font-size: 12px; }
    .timeline-line { min-height: 44px; }
}