:root {
  --bg: #f5f2ea;
  --surface: #fffdf8;
  --surface-soft: #f8f6f0;
  --ink: #21332b;
  --muted: #7b837d;
  --line: #e8e4da;
  --green: #315f48;
  --green-light: #dfece3;
  --gold: #bd9150;
  --gold-light: #f5ead7;
  --orange: #d37642;
  --orange-light: #fae8dc;
  --rose: #b86666;
  --rose-light: #f5e2e0;
  --shadow: 0 14px 36px rgba(54, 63, 57, .07);
  --radius: 20px;
}

* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font-family: "DM Sans", sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; padding: 28px 18px 20px; background: #203c30; color: #eef5f0; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: #f2e8d4; color: var(--green); display: grid; place-items: center; font-family: "Playfair Display"; font-weight: 700; }
.brand strong, .brand span, .profile strong, .profile span { display: block; }
.brand strong { font-family: "Playfair Display"; font-size: 17px; letter-spacing: .1px; }
.brand span, .profile span { color: #aebfb6; font-size: 11px; margin-top: 3px; }
.nav-list { display: grid; gap: 6px; }
.nav-item { border: 0; color: #b9c8c0; background: transparent; border-radius: 11px; min-height: 46px; padding: 0 12px; display: flex; align-items: center; gap: 12px; font-weight: 600; text-align: left; transition: .2s ease; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.1); color: #fff; }
.nav-icon { width: 20px; color: #d2ded7; font-size: 18px; text-align: center; }
.nav-pill { margin-left: auto; padding: 2px 7px; border-radius: 10px; background: #d49d58; color: #fff; font-size: 10px; }
.sidebar-card { margin-top: auto; padding: 17px; border: 1px solid rgba(255,255,255,.1); border-radius: 15px; background: rgba(255,255,255,.05); }
.mini-label { color: #d9b87e; font-size: 9px; text-transform: uppercase; letter-spacing: 1.3px; font-weight: 700; }
.sidebar-card strong { display: block; margin: 8px 0 5px; font-size: 13px; }
.sidebar-card p { color: #aebfb6; font-size: 11px; line-height: 1.5; margin: 0 0 7px; }
.text-button { background: none; color: #e2c696; border: 0; padding: 4px 0; font-size: 11px; font-weight: 700; }
.profile { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; padding: 20px 5px 0; margin-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.profile strong { font-size: 11px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #d9b87e; color: #254134; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-weight: 700; }

.main-content { width: calc(100% - 248px); margin-left: 248px; padding: 0 30px 36px; }
.topbar { height: 92px; display: flex; align-items: center; gap: 22px; }
.topbar-title { min-width: 0; margin-right: auto; }
.eyebrow, .section-kicker { display: block; color: var(--gold); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.25px; }
.topbar h1 { margin: 4px 0 0; font-family: "Playfair Display"; font-size: 24px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search, .table-search { height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; color: var(--muted); }
.global-search input, .table-search input { width: 160px; border: 0; outline: 0; background: transparent; color: var(--ink); }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; background: var(--surface-soft); color: #a4aaa5; font-size: 8px; }
.notification-button { position: relative; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; color: var(--ink); }
.notification-button span { position: absolute; width: 7px; height: 7px; right: 8px; top: 7px; background: var(--orange); border-radius: 50%; border: 1px solid white; }
.primary-button, .secondary-button { border: 0; border-radius: 10px; padding: 11px 15px; font-weight: 700; font-size: 12px; transition: .2s ease; }
.primary-button { background: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(49,95,72,.16); }
.primary-button:hover { background: #244b38; transform: translateY(-1px); }
.secondary-button { background: var(--surface-soft); border: 1px solid var(--line); color: var(--ink); }
.secondary-button:hover { background: #eeeae1; }
.menu-button { display: none; }

.view { display: none; animation: enter .35s ease; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.welcome-banner { min-height: 158px; border-radius: var(--radius); padding: 27px 31px; background: linear-gradient(112deg, #294e3c, #3d7157); color: white; display: flex; justify-content: space-between; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.welcome-banner > div:first-child { min-width: 0; }
.welcome-banner:before { content: ""; position: absolute; width: 370px; height: 370px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -130px; top: -180px; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.02); }
.banner-tag { display: inline-block; padding: 4px 8px; border-radius: 12px; background: rgba(255,255,255,.1); color: #e3cb9e; font-size: 9px; text-transform: uppercase; letter-spacing: 1.2px; }
.welcome-banner h2 { margin: 10px 0 6px; font-family: "Playfair Display"; font-size: 29px; }
.welcome-banner p { max-width: 520px; margin: 0; color: #c7d6cf; font-size: 12px; }
.banner-visual { width: 210px; position: relative; align-self: stretch; }
.cup { position: absolute; width: 96px; height: 66px; right: 54px; top: 34px; background: #f4ead7; border-radius: 8px 8px 38px 38px; box-shadow: inset -10px -8px 0 rgba(189,145,80,.13); z-index: 2; }
.cup:after { content: ""; position: absolute; width: 31px; height: 30px; border: 9px solid #f4ead7; border-left: 0; right: -31px; top: 10px; border-radius: 0 22px 22px 0; }
.coffee { position: absolute; width: 82px; height: 12px; background: #5f3926; left: 7px; top: -3px; border-radius: 50%; }
.steam { position: absolute; width: 8px; height: 28px; border-left: 2px solid rgba(255,255,255,.45); border-radius: 50%; top: -36px; }
.steam-one { left: 34px; transform: rotate(10deg); }
.steam-two { left: 61px; top: -30px; transform: rotate(-8deg); }
.saucer { position: absolute; width: 148px; height: 20px; border-radius: 50%; background: #eadcc3; right: 22px; top: 94px; }
.bean { position: absolute; width: 13px; height: 20px; border-radius: 50%; background: #b58652; transform: rotate(40deg); }
.bean:after { content: ""; position: absolute; height: 17px; border-left: 1px solid #795a39; left: 6px; top: 1px; transform: rotate(10deg); }
.bean-one { right: 8px; bottom: 15px; }.bean-two { right: 187px; top: 86px; transform: rotate(-32deg); }.bean-three { right: 23px; top: 4px; transform: rotate(71deg); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 15px; }
.metric-card { min-width: 0; min-height: 116px; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; gap: 12px; box-shadow: 0 8px 22px rgba(54,63,57,.035); }
.metric-icon, .quick-icon { flex: 0 0 auto; width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; }
.green { background: var(--green-light); color: var(--green); }.gold { background: var(--gold-light); color: var(--gold); }.orange { background: var(--orange-light); color: var(--orange); }.rose { background: var(--rose-light); color: var(--rose); }
.metric-copy span, .metric-copy strong, .metric-copy small { display: block; }
.metric-copy span { color: var(--muted); font-size: 10px; }
.metric-copy strong { margin: 5px 0 3px; font-family: "Playfair Display"; font-size: 23px; }
.metric-copy small { color: #9a9f9b; font-size: 9px; white-space: nowrap; }
.positive { color: #4c8a65 !important; }
.sparkbars { position: absolute; right: 15px; bottom: 18px; height: 30px; display: flex; align-items: end; gap: 3px; }
.sparkbars i { display: block; width: 4px; height: 30%; border-radius: 3px; background: #82a18f; }.sparkbars i:nth-child(2) { height: 55%; }.sparkbars i:nth-child(3) { height: 45%; }.sparkbars i:nth-child(4) { height: 75%; }.sparkbars i:nth-child(5) { height: 95%; }
.sparkline { width: 62px; margin-left: auto; align-self: end; }
.sparkline svg { width: 100%; overflow: visible; }
.sparkline path { fill: none; stroke: var(--gold); stroke-width: 2; }
.card-link { position: absolute; right: 14px; bottom: 16px; background: none; border: 0; color: var(--orange); font-size: 9px; font-weight: 700; }
.donut { width: 38px; height: 38px; margin: auto 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--rose) 0 70%, var(--rose-light) 70%); position: relative; }
.donut:after { content: ""; position: absolute; width: 27px; height: 27px; border-radius: 50%; background: var(--surface); }.donut span { position: relative; z-index: 1; font-size: 8px; font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 15px; margin-top: 15px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { padding: 20px 20px 12px; display: flex; justify-content: space-between; align-items: start; }
.panel-heading h3 { margin: 4px 0 0; font-family: "Playfair Display"; font-size: 17px; }
.stock-list, .movement-list { padding: 0 13px 14px; }
.stock-row, .movement-row { display: grid; align-items: center; border-radius: 11px; transition: .2s; }
.stock-row { grid-template-columns: 36px 1fr 120px 54px; gap: 10px; padding: 9px; }
.stock-row:hover, .movement-row:hover { background: var(--surface-soft); }
.product-symbol { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-soft); display: grid; place-items: center; font-size: 17px; }
.stock-info strong, .stock-info span, .movement-info strong, .movement-info span { display: block; }
.stock-info strong, .movement-info strong { font-size: 11px; }
.stock-info span, .movement-info span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.stock-level { height: 5px; border-radius: 4px; background: var(--orange-light); overflow: hidden; }
.stock-level i { display: block; height: 100%; background: var(--orange); border-radius: inherit; }
.stock-quantity { color: var(--orange); font-size: 10px; font-weight: 700; text-align: right; }
.category-panel { min-height: 273px; }
.category-chart { display: grid; grid-template-columns: 135px 1fr; align-items: center; gap: 14px; padding: 12px 20px 22px; }
.category-donut { width: 126px; height: 126px; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--green) 0 35%, var(--gold) 35% 58%, var(--orange) 58% 80%, var(--rose) 80%); }
.category-donut:after { content: ""; width: 82px; height: 82px; border-radius: 50%; background: var(--surface); position: absolute; }
.category-donut div { position: relative; z-index: 1; text-align: center; }.category-donut strong, .category-donut span { display: block; }.category-donut strong { font-family: "Playfair Display"; font-size: 21px; }.category-donut span { color: var(--muted); font-size: 8px; }
.category-legend { display: grid; gap: 10px; }
.legend-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 7px; align-items: center; font-size: 9px; color: var(--muted); }
.legend-row i { width: 7px; height: 7px; border-radius: 50%; }.legend-row strong { color: var(--ink); font-size: 10px; }
.movement-row { grid-template-columns: 34px 1fr auto; gap: 9px; padding: 9px; }
.movement-symbol { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.movement-amount { text-align: right; font-size: 10px; font-weight: 700; }.movement-amount span { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 400; }
.quick-actions { padding: 4px 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-actions button { border: 1px solid var(--line); background: var(--surface-soft); border-radius: 12px; padding: 10px; text-align: left; display: grid; grid-template-columns: 30px 1fr; gap: 1px 8px; transition: .2s; }
.quick-actions button:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 8px 16px rgba(54,63,57,.07); }
.quick-icon { width: 28px; height: 28px; grid-row: 1 / 3; border-radius: 8px; }
.quick-actions strong { font-size: 10px; }.quick-actions small { color: var(--muted); font-size: 8px; }

.view-heading { margin: 14px 0 20px; display: flex; justify-content: space-between; align-items: end; }
.view-heading h2 { margin: 5px 0; font-family: "Playfair Display"; font-size: 30px; }.view-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.inventory-panel { overflow: hidden; }
.inventory-toolbar { padding: 15px; display: flex; gap: 12px; border-bottom: 1px solid var(--line); }
.table-search { width: 245px; }.table-search input { width: 100%; }
.filter-group { display: flex; gap: 6px; }
.filter-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 700; }
.filter-chip.active { background: var(--green); color: white; border-color: var(--green); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { padding: 12px 18px; background: var(--surface-soft); color: var(--muted); text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .8px; }
td { padding: 13px 18px; border-top: 1px solid var(--line); font-size: 11px; }
.table-product { display: flex; align-items: center; gap: 10px; }.table-product strong, .table-product span { display: block; }.table-product span { color: var(--muted); font-size: 9px; margin-top: 2px; }
.category-tag, .status-tag { display: inline-flex; padding: 4px 8px; border-radius: 12px; font-size: 9px; font-weight: 700; }
.category-tag { background: var(--surface-soft); color: var(--muted); }.status-ok { background: var(--green-light); color: var(--green); }.status-low { background: var(--orange-light); color: var(--orange); }.status-out { background: var(--rose-light); color: var(--rose); }
.row-action { border: 0; background: transparent; color: var(--muted); font-size: 16px; }
.empty-state { display: none; padding: 50px; text-align: center; color: var(--muted); }.empty-state strong, .empty-state span { display: block; }.empty-state strong { color: var(--ink); margin-bottom: 5px; }
.full-movements { padding: 12px; }.full-movements .movement-row { grid-template-columns: 40px 1fr 140px auto; padding: 13px; border-bottom: 1px solid var(--line); }.full-movements .movement-symbol { width: 38px; height: 38px; }.movement-date { color: var(--muted); font-size: 10px; }
.supplier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }.supplier-card { padding: 20px; }.supplier-top { display: flex; justify-content: space-between; align-items: start; }.supplier-logo { width: 46px; height: 46px; border-radius: 13px; background: var(--green-light); color: var(--green); display: grid; place-items: center; font-family: "Playfair Display"; font-weight: 700; }.supplier-card h3 { margin: 14px 0 4px; font-family: "Playfair Display"; }.supplier-card p { margin: 0 0 16px; color: var(--muted); font-size: 10px; }.supplier-meta { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 13px; color: var(--muted); font-size: 9px; }.supplier-meta strong { display: block; color: var(--ink); font-size: 11px; margin-top: 3px; }
.report-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: 15px; }.report-chart { padding-bottom: 15px; }.bar-chart { height: 290px; padding: 20px 28px 5px; display: flex; align-items: end; justify-content: space-around; gap: 10px; border-top: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 57px, var(--line) 58px); }.bar-chart div { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; }.bar-chart i { width: min(35px, 80%); background: linear-gradient(to top, var(--green), #77a087); border-radius: 8px 8px 3px 3px; }.bar-chart span { color: var(--muted); font-size: 9px; }.report-summary { padding: 24px; background: var(--green); color: white; }.report-summary h3 { margin: 8px 0; font-family: "Playfair Display"; font-size: 23px; }.report-summary p { color: #bfd1c7; font-size: 11px; line-height: 1.6; }.report-stat { padding: 14px 0; display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.13); color: #bfd1c7; font-size: 10px; }.report-stat strong { color: white; font-size: 12px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(24,39,32,.58); backdrop-filter: blur(4px); display: none; place-items: center; padding: 20px; z-index: 100; }
.modal-backdrop.open { display: grid; }
.modal { width: min(470px, 100%); max-height: 94vh; overflow-y: auto; position: relative; background: var(--surface); border-radius: 20px; padding: 28px; box-shadow: 0 22px 60px rgba(20,38,29,.22); animation: modalIn .25s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; right: 18px; top: 16px; border: 0; background: var(--surface-soft); color: var(--muted); width: 30px; height: 30px; border-radius: 50%; font-size: 18px; }
.modal h2 { margin: 6px 0 4px; font-family: "Playfair Display"; font-size: 25px; }.modal p { margin: 0 0 19px; color: var(--muted); font-size: 11px; }
form { display: grid; gap: 13px; }form label { display: grid; gap: 6px; color: var(--ink); font-size: 10px; font-weight: 700; }form input, form select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 11px 12px; color: var(--ink); outline: 0; }form input:focus, form select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.modal-actions { display: flex; justify-content: end; gap: 8px; margin-top: 6px; }
.toast { position: fixed; right: 24px; bottom: 24px; min-width: 265px; padding: 13px; display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 15px 38px rgba(29,48,38,.18); transform: translateY(100px); opacity: 0; transition: .3s ease; z-index: 110; }.toast.show { transform: none; opacity: 1; }.toast > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--green-light); color: var(--green); font-weight: 700; }.toast strong, .toast small { display: block; }.toast strong { font-size: 11px; }.toast small { color: var(--muted); margin-top: 2px; font-size: 9px; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }.dashboard-grid { grid-template-columns: 1fr; }.category-chart { grid-template-columns: 150px 1fr; }.supplier-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 850px) {
  .sidebar { transform: translateX(-100%); transition: .25s ease; box-shadow: 15px 0 40px rgba(20,38,29,.2); }.sidebar.open { transform: none; }.main-content { width: 100%; margin-left: 0; padding: 0 15px 25px; }.menu-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }.topbar { height: 78px; }.global-search { display: none; }.topbar-title h1 { font-size: 18px; }.welcome-banner { min-height: 170px; }.banner-visual { display: none; }.report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar { gap: 10px; }.topbar .primary-button { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; font-size: 0; }.topbar .primary-button span { font-size: 18px; }.notification-button { display: none; }.metric-grid { grid-template-columns: minmax(0, 1fr); }.welcome-banner { padding: 24px; }.welcome-banner h2 { max-width: 100%; font-size: 25px; }.inventory-toolbar { display: grid; }.table-search { width: 100%; }.filter-group { overflow-x: auto; padding-bottom: 3px; }.filter-chip { white-space: nowrap; }.supplier-grid { grid-template-columns: 1fr; }.quick-actions { grid-template-columns: 1fr; }.view-heading { align-items: start; }.desktop-add { display: none; }.form-row { grid-template-columns: 1fr; }.full-movements .movement-row { grid-template-columns: 38px 1fr auto; }.movement-date { display: none; }
}
