:root {
    --ink: #101828;
    --muted: #667085;
    --soft-muted: #98a2b3;
    --line: #dfe6e9;
    --line-soft: #edf1f3;
    --surface: rgba(255,255,255,.88);
    --teal: #167f96;
    --teal-dark: #10677a;
    --teal-soft: #e9f6f8;
    --orange: #f97316;
    --orange-dark: #d95d0b;
    --orange-soft: #fff3e8;
    --green: #218653;
    --green-soft: #eaf7ef;
    --red: #b5473e;
    --red-soft: #fff0ef;
    --amber: #a66608;
    --amber-soft: #fff7e6;
    --blue: #3477b8;
    --blue-soft: #edf5ff;
    --purple: #7655b5;
    --purple-soft: #f3efff;
    --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #f5fafb; }
body { margin: 0; color: var(--ink); background: #f5fafb; font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 400; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 50; height: 72px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.topbar-inner { width: min(1240px, calc(100% - 32px)); height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 164px; text-decoration: none; letter-spacing: -.03em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #cfe8ed; border-radius: 12px; color: var(--teal); background: var(--teal-soft); font-size: 19px; }
.brand strong { font-size: 17px; font-weight: 600; }
.brand em { color: var(--orange); font-size: 17px; font-style: normal; font-weight: 600; }
.main-nav { flex: 1; display: flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
.main-nav a { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid transparent; border-radius: 10px; color: #526171; font-size: 12px; font-weight: 500; text-decoration: none; }
.main-nav a > i { flex: 0 0 auto; color: #71818d; font-size: 14px; line-height: 1; }
.main-nav a:hover { color: var(--teal-dark); background: #f3f9fa; }
.main-nav a.active { border-color: #cfe8ed; color: var(--teal-dark); background: var(--teal-soft); }
.main-nav a:hover > i, .main-nav a.active > i { color: var(--teal); }
.profile { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 155px; padding: 0; border: 0; color: inherit; background: transparent; font-family: inherit; text-decoration: none; cursor: pointer; }
.profile-copy { display: grid; text-align: right; }
.profile-copy strong { font-size: 11px; font-weight: 500; }
.profile-copy small { margin-top: 1px; color: var(--soft-muted); font-size: 11px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #f8d6bb; border-radius: 11px; color: var(--orange-dark); background: var(--orange-soft); font-size: 11px; font-weight: 600; }
.nav-toggle { display: none; width: 40px; height: 40px; margin-left: auto; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #fff; cursor: pointer; }

.page-wrap { min-height: calc(100vh - 72px); padding: 26px 0 44px; background: radial-gradient(circle at 10% 0%, rgba(125,211,252,.22), transparent 25%), radial-gradient(circle at 90% 0%, rgba(251,146,60,.10), transparent 24%), linear-gradient(135deg,#edf7f9 0%,#fff 42%,#f8f5f0 100%); }
.shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }
.hero { min-height: 154px; display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 18px; padding: 26px 28px; border: 1px solid rgba(15,23,42,.10); border-radius: 22px; background: rgba(255,255,255,.72); overflow: hidden; position: relative; }
.hero::after { content: ''; position: absolute; width: 330px; height: 150px; right: -90px; top: -70px; border: 1px solid rgba(22,127,150,.12); border-radius: 50%; transform: rotate(-14deg); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; }
.kicker { display: inline-flex; align-items: center; gap: 7px; min-height: 29px; margin-bottom: 10px; padding: 0 10px; border: 1px solid #cfe8ed; border-radius: 999px; color: var(--teal); background: rgba(233,246,248,.8); font-size: 11px; font-weight: 500; }
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero h1 { margin: 0; color: #0f172a; font-size: 26px; line-height: 1.2; letter-spacing: -.035em; font-weight: 600; }
.hero p { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.hero-action { min-width: 300px; position: relative; z-index: 1; padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.78); }
.hero-action-label { color: var(--teal); font-size: 11px; font-weight: 500; }
.hero-action strong { display: block; margin: 4px 0 11px; font-size: 13px; font-weight: 500; }
.hero-buttons { display: flex; gap: 8px; justify-content: flex-end; }

.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid #cfd8dc; border-radius: 11px; color: #344054; background: #fff; font-size: 12px; font-weight: 500; text-decoration: none; cursor: pointer; box-shadow: none; }
.btn:hover { border-color: #aebec4; background: #fbfcfc; }
.btn.primary { border-color: var(--orange); color: #fff; background: var(--orange); }
.btn.primary:hover { border-color: var(--orange-dark); background: var(--orange-dark); }
.btn.soft { border-color: #f5cfaf; color: var(--orange-dark); background: var(--orange-soft); }
.btn.small { min-height: 35px; padding: 0 11px; font-size: 11px; }

.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.stats.five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.stat-card { min-height: 116px; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stat-label { color: #475467; font-size: 12px; font-weight: 500; }
.stat-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; color: var(--teal); background: var(--teal-soft); font-size: 16px; }
.stat-icon.orange { color: var(--orange-dark); background: var(--orange-soft); }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.red { color: var(--red); background: var(--red-soft); }
.stat-icon.purple { color: var(--purple); background: var(--purple-soft); }
.stat-value { margin-top: 8px; color: #101828; font-size: 24px; line-height: 1; letter-spacing: -.025em; font-weight: 600; }
.stat-foot { margin-top: 7px; color: var(--muted); font-size: 11px; }

.content-grid { display: grid; grid-template-columns: minmax(0,1.42fr) minmax(380px,.78fr); gap: 18px; align-items: start; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel + .panel { margin-top: 18px; }
.panel-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); }
.panel-title-wrap { display: flex; align-items: center; gap: 10px; }
.panel-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--teal); background: var(--teal-soft); font-size: 15px; }
.panel-title { margin: 0; font-size: 14px; font-weight: 500; }
.panel-subtitle { margin-top: 3px; color: var(--soft-muted); font-size: 11px; }
.panel-link { color: var(--orange-dark); font-size: 11px; font-weight: 500; text-decoration: none; }
.panel-body { padding: 18px; }
.scroll-list { max-height: 420px; overflow: auto; scrollbar-width: thin; scrollbar-color: #c6d1d5 transparent; }

.project-row { display: grid; grid-template-columns: minmax(220px,1.45fr) minmax(160px,.9fr) 115px 122px; gap: 14px; align-items: center; min-height: 94px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.project-row:hover, .activity-row:hover, .table-row:hover { background: rgba(233,246,248,.38); }
.project-row:last-child, .activity-row:last-child, .table-row:last-child { border-bottom: 0; }
.company { color: var(--teal); font-size: 11px; font-weight: 500; }
.record-title { margin-top: 3px; color: var(--ink); font-size: 13px; font-weight: 500; }
.record-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }
.metric-pair { display: flex; gap: 16px; }
.metric-pair div { display: grid; gap: 3px; }
.metric-pair small, .meta-label { color: var(--soft-muted); font-size: 11px; }
.metric-pair strong { font-size: 12px; font-weight: 500; }
.percent { color: var(--teal-dark); font-size: 12px; font-weight: 500; }
.badge { width: max-content; min-height: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; border-radius: 999px; color: var(--teal-dark); background: var(--teal-soft); font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge.success { color: var(--green); background: var(--green-soft); }
.badge.warning { color: var(--amber); background: var(--amber-soft); }
.badge.danger { color: var(--red); background: var(--red-soft); }
.badge.info { color: var(--blue); background: var(--blue-soft); }
.badge.purple { color: var(--purple); background: var(--purple-soft); }
.activity-head, .activity-row { display: grid; grid-template-columns: minmax(160px,1.5fr) 155px minmax(145px,1fr) 125px 52px; gap: 12px; align-items: center; }
.activity-head { min-height: 42px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); color: var(--muted); background: #f8fafb; font-size: 11px; font-weight: 500; }
.activity-row { min-height: 68px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); color: #475467; font-size: 11px; }
.activity-row strong { display: block; color: var(--ink); font-size: 12px; font-weight: 500; }

.toolbar { display: grid; grid-template-columns: minmax(220px,1.5fr) repeat(3,minmax(150px,1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); background: rgba(248,250,251,.75); }
.field { display: grid; gap: 6px; }
.field label { color: #475467; font-size: 11px; font-weight: 500; }
.input, .select { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid #cfd8dc; border-radius: 11px; outline: none; color: var(--ink); background: #fff; font-size: 12px; box-shadow: none; }
.input:focus, .select:focus { border-color: var(--teal); }
.input-wrap { position: relative; }
.input-wrap i { position: absolute; top: 50%; left: 13px; color: var(--soft-muted); transform: translateY(-50%); }
.input-wrap .input { padding-left: 37px; }

.project-list-head, .project-list-row { display: grid; grid-template-columns: minmax(250px,1.6fr) 135px 130px 95px 105px 115px; gap: 14px; align-items: center; }
.project-list-head { min-height: 43px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); color: var(--muted); background: #f8fafb; font-size: 11px; font-weight: 500; }
.project-list-row { min-height: 86px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.project-list-row:hover { background: rgba(233,246,248,.38); }
.project-list-row:last-child { border-bottom: 0; }
.project-list-row > span { color: #475467; font-size: 11px; }

.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.detail-meta span { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: #475467; background: #fff; font-size: 11px; }
.stats.detail { grid-template-columns: repeat(5,minmax(0,1fr)); }
.location-head, .location-row { display: grid; grid-template-columns: minmax(240px,1.6fr) repeat(4,minmax(105px,.65fr)); gap: 12px; align-items: center; }
.location-head { min-height: 43px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); color: var(--muted); background: #f8fafb; font-size: 11px; font-weight: 500; }
.location-row { min-height: 67px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); color: #475467; font-size: 12px; }
.location-row strong { color: var(--ink); font-weight: 500; }

.inventory-table { min-width: 1140px; }
.inventory-head, .inventory-row { display: grid; grid-template-columns: 124px 150px minmax(150px,1fr) minmax(170px,1.2fr) 145px minmax(155px,1.1fr) 110px 72px; gap: 12px; align-items: center; }
.inventory-head, .results-head { position: sticky; top: 0; z-index: 2; min-height: 43px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); background: #f8fafb; font-size: 11px; font-weight: 500; }
.inventory-row { min-height: 69px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); color: #475467; font-size: 11px; }
.inventory-row strong, .results-row strong { display: block; color: var(--ink); font-size: 11px; font-weight: 500; }
.inventory-row code { color: var(--teal-dark); font-family: 'Poppins',sans-serif; font-size: 11px; }
.table-scroll { max-height: 512px; overflow: auto; scrollbar-width: thin; scrollbar-color: #c6d1d5 transparent; }

.segments { display: flex; flex-wrap: wrap; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.segment { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: #526171; background: #fff; font-size: 11px; font-weight: 500; cursor: pointer; }
.segment:hover, .segment.active { border-color: #c1e1e7; color: var(--teal-dark); background: var(--teal-soft); }
.results-table { min-width: 1180px; }
.results-head, .results-row { display: grid; grid-template-columns: 124px 150px minmax(175px,1.25fr) minmax(150px,1fr) minmax(150px,1fr) 135px 110px; gap: 12px; align-items: center; }
.results-row { min-height: 69px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); color: #475467; font-size: 11px; }

.report-grid, .management-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.report-card, .management-card { min-height: 180px; display: flex; flex-direction: column; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.management-card { min-height: 188px; color: var(--ink); text-decoration: none; transition: .16s ease; }
.management-card:hover { border-color: #bcdde4; background: rgba(245,251,252,.95); transform: translateY(-1px); }
.report-card-icon, .management-card-icon { width: 41px; height: 41px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 12px; color: var(--teal); background: var(--teal-soft); font-size: 18px; }
.report-card h2, .management-card h2 { margin: 0; font-size: 14px; font-weight: 500; }
.report-card p, .management-card p { margin: 7px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.report-meta, .management-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-count, .management-count { color: var(--teal-dark); font-size: 12px; font-weight: 500; }
.report-actions { display: flex; gap: 6px; }

.placeholder-card { min-height: 360px; display: grid; place-items: center; padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.placeholder-content { max-width: 610px; }
.placeholder-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 16px; color: var(--teal); background: var(--teal-soft); font-size: 23px; }
.placeholder-content .badge { margin-bottom: 12px; }
.placeholder-content h2 { margin: 0; font-size: 19px; font-weight: 500; }
.placeholder-content p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.placeholder-note { margin-top: 17px !important; padding-top: 17px; border-top: 1px solid var(--line-soft); color: #475467 !important; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; background: rgba(15,23,42,.42); }
.modal-backdrop.open { display: grid; }
.modal { width: min(640px,100%); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.modal-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 500; }
.modal-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; cursor: pointer; }
.modal-body { padding: 19px 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-full { grid-column: 1/-1; }
.upload-zone { min-height: 116px; display: grid; place-items: center; padding: 18px; border: 1px dashed #b9c9cf; border-radius: 14px; color: var(--muted); background: #f8fbfb; text-align: center; cursor: pointer; }
.upload-zone i { display: block; margin-bottom: 7px; color: var(--teal); font-size: 23px; }
.upload-note { margin-top: 13px; padding: 12px 13px; border: 1px solid #d8eaee; border-radius: 12px; color: #526171; background: #f4fafb; font-size: 11px; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 150; max-width: 390px; padding: 13px 16px; border: 1px solid #c6e2d2; border-radius: 12px; color: #176b43; background: #eef9f2; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(430px,.9fr); background: radial-gradient(circle at 12% 8%,rgba(125,211,252,.32),transparent 30%),radial-gradient(circle at 80% 7%,rgba(251,146,60,.16),transparent 28%),linear-gradient(135deg,#edf7fb 0%,#fff 42%,#f8f4ee 100%); }
.login-showcase { display: flex; flex-direction: column; justify-content: space-between; padding: 46px 7vw 42px; }
.login-content { max-width: 650px; margin: auto 0; padding: 45px 0; }
.login-content h1 { margin: 0; max-width: 640px; font-size: clamp(37px,4vw,48px); line-height: 1.08; letter-spacing: -.05em; font-weight: 600; }
.login-content h1 strong { color: var(--orange); font-weight: 600; }
.login-content > p { max-width: 590px; margin: 19px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.feature-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 27px; }
.feature-card { min-height: 90px; display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.62); }
.feature-card i { width: 39px; height: 39px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; color: var(--teal); background: var(--teal-soft); font-size: 17px; }
.feature-card strong { display: block; font-size: 12px; font-weight: 500; }
.feature-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-footer { color: var(--muted); font-size: 11px; }
.login-panel-area { display: grid; place-items: center; padding: 38px; border-left: 1px solid var(--line-soft); background: rgba(255,255,255,.42); backdrop-filter: blur(16px); }
.login-panel { width: min(440px,100%); padding: 34px; border: 1px solid var(--line); border-radius: 25px; background: rgba(255,255,255,.9); }
.login-panel h2 { margin: 0; font-size: 26px; letter-spacing: -.035em; font-weight: 600; }
.login-panel > p { margin: 8px 0 23px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.login-panel .field + .field { margin-top: 13px; }
.login-submit { width: 100%; margin-top: 20px; }
.login-help { margin-top: 18px; padding: 12px 13px; border: 1px solid #d8eaee; border-radius: 12px; color: var(--muted); background: #f4fafb; font-size: 11px; line-height: 1.6; }
.login-error { margin-bottom: 15px; padding: 11px 12px; border: 1px solid #f1c9c5; border-radius: 11px; color: var(--red); background: var(--red-soft); font-size: 11px; }

@media (max-width: 1100px) {
    .topbar-inner { gap: 12px; }
    .brand { min-width: auto; }
    .main-nav a { padding: 0 8px; }
    .profile-copy { display: none; }
    .profile { min-width: auto; }
    .stats.five, .stats.detail { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .project-list-head, .project-list-row { grid-template-columns: minmax(220px,1.5fr) 120px 120px 90px 110px; }
    .project-list-head > :nth-child(5), .project-list-row > :nth-child(5) { display: none; }
}

@media (max-width: 860px) {
    .nav-toggle { display: grid; place-items: center; }
    .profile { display: none; }
    .main-nav { position: absolute; top: 72px; left: 16px; right: 16px; display: none; align-items: stretch; flex-direction: column; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
    .main-nav.open { display: flex; }
    .main-nav a { justify-content: flex-start; min-height: 43px; }
    .hero { align-items: flex-start; flex-direction: column; }
    .hero-action { width: 100%; min-width: 0; }
    .stats, .stats.five, .stats.detail { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .content-grid { grid-template-columns: 1fr; }
    .toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .project-list-head { display: none; }
    .project-list-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 14px; }
    .project-list-row > :first-child { grid-column: 1/-1; }
    .project-list-row > :nth-child(5) { display: block; }
    .report-grid, .management-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .login-page { display: block; }
    .login-showcase { display: none; }
    .login-panel-area { min-height: 100vh; border-left: 0; }
}

@media (max-width: 620px) {
    .topbar-inner, .shell { width: min(100% - 22px,1240px); }
    .page-wrap { padding-top: 16px; }
    .hero { min-height: 0; padding: 21px; border-radius: 18px; }
    .hero h1 { font-size: 23px; }
    .stats, .stats.five, .stats.detail { grid-template-columns: 1fr; }
    .toolbar, .form-grid { grid-template-columns: 1fr; }
    .form-full { grid-column: 1; }
    .project-row { grid-template-columns: 1fr 1fr; }
    .project-row > :first-child { grid-column: 1/-1; }
    .activity-head { display: none; }
    .activity-row { grid-template-columns: 1fr 1fr; }
    .activity-row > :first-child { grid-column: 1/-1; }
    .report-grid, .management-grid { grid-template-columns: 1fr; }
    .login-panel-area { padding: 20px 15px; }
    .login-panel { padding: 27px 20px; }
}
