@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  font-family: "DM Sans", sans-serif;
  color: #17231d;
  background: #f5f6f1;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #172d24;
  --muted: #78827b;
  --line: #e7eae3;
  --lime: #d8f16a;
  --paper: #fff;
  --canvas: #f5f6f1;
  --soft-green: #eaf3e9;
  --shadow: 0 18px 55px rgba(24, 42, 31, .08);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(132, 167, 47, .4);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: #8a948d; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 800 21px Manrope, sans-serif; letter-spacing: -.06em; }
.brand-mark { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: var(--lime); font-size: 17px; }

/* Login */
.login-page { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, 1fr) minmax(430px, 1fr); background: #fff; }
.login-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 38px 8%; color: #fff; background: var(--ink); }
.login-visual:before, .login-visual:after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; width: 570px; height: 570px; right: -210px; top: 20%; }
.login-visual:after { width: 430px; height: 430px; right: -140px; top: 31%; }
.login-visual .brand { position: relative; z-index: 1; color: white; }
.login-visual-copy { position: relative; z-index: 1; max-width: 490px; margin: auto 0; padding: 55px 0; }
.login-visual-copy h1 { margin: 17px 0; font: 700 clamp(38px, 5vw, 64px)/1.07 Manrope, sans-serif; letter-spacing: -.06em; }
.login-visual-copy p { color: #bdc9bf; line-height: 1.8; max-width: 390px; }
.login-art { position: absolute; width: min(420px, 90%); right: 4%; bottom: 6%; opacity: .9; }
.login-foot { position: relative; z-index: 1; color: #aab8ad; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: min(100%, 410px); }
.login-box h2 { margin: 14px 0 8px; font: 700 31px Manrope, sans-serif; letter-spacing: -.05em; }
.login-box > p { margin: 0 0 29px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #f1f3ee; border-radius: 12px; padding: 4px; margin: 24px 0; }
.role-switch button { border: 0; border-radius: 9px; color: #78827b; background: transparent; padding: 11px; font-size: 13px; font-weight: 600; }
.role-switch button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field label { color: #34443a; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 13px; border: 1px solid #dfe4dc; border-radius: 9px; background: #fff; color: var(--ink); font-size: 13px; }
.field textarea { min-height: 78px; resize: vertical; }
.field input::placeholder { color: #a6aea8; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 9px; padding: 11px 16px; font-size: 13px; font-weight: 700; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: white; }
.btn-primary:hover { background: #284335; }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-outline { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn-quiet { padding: 8px; background: transparent; color: var(--muted); }
.btn-block { width: 100%; padding: 13px; }
.demo-note { border: 1px solid #e8eee1; border-radius: 10px; background: #f8faf4; margin-top: 21px; padding: 12px; color: #60705f; font-size: 11px; line-height: 1.75; }
.demo-note strong { color: var(--ink); }

/* App shell */
.app-shell { display: grid; min-height: 100vh; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: white; padding: 24px 16px 18px; }
.sidebar .brand { padding: 2px 11px 32px; }
.workspace-label { padding: 0 11px 9px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; border: 0; border-radius: 9px; padding: 11px 12px; background: transparent; color: #78827b; text-align: left; font-size: 13px; font-weight: 600; }
.nav-item:hover { background: #f7f8f5; color: var(--ink); }
.nav-item.active { background: var(--soft-green); color: #274c35; }
.nav-icon { display: grid; place-items: center; width: 18px; font-size: 17px; }
.side-bottom { margin-top: auto; }
.help-card { border-radius: 12px; background: #f5f7f1; padding: 14px; margin: 18px 2px; }
.help-card strong { display: block; font-size: 12px; margin-bottom: 5px; }
.help-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #e8eddf; color: #3c583e; font-weight: 700; font-size: 12px; }
.user-chip-text { min-width: 0; flex: 1; }
.user-chip-text strong, .user-chip-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text strong { font-size: 12px; }
.user-chip-text span { margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.main-area { min-width: 0; }
.topbar { height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 4.3%; border-bottom: 1px solid var(--line); background: white; }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.online-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 30px; padding: 7px 10px; color: #637267; font-size: 11px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #6ea778; }
.content { max-width: 1390px; margin: 0 auto; padding: 36px 4.3% 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-heading h1 { margin: 6px 0 5px; font: 700 29px Manrope, sans-serif; letter-spacing: -.055em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 9px; }

/* Dashboard */
.welcome-banner { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; min-height: 175px; margin-bottom: 24px; padding: 28px 32px; border-radius: 15px; background: var(--ink); color: white; }
.welcome-banner:after { content: ""; position: absolute; right: 7%; top: -110px; width: 350px; height: 350px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.025), 0 0 0 75px rgba(255,255,255,.025); }
.welcome-copy { position: relative; z-index: 1; }
.welcome-copy .eyebrow { color: #b6c4b8; }
.welcome-copy h2 { margin: 9px 0 7px; font: 700 26px Manrope, sans-serif; letter-spacing: -.05em; }
.welcome-copy p { margin: 0; color: #c4cec5; font-size: 12px; }
.banner-emoji { z-index: 1; margin-right: 8%; font-size: 46px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin: 0 0 24px; }
.stat-card { min-height: 121px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.stat-symbol { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: #f2f5eb; color: #607943; font-size: 15px; }
.stat-value { display: block; margin-top: 11px; font: 700 26px Manrope, sans-serif; letter-spacing: -.05em; }
.stat-caption { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.section-card { border: 1px solid var(--line); border-radius: 12px; background: white; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 20px; border-bottom: 1px solid var(--line); }
.section-header h2 { margin: 0; font: 700 15px Manrope, sans-serif; letter-spacing: -.03em; }
.text-link { border: 0; background: transparent; color: #587643; font-size: 11px; font-weight: 700; }
.shipment-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(135px, 1fr) minmax(105px, .7fr) minmax(110px, .7fr) 30px; align-items: center; gap: 12px; min-height: 69px; padding: 12px 20px; border-bottom: 1px solid #f0f1ed; cursor: pointer; }
.shipment-row:last-child { border-bottom: 0; }
.shipment-row:hover { background: #fbfcf9; }
.shipment-id { display: block; font-size: 12px; font-weight: 700; }
.shipment-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.route-cell { font-size: 11px; color: #526057; }
.route-cell span { color: #9aa39b; padding: 0 3px; }
.status { display: inline-flex; align-items: center; gap: 6px; width: fit-content; border-radius: 30px; padding: 6px 9px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-in-transit { background: #edf2ff; color: #536da5; }
.status-scheduled { background: #fff3dc; color: #a2772b; }
.status-delivered { background: #eaf4e9; color: #4f8257; }
.status-packing { background: #f4eefa; color: #8864a0; }
.status-delayed { background: #fff0ed; color: #bd6451; }
.empty-state { padding: 35px 20px; text-align: center; color: var(--muted); font-size: 12px; }

/* Lists and detail */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.search-box { position: relative; width: min(100%, 300px); }
.search-box input { width: 100%; border: 1px solid #e6e9e3; border-radius: 8px; background: #fbfcfa; padding: 10px 12px 10px 34px; font-size: 11px; }
.search-box:before { content: "⌕"; position: absolute; left: 12px; top: 7px; color: #8d9990; font-size: 17px; }
.filter-select { border: 1px solid #e6e9e3; border-radius: 8px; padding: 9px 10px; background: white; color: #5e6b61; font-size: 11px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 12px 16px; color: #8a948d; background: #fcfcfa; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px 16px; border-top: 1px solid #f0f1ed; color: #56645a; font-size: 11px; white-space: nowrap; }
.data-table tr[data-id] { cursor: pointer; }
.data-table tr[data-id]:hover td { background: #fbfcf9; }
.data-table td:first-child { color: var(--ink); font-weight: 700; }
.table-footer { padding: 13px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.customer-card { display: flex; align-items: center; gap: 10px; }
.item-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.item-pill { display: inline-block; border-radius: 20px; background: #f0f3eb; padding: 5px 8px; color: #536849; font-size: 10px; }
.progress-track { height: 5px; width: 95px; margin-top: 7px; overflow: hidden; border-radius: 9px; background: #edf0ea; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: #7aa060; }
.detail-grid { display: grid; grid-template-columns: 1.35fr .8fr; gap: 17px; }
.detail-card { border: 1px solid var(--line); border-radius: 12px; background: white; padding: 20px; }
.detail-card h2 { margin: 0 0 16px; font: 700 14px Manrope, sans-serif; }
.detail-route { display: grid; grid-template-columns: 1fr 36px 1fr; align-items: center; border-radius: 10px; background: #f7f8f4; padding: 16px; }
.detail-route strong { display: block; margin-top: 5px; font-size: 13px; }
.detail-route .route-arrow { text-align: center; color: #829078; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; margin-top: 20px; }
.detail-fact span { display: block; color: var(--muted); font-size: 10px; }
.detail-fact strong { display: block; margin-top: 5px; font-size: 12px; }
.timeline { display: grid; gap: 0; margin-top: 8px; }
.timeline-step { position: relative; display: flex; gap: 11px; min-height: 54px; }
.timeline-step:not(:last-child):before { content: ""; position: absolute; left: 6px; top: 15px; bottom: -1px; width: 1px; background: #e2e8dd; }
.timeline-dot { z-index: 1; flex: 0 0 13px; height: 13px; margin-top: 1px; border: 3px solid #eaf2e4; border-radius: 50%; background: #7a9c5e; }
.timeline-step.pending .timeline-dot { border-color: #f0f1ed; background: #d7ddd4; }
.timeline-step strong { display: block; font-size: 11px; }
.timeline-step span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }

/* Modal */
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 20px; background: rgba(15, 29, 21, .46); }
.modal { width: min(100%, 590px); max-height: min(92vh, 880px); overflow-y: auto; border-radius: 15px; background: white; box-shadow: var(--shadow); }
.modal.modal-small { width: min(100%, 510px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 21px 23px 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 4px 0 0; font: 700 19px Manrope, sans-serif; letter-spacing: -.04em; }
.modal-body { padding: 20px 23px 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 13px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 7px; }
.line-items { display: grid; gap: 9px; margin-bottom: 12px; }
.item-entry { display: grid; grid-template-columns: minmax(0, 1fr) 90px 36px; gap: 8px; }
.item-entry input { width: 100%; min-width: 0; border: 1px solid #dfe4dc; border-radius: 8px; padding: 10px; font-size: 12px; }
.remove-item { border: 0; border-radius: 8px; background: #f7f1ef; color: #a35b4c; font-size: 17px; }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; transform: translateY(15px); opacity: 0; pointer-events: none; border-radius: 10px; padding: 12px 16px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.mobile-menu { display: none; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 215px minmax(0,1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .shipment-row { grid-template-columns: minmax(130px,1.1fr) minmax(120px,1fr) minmax(90px,.7fr) 30px; }
  .shipment-row .row-date { display: none; }
}
@media (max-width: 720px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 15; inset: 0 auto 0 0; width: min(280px, 82vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .topbar { height: 64px; padding: 0 18px; }
  .mobile-menu { display: inline-grid; place-items: center; width: 35px; height: 35px; margin-right: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
  .breadcrumb-wrap { display: flex; align-items: center; }
  .content { padding: 26px 17px 44px; }
  .online-pill { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-heading h1 { font-size: 25px; }
  .welcome-banner { min-height: 148px; padding: 22px; }
  .welcome-copy h2 { font-size: 21px; }
  .banner-emoji { margin-right: 0; font-size: 34px; }
  .stat-grid { gap: 10px; }
  .stat-card { min-height: 108px; padding: 13px; }
  .stat-value { font-size: 23px; }
  .shipment-row { grid-template-columns: minmax(130px,1fr) minmax(105px,.8fr) 26px; gap: 8px; padding: 12px; }
  .shipment-row .row-date, .shipment-row .row-customer { display: none; }
  .section-header { padding: 16px; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .welcome-banner:after { right: -200px; }
  .banner-emoji { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .top-actions { gap: 4px; }
  .detail-facts { gap: 15px 8px; }
}
