:root {
  --blue: #0082d6;
  --blue-dark: #006db4;
  --ink: #122d3d;
  --navy: #0d2433;
  --cream: #fefbd8;
  --pink: #e94291;
  --yellow: #f3d600;
  --green: #18a673;
  --red: #dc4c5c;
  --orange: #ec8c2f;
  --text: #17232b;
  --muted: #6c7c87;
  --line: #e4e9ec;
  --surface: #ffffff;
  --page: #f4f7f8;
  --shadow: 0 12px 30px rgba(18, 45, 61, .07);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--text); font-family: "Segoe UI", Inter, Arial, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; display: flex; flex-direction: column; color: #d8e3e8; background: var(--navy); border-right: 1px solid rgba(255,255,255,.06); transition: transform .25s ease; }
.brand-wrap { height: 88px; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-card { width: 174px; height: 46px; display: grid; place-items: center; padding: 6px 8px; background: #fff; border-radius: 8px; overflow: hidden; }
.brand-card img { width: 158px; }
.product-name { align-self: flex-end; margin-bottom: 19px; color: #8fa3ae; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.main-nav { padding: 23px 13px; }
.nav-label { padding: 0 12px; margin: 8px 0 7px; color: #68808d; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.nav-label:not(:first-child) { margin-top: 28px; }
.nav-item { position: relative; width: 100%; height: 46px; display: flex; align-items: center; gap: 13px; padding: 0 12px; margin: 3px 0; border: 0; border-radius: 9px; color: #aac0ca; background: transparent; font-weight: 600; text-align: left; transition: .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: linear-gradient(100deg, rgba(0,130,214,.28), rgba(0,130,214,.1)); }
.nav-item.active::before { content: ""; position: absolute; left: -13px; width: 3px; height: 26px; border-radius: 0 3px 3px 0; background: var(--blue); }
.nav-icon { width: 22px; font-size: 21px; line-height: 1; text-align: center; }
.nav-badge { min-width: 22px; margin-left: auto; padding: 2px 6px; border-radius: 99px; background: var(--blue); color: white; font-size: 10px; font-weight: 800; text-align: center; }
.nav-badge.neutral { background: rgba(255,255,255,.12); color: #b8c9d1; }
.nav-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; }
.nav-dot.warning { background: var(--pink); box-shadow: 0 0 0 3px rgba(233,66,145,.13); }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.plant-state { display: flex; gap: 10px; align-items: center; padding: 10px 9px 16px; }
.plant-state span:last-child { display: grid; }
.plant-state strong { color: #d9e6eb; font-size: 12px; }
.plant-state small { margin-top: 3px; color: #6f8792; font-size: 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #33c68b; box-shadow: 0 0 0 4px rgba(51,198,139,.12); }
.user-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px; border: 0; border-radius: 10px; color: #77909b; background: rgba(255,255,255,.045); text-align: left; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--navy); background: var(--cream); font-size: 11px; font-weight: 800; }
.user-meta { flex: 1; display: grid; }
.user-meta strong { color: #e8f0f3; font-size: 12px; }
.user-meta small { margin-top: 2px; color: #78909b; font-size: 10px; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 25; background: rgba(8,20,28,.48); backdrop-filter: blur(2px); }
.main-content { min-height: 100vh; margin-left: 248px; }
.topbar { height: 88px; position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 0 34px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin-top: 3px; font-size: 23px; line-height: 1.2; letter-spacing: -.02em; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search { width: min(320px, 26vw); height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 11px; color: #7d8c94; background: #f4f6f7; border: 1px solid transparent; border-radius: 9px; transition: .2s; }
.global-search:focus-within { background: #fff; border-color: #a7d8f6; box-shadow: 0 0 0 3px rgba(0,130,214,.08); }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
.global-search kbd { padding: 2px 5px; color: #8a99a0; background: white; border: 1px solid #dce2e5; border-radius: 4px; font-size: 9px; box-shadow: 0 1px 0 #dce2e5; }
.icon-button { width: 42px; height: 42px; position: relative; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 18px; }
.menu-toggle { display: none; }
.notification-dot { width: 7px; height: 7px; position: absolute; top: 8px; right: 9px; border: 2px solid white; border-radius: 50%; background: var(--pink); }
.primary-button, .secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border-radius: 8px; font-size: 12px; font-weight: 700; transition: transform .16s, background .16s, box-shadow .16s; }
.primary-button { border: 1px solid var(--blue); color: white; background: var(--blue); box-shadow: 0 6px 15px rgba(0,130,214,.18); }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.secondary-button { border: 1px solid #d7dfe3; color: #425660; background: white; }
.secondary-button:hover { border-color: #b8c5cb; background: #f9fbfb; }
.mobile-search-wrap { display: none; }
.content-area { max-width: 1600px; margin: 0 auto; padding: 28px 34px 44px; }
.view { display: none; animation: fadeIn .25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.notice-bar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 18px; margin-bottom: 28px; color: #552c3e; background: #fff5f9; border: 1px solid #f6d5e5; border-left: 4px solid var(--pink); border-radius: 9px; }
.notice-copy { display: flex; align-items: center; gap: 12px; }
.notice-copy > span:last-child { display: grid; gap: 2px; }
.notice-copy strong { font-size: 13px; }
.notice-copy small { color: #8d6677; font-size: 11px; }
.notice-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--pink); font-weight: 900; }
.text-button { border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 750; white-space: nowrap; }
.text-button:hover { color: var(--blue-dark); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.section-heading h2 { font-size: 19px; letter-spacing: -.01em; }
.section-heading p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.page-section-heading { align-items: center; margin-bottom: 24px; }
.page-section-heading h2 { font-size: 23px; }
.heading-actions { display: flex; gap: 9px; }
.date-filter { display: flex; align-items: center; gap: 6px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.date-filter button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; }
.date-filter button:hover { background: #eef3f5; }
.date-filter span { padding: 0 5px; font-size: 11px; font-weight: 650; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { position: relative; min-height: 136px; padding: 18px 19px 15px; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 12px rgba(18,45,61,.025); }
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.kpi-card.accent-blue { --accent: var(--blue); }
.kpi-card.accent-yellow { --accent: var(--yellow); }
.kpi-card.accent-pink { --accent: var(--pink); }
.kpi-card.accent-black { --accent: var(--ink); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: #60727c; font-size: 11px; font-weight: 650; }
.kpi-symbol { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, white); font-size: 15px; }
.kpi-value { margin: 9px 0 4px; font-size: 30px; font-weight: 750; letter-spacing: -.04em; }
.kpi-value .unit { margin-left: 2px; font-size: 17px; }
.kpi-foot { display: flex; align-items: center; gap: 7px; color: #87949a; font-size: 10px; }
.trend { display: inline-flex; align-items: center; width: fit-content; padding: 2px 6px; border-radius: 5px; font-size: 10px; font-weight: 800; }
.trend.good { color: #0b875c; background: #e8f7f1; }
.trend.danger { color: #c73c4c; background: #fff0f2; }
.trend.neutral { color: #8c7400; background: #fff9d9; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 19px; border-bottom: 1px solid var(--line); }
.panel-header h3 { font-size: 14px; }
.panel-header p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.more-button { border: 0; background: transparent; color: #86959d; font-size: 18px; }
.production-panel { grid-row: span 2; }
.production-row { display: grid; grid-template-columns: 1.5fr .7fr minmax(145px, .85fr) .55fr 30px; align-items: center; gap: 18px; padding: 14px 19px; border-bottom: 1px solid #edf0f2; transition: background .18s; }
.production-row:hover { background: #fafcfc; }
.production-row:last-child { border: 0; }
.job-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.job-swatch { width: 4px; height: 40px; flex: 0 0 auto; border-radius: 4px; background: var(--swatch); }
.job-main > span { min-width: 0; display: grid; gap: 3px; }
.job-main strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.job-main small, .job-data small { color: var(--muted); font-size: 9px; }
.job-data { display: grid; gap: 3px; }
.job-data strong { font-size: 11px; }
.progress-wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: #edf1f3; }
.progress-track i { display: block; width: var(--progress); height: 100%; border-radius: 99px; background: var(--color, var(--blue)); }
.progress-wrap span { color: #566871; font-size: 10px; font-weight: 700; }
.status-tag { width: fit-content; padding: 4px 7px; border-radius: 5px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.status-tag.danger { color: #c73c4c; background: #fff0f2; }
.status-tag.warning { color: #9a6d00; background: #fff8d6; }
.status-tag.info { color: #006cae; background: #eaf6fd; }
.status-tag.success { color: #087956; background: #e9f8f2; }
.status-tag.muted { color: #6f7c82; background: #f0f3f4; }
.row-menu { border: 0; color: #93a0a6; background: transparent; }
.deadline-list { padding: 2px 18px 9px; }
.deadline-item { position: relative; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #edf0f2; }
.deadline-item:last-child { border: 0; }
.date-tile { width: 38px; height: 40px; display: grid; place-items: center; align-content: center; color: #52656e; background: #f2f5f6; border-radius: 7px; line-height: 1; }
.date-tile strong { font-size: 14px; }
.date-tile small { margin-top: 3px; font-size: 7px; font-weight: 800; letter-spacing: .06em; }
.deadline-item.urgent .date-tile { color: #ba3151; background: #fff0f5; }
.deadline-item > div:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.deadline-item > div:nth-child(2) strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.deadline-item > div:nth-child(2) span { color: var(--muted); font-size: 9px; }
.capacity-panel { padding-bottom: 13px; }
.capacity-average { padding: 4px 7px; border-radius: 6px; color: #4d626c; background: #eef3f5; font-size: 9px; font-weight: 800; }
.capacity-bars { display: grid; gap: 13px; padding: 15px 19px 4px; }
.capacity-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: 6px; color: #51636c; font-size: 10px; }
.capacity-row strong { color: #283b44; }
.bar { height: 6px; overflow: hidden; border-radius: 99px; background: #edf1f2; }
.bar i { display: block; width: var(--value); height: 100%; border-radius: 99px; background: var(--bar); }

/* Production */
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.segmented button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 6px; color: #6a7b84; background: transparent; font-size: 11px; font-weight: 650; }
.segmented button span { margin-left: 5px; color: #91a0a7; }
.segmented button.active { color: white; background: var(--navy); }
.segmented button.active span { color: #afc2cb; }
.select-wrap { display: flex; align-items: center; gap: 7px; color: #7a8990; font-size: 10px; }
select { min-height: 38px; padding: 0 31px 0 10px; border: 1px solid #dce3e6; border-radius: 8px; outline: 0; color: #3e515a; background: white; font-size: 11px; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 13px; align-items: start; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { min-width: 230px; padding: 10px; background: #edf2f4; border-radius: 12px; }
.kanban-column > header { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px 7px; }
.kanban-column > header > div { display: flex; align-items: center; gap: 7px; }
.kanban-column h3 { font-size: 11px; }
.kanban-column header button { width: 25px; height: 25px; border: 0; border-radius: 6px; color: #809097; background: transparent; }
.kanban-column header button:hover { background: white; }
.stage-dot { width: 7px; height: 7px; border-radius: 50%; }
.stage-dot.blue { background: var(--blue); }.stage-dot.pink { background: var(--pink); }.stage-dot.yellow { background: var(--yellow); }.stage-dot.green { background: var(--green); }
.count-pill { min-width: 19px; padding: 2px 5px; border-radius: 9px; color: #6f8088; background: white; font-size: 8px; font-weight: 800; text-align: center; }
.kanban-cards { display: grid; gap: 9px; }
.kanban-card { padding: 13px; border: 1px solid #e1e7e9; border-radius: 9px; background: white; box-shadow: 0 3px 8px rgba(16,39,52,.04); transition: transform .18s, box-shadow .18s; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(16,39,52,.09); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-id { color: #74858e; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.job-type { padding: 3px 6px; border-radius: 4px; color: #4f646e; background: #eef3f5; font-size: 8px; font-weight: 800; }
.kanban-card h4 { margin: 11px 0 4px; font-size: 12px; }
.kanban-card .description { min-height: 30px; color: #71828a; font-size: 9px; line-height: 1.45; }
.card-progress { margin: 12px 0; }
.card-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 5px; color: #6b7b83; font-size: 8px; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid #edf0f1; }
.due-date { color: #60727a; font-size: 9px; font-weight: 700; }
.due-date.urgent { color: #c3394b; }
.operator { width: 27px; height: 27px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; color: var(--navy); background: var(--operator, #d9e6eb); font-size: 8px; font-weight: 800; box-shadow: 0 0 0 1px #dfe5e7; }
.kanban.compact .kanban-card { padding: 9px 11px; }
.kanban.compact .kanban-card .description, .kanban.compact .card-progress { display: none; }
.kanban.compact .kanban-card h4 { margin: 8px 0; }

/* Warehouse */
.warehouse-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.warehouse-summary > div { display: flex; align-items: center; gap: 12px; padding: 17px 20px; border-right: 1px solid var(--line); }
.warehouse-summary > div:last-child { border-right: 0; }
.warehouse-summary > div > span:last-child { display: grid; gap: 3px; }
.warehouse-summary small { color: var(--muted); font-size: 9px; }
.warehouse-summary strong { font-size: 17px; }
.summary-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; font-size: 15px; font-weight: 800; }
.summary-icon.blue { color: var(--blue); background: #e9f5fd; }.summary-icon.pink { color: var(--pink); background: #fff0f7; }.summary-icon.yellow { color: #927d00; background: #fff9d8; }.summary-icon.dark { color: var(--ink); background: #edf2f4; }
.stock-panel { box-shadow: none; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.table-search { min-width: 250px; height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #dce3e6; border-radius: 8px; color: #7c8c93; }
.table-search:focus-within { border-color: #88c8f0; box-shadow: 0 0 0 3px rgba(0,130,214,.08); }
.table-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.table-search.small { min-width: 190px; max-width: 220px; }
.toolbar-filters { display: flex; gap: 8px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 810px; }
.data-table th { height: 40px; padding: 0 15px; color: #809098; background: #fafbfb; border-bottom: 1px solid var(--line); font-size: 8px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { height: 61px; padding: 8px 15px; border-bottom: 1px solid #edf0f2; color: #50636c; font-size: 10px; }
.data-table tbody tr:hover { background: #fbfcfd; }
.material-cell { display: flex; align-items: center; gap: 10px; }
.material-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: var(--icon-color); background: var(--icon-bg); font-size: 14px; font-weight: 800; }
.material-cell > span:last-child { display: grid; gap: 3px; }
.material-cell strong { color: #263a43; font-size: 11px; }
.material-cell small { color: #92a0a6; font-size: 8px; }
.stock-level { width: 120px; }
.stock-level > div { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 8px; }
.stock-level strong { color: var(--level-color); }
.stock-level .bar { height: 5px; }
.numeric { color: #2b4049; font-weight: 750; }
.numeric small { margin-left: 2px; color: #8b989e; font-weight: 400; }
.table-footer { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 10px 17px; color: #7c8c93; font-size: 9px; }
.pagination { display: flex; gap: 3px; }
.pagination button { min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid #e0e6e8; border-radius: 6px; color: #65767e; background: white; font-size: 9px; }
.pagination button.active { border-color: var(--blue); color: white; background: var(--blue); }
.pagination button:disabled { opacity: .45; }

/* Orders */
.orders-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(285px, .55fr); gap: 18px; }
.orders-main { box-shadow: none; }
.orders-header { padding: 12px 15px; }
.segmented.compact { border: 0; padding: 0; }
.segmented.compact button { min-height: 31px; }
.order-list { padding: 0 17px 8px; }
.order-row { display: grid; grid-template-columns: 42px minmax(160px, 1.15fr) minmax(120px, .8fr) .55fr .55fr auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #edf0f2; }
.order-row:last-child { border: 0; }
.order-color { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--color); background: var(--bg); font-size: 11px; font-weight: 850; }
.order-main-cell, .order-cell { display: grid; gap: 3px; min-width: 0; }
.order-main-cell strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.order-main-cell small, .order-cell small { color: #8a989e; font-size: 8px; }
.order-cell strong { color: #42565f; font-size: 10px; }
.order-amount { font-size: 11px; font-weight: 800; }
.client-insights { align-self: start; }
.sales-figure { display: grid; gap: 5px; padding: 18px 19px 8px; }
.sales-figure small { color: var(--muted); font-size: 9px; }
.sales-figure strong { font-size: 24px; letter-spacing: -.03em; }
.mini-chart { height: 115px; display: flex; align-items: end; gap: 11px; padding: 8px 23px 24px; }
.mini-chart > span { position: relative; width: 25%; height: var(--h); border-radius: 5px 5px 2px 2px; background: #dbe8ed; }
.mini-chart > span.highlight { background: var(--blue); }
.mini-chart i { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); color: #8b999f; font-size: 8px; font-style: normal; }
.insight-divider { height: 1px; margin: 0 19px; background: var(--line); }
.client-insights h4 { margin: 15px 19px 7px; font-size: 10px; }
.client-ranking { padding: 0 19px 12px; }
.client-ranking > div { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 9px; padding: 9px 0; }
.client-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 8px; font-weight: 800; }
.client-avatar.blue { color: #0069aa; background: #e5f4fd; }.client-avatar.pink { color: #bd2f72; background: #fdebf4; }.client-avatar.yellow { color: #807000; background: #fff8cf; }
.client-ranking span:nth-child(2) { display: grid; gap: 2px; }
.client-ranking strong { font-size: 9px; }.client-ranking small { color: #8b999f; font-size: 8px; }.client-ranking b { font-size: 9px; }

/* Reports */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.report-card { min-height: 250px; }
.report-card.wide { grid-column: span 2; }
.report-total { font-size: 23px; }
.line-chart { height: 170px; position: relative; margin: 18px 25px 8px; overflow: hidden; }
.grid-lines { position: absolute; inset: 0 0 24px; background: repeating-linear-gradient(to bottom, #edf1f2 0, #edf1f2 1px, transparent 1px, transparent 34px); }
.line-fill { position: absolute; inset: 20px 0 24px; opacity: .16; background: linear-gradient(to bottom, var(--blue), transparent); clip-path: polygon(0 83%, 20% 61%, 40% 70%, 60% 39%, 80% 50%, 100% 12%, 100% 100%, 0 100%); }
.line-stroke { position: absolute; inset: 20px 0 24px; background: var(--blue); clip-path: polygon(0 calc(83% - 1px), 20% calc(61% - 1px), 40% calc(70% - 1px), 60% calc(39% - 1px), 80% calc(50% - 1px), 100% calc(12% - 1px), 100% calc(12% + 1px), 80% calc(50% + 1px), 60% calc(39% + 1px), 40% calc(70% + 1px), 20% calc(61% + 1px), 0 calc(83% + 1px)); }
.point { width: 8px; height: 8px; position: absolute; border: 2px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); transform: translate(-50%, 50%); }.p1{left:0;bottom:46px}.p2{left:20%;bottom:72px}.p3{left:40%;bottom:61px}.p4{left:60%;bottom:96px}.p5{left:80%;bottom:83px}.p6{left:100%;bottom:126px}
.axis-labels { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; color: #8c9aa0; font-size: 8px; }
.donut-wrap { height: 178px; display: flex; align-items: center; justify-content: center; gap: 24px; padding: 10px 20px; }
.donut { width: 122px; height: 122px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--blue) 0 62%, var(--yellow) 62% 90%, var(--pink) 90% 100%); }
.donut::before { content: ""; width: 75px; height: 75px; grid-area: 1/1; border-radius: 50%; background: white; }
.donut span { z-index: 1; grid-area: 1/1; display: grid; text-align: center; font-size: 20px; font-weight: 800; }.donut small { margin-top: 2px; color: var(--muted); font-size: 7px; letter-spacing: .1em; }
.legend { display: grid; gap: 12px; flex: 1; }.legend span { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; color: #62747d; font-size: 9px; }.legend i { width: 7px; height: 7px; border-radius: 2px; }.legend i.blue{background:var(--blue)}.legend i.yellow{background:var(--yellow)}.legend i.pink{background:var(--pink)}.legend b{color:#283c45}
.big-metric { padding: 22px 20px 7px; font-size: 38px; font-weight: 800; letter-spacing: -.04em; }.big-metric span { margin-left: 4px; color: var(--muted); font-size: 14px; }
.target-row { display: flex; justify-content: space-between; padding: 9px 20px; color: var(--muted); font-size: 9px; }.target-row strong { color: #344a54; }
.report-card > .bar.large { height: 8px; margin: 4px 20px; }
.metric-note { padding: 10px 20px; color: #4c7a68; font-size: 9px; }
.spark-bars { height: 62px; display: flex; align-items: end; gap: 8px; padding: 3px 20px 0; }.spark-bars i { width: 16.6%; height: var(--h); border-radius: 4px 4px 0 0; background: #cbd9df; }.spark-bars i.active { background: var(--green); }

/* Modals */
.modal-backdrop { visibility: hidden; position: fixed; inset: 0; z-index: 60; opacity: 0; background: rgba(9,25,35,.58); backdrop-filter: blur(3px); transition: .2s; }
.modal-backdrop.open { visibility: visible; opacity: 1; }
.modal { visibility: hidden; width: min(580px, calc(100vw - 28px)); max-height: calc(100vh - 34px); position: fixed; inset: 50% auto auto 50%; z-index: 70; overflow: auto; opacity: 0; transform: translate(-50%, -47%) scale(.98); background: white; border-radius: 15px; box-shadow: 0 28px 80px rgba(5,18,26,.3); transition: .2s; }
.modal.open { visibility: visible; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.small-modal { width: min(470px, calc(100vw - 28px)); }
.modal > header { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.modal h2 { margin-top: 3px; font-size: 20px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 8px; color: #697a82; background: #f1f4f5; font-size: 21px; }
.modal form { padding: 21px 24px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid.one-column { grid-template-columns: 1fr; }
.form-grid label { display: grid; gap: 6px; color: #50636c; font-size: 10px; font-weight: 700; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d9e1e4; border-radius: 8px; outline: 0; background: white; font-size: 11px; resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: #7bc3ef; box-shadow: 0 0 0 3px rgba(0,130,214,.08); }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-check { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: #5f717a; font-size: 10px; }
.form-check input { accent-color: var(--blue); }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 21px; }
.toast { min-width: 310px; max-width: calc(100vw - 30px); position: fixed; right: 24px; bottom: 24px; z-index: 90; display: flex; align-items: center; gap: 11px; padding: 13px 15px; opacity: 0; transform: translateY(20px); pointer-events: none; color: white; background: var(--navy); border-radius: 10px; box-shadow: 0 15px 35px rgba(5,20,29,.25); transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.toast-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--navy); background: #68d5ac; font-weight: 900; }
.toast > div { display: grid; gap: 2px; }.toast strong { font-size: 11px; }.toast small { color: #a9bec7; font-size: 9px; }
.empty-state { padding: 45px 20px; color: var(--muted); text-align: center; }.empty-state strong { display: block; margin-bottom: 5px; color: #3d515a; }

@media (max-width: 1180px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; }
  .brand-card { width: 160px; }
  .product-name { display: none; }
  .content-area, .topbar { padding-left: 24px; padding-right: 24px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .orders-layout { grid-template-columns: 1fr; }
  .client-insights { display: grid; grid-template-columns: .8fr 1fr; }
  .client-insights .panel-header { grid-column: 1/-1; }
  .client-insights .insight-divider { display: none; }
  .client-insights h4, .client-ranking { grid-column: 2; }
  .client-insights h4 { grid-row: 2; align-self: start; }
  .client-ranking { grid-row: 2 / span 2; margin-top: 26px; }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { width: 260px; transform: translateX(-100%); box-shadow: 18px 0 40px rgba(7,20,28,.2); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { height: 76px; padding: 0 18px; }
  .topbar h1 { font-size: 20px; }
  .global-search { display: none; }
  .mobile-search-wrap { display: block; padding: 12px 18px 0; background: var(--page); }
  .mobile-search { width: 100%; display: flex; background: white; border-color: var(--line); }
  .content-area { padding: 19px 18px 35px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .production-panel { grid-row: auto; }
  .production-row { grid-template-columns: 1.35fr .75fr minmax(120px,.8fr) .55fr 25px; gap: 11px; }
  .kanban { grid-template-columns: repeat(4, 265px); }
  .warehouse-summary { grid-template-columns: repeat(2, 1fr); }
  .warehouse-summary > div:nth-child(2) { border-right: 0; }
  .warehouse-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .topbar-actions .notification-button { display: none; }
  .primary-button { padding: 0 13px; }
  .topbar .primary-button { width: 42px; padding: 0; font-size: 0; }
  .topbar .primary-button span { font-size: 18px; }
  .notice-bar { align-items: flex-start; }
  .notice-copy small { display: none; }
  .section-heading { align-items: flex-start; }
  .page-section-heading { align-items: stretch; flex-direction: column; }
  .page-section-heading .primary-button, .page-section-heading .secondary-button { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { min-height: 125px; padding: 15px; }
  .kpi-value { font-size: 26px; }
  .kpi-foot > span:last-child { display: none; }
  .production-row { grid-template-columns: 1fr auto; }
  .production-row .job-data, .production-row .progress-wrap { display: none; }
  .filter-row { align-items: flex-start; flex-direction: column; }
  .segmented { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .segmented button { flex: 1; white-space: nowrap; }
  .select-wrap { align-self: flex-end; }
  .warehouse-summary > div { padding: 14px; }
  .warehouse-summary strong { font-size: 15px; }
  .summary-icon { width: 30px; height: 30px; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .table-search { width: 100%; min-width: 0; }
  .toolbar-filters { overflow-x: auto; }
  .toolbar-filters select { flex: 1; min-width: 150px; }
  .table-footer { justify-content: center; }
  .table-footer > span { display: none; }
  .orders-header { align-items: stretch; flex-direction: column; }
  .table-search.small { max-width: none; }
  .order-row { grid-template-columns: 38px 1fr auto; }
  .order-row .order-cell:nth-of-type(2), .order-row .order-cell:nth-of-type(3) { display: none; }
  .order-amount { display: none; }
  .client-insights { display: block; }
  .client-insights h4 { margin-top: 13px; }
  .client-ranking { margin-top: 0; }
  .report-grid { grid-template-columns: 1fr; }
  .report-card.wide { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}

@media (max-width: 430px) {
  .content-area { padding-left: 12px; padding-right: 12px; }
  .mobile-search-wrap { padding-left: 12px; padding-right: 12px; }
  .topbar { padding: 0 12px; }
  .topbar h1 { font-size: 18px; }
  .topbar .eyebrow { font-size: 8px; }
  .notice-bar { padding: 10px 12px; }
  .notice-bar .text-button { font-size: 0; }
  .notice-bar .text-button span { font-size: 16px; }
  .section-heading:not(.page-section-heading) { align-items: flex-start; flex-direction: column; }
  .date-filter { align-self: stretch; justify-content: space-between; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 116px; }
  .warehouse-summary { grid-template-columns: 1fr; }
  .warehouse-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .warehouse-summary > div:last-child { border-bottom: 0; }
  .two-fields { grid-template-columns: 1fr; }
  .modal > header, .modal form { padding-left: 17px; padding-right: 17px; }
  .toast { right: 12px; bottom: 12px; min-width: 0; width: calc(100vw - 24px); }
}

@media print {
  .sidebar, .topbar, .mobile-search-wrap, .notice-bar, .heading-actions, .page-section-heading button { display: none !important; }
  .main-content { margin: 0; }
  .content-area { padding: 0; }
  .view { display: none !important; }
  #view-reportes { display: block !important; }
  .panel { break-inside: avoid; box-shadow: none; }
}
