@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 {
  color-scheme: dark;
  --page: #071322;
  --surface: #0c1a2a;
  --surface-raised: #102135;
  --surface-hover: #162a40;
  --line: #1c3045;
  --text: #eef4fa;
  --muted: #8fa3b8;
  --subtle: #637a91;
  --accent: #56d6bb;
  --accent-strong: #31c6a5;
  --accent-soft: rgba(86, 214, 187, .12);
  --blue: #78a8ff;
  --orange: #f0b968;
  --red: #f07885;
  --radius: 14px;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--page); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(ellipse at 50% 25%, #102c3b 0, #091827 42%, #06111f 80%); }
.login-card { width: min(100%, 410px); padding: 38px; border: 1px solid #20384c; border-radius: 20px; background: rgba(12, 26, 42, .96); box-shadow: 0 28px 90px rgba(0,0,0,.32); }
.login-logo { width: 52px; height: 52px; object-fit: contain; margin-bottom: 20px; }
.login-card h1 { margin: 2px 0 8px; font: 800 32px/1.2 Manrope, sans-serif; letter-spacing: -.04em; }
.login-description { color: var(--muted); margin: 0 0 28px; }
.login-card label, .modal-card label, .toolbar label { display: grid; gap: 8px; color: #c8d4e0; font-size: 13px; font-weight: 600; }
.login-card label + input { margin-top: 8px; }
.login-card input { margin-bottom: 18px; }
.demo-note { margin: 18px 0 0; color: var(--subtle); font-size: 11px; line-height: 1.6; text-align: center; }

input, select, textarea { width: 100%; color: var(--text); background: #091726; border: 1px solid #263d52; border-radius: 9px; padding: 11px 12px; outline: none; transition: border-color .16s, box-shadow .16s, background .16s; }
input::placeholder, textarea::placeholder { color: #647a8f; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(86,214,187,.11); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-strong); }
input[type="date"] { min-width: 150px; }
select { cursor: pointer; }
textarea { resize: vertical; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 13px; white-space: nowrap; transition: background .16s, border-color .16s, transform .16s; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--accent); color: #06241f; }
.button-primary:hover { background: #74e6ce; }
.button-primary:disabled { opacity: .48; cursor: not-allowed; }
.button-secondary { border-color: #2a4055; background: #122338; color: #d7e3ed; }
.button-secondary:hover { background: #1a3047; border-color: #3a566e; }
.full-width { width: 100%; min-height: 46px; }
.text-button { color: var(--accent); border: 0; background: none; font-size: 12px; font-weight: 700; padding: 5px 0; }
.text-button:hover { color: #8af0dc; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: #aec0d1; background: transparent; border: 1px solid transparent; border-radius: 9px; font-size: 20px; }
.icon-button:hover { background: var(--surface-hover); border-color: var(--line); }
.form-message { min-height: 18px; margin: 10px 0 0; color: var(--red); font-size: 12px; line-height: 1.5; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 246px; padding: 23px 15px 16px; background: #091726; border-right: 1px solid #192e42; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 29px; text-decoration: none; color: var(--text); }
.brand img { width: 37px; height: 37px; object-fit: contain; }
.brand strong, .brand small, .demo-callout strong, .demo-callout small { display: block; }
.brand strong { font: 800 15px Manrope, sans-serif; letter-spacing: -.02em; }
.brand small { margin-top: 3px; color: var(--subtle); font-size: 11px; }
.nav-caption, .eyebrow { margin: 0; color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.nav-caption { padding: 0 12px 10px; }
.side-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; width: 100%; padding: 0 12px; text-align: left; color: #91a5b9; border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: 13px; font-weight: 600; }
.nav-link:hover { color: var(--text); background: #102135; }
.nav-link.active { color: var(--accent); border-color: rgba(86,214,187,.13); background: var(--accent-soft); }
.nav-icon { display: inline-grid; place-items: center; width: 17px; font-size: 17px; }
.sidebar-bottom { margin-top: auto; }
.demo-callout { display: flex; align-items: center; gap: 10px; margin: 0 3px 13px; padding: 12px 11px; border: 1px solid #1d3448; border-radius: 10px; background: #0c1a2a; }
.callout-dot, .status-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(86,214,187,.1); }
.demo-callout strong { font-size: 11px; color: #d9e5ee; }
.demo-callout small { margin-top: 4px; color: var(--subtle); font-size: 10px; }
.logout-button { color: #8398ac; }
.workspace { width: calc(100% - 246px); margin-left: 246px; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 38px; background: rgba(7,19,34,.91); border-bottom: 1px solid #172b3e; backdrop-filter: blur(14px); }
.breadcrumb { display: flex; align-items: center; gap: 11px; color: var(--subtle); font-size: 12px; }
.breadcrumb strong { color: #d8e3ec; font-weight: 600; }
.breadcrumb-separator { color: #41576c; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #203d42; border-radius: 50px; color: #9dcabb; background: rgba(42,128,105,.08); font-size: 10px; font-weight: 600; }
.status-dot { width: 6px; height: 6px; box-shadow: none; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #072820; background: linear-gradient(135deg,#83efd9,#32b998); font: 800 13px Manrope,sans-serif; }
.mobile-menu { display: none; }
.main-content { max-width: 1600px; margin: 0 auto; padding: 31px 38px 20px; }
.view { display: none; }
.view.active { display: block; animation: show-view .2s ease-out; }
@keyframes show-view { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 7px 0 6px; font: 800 clamp(23px, 2.4vw, 29px)/1.2 Manrope,sans-serif; letter-spacing: -.045em; }
.page-subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { min-width: 0; padding: 18px 18px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg,#102135,#0c1a2a 74%); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.metric-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--accent); background: rgba(86,214,187,.1); font-size: 16px; }
.metric-value { margin: 15px 0 5px; font: 800 25px/1.1 Manrope,sans-serif; letter-spacing: -.04em; }
.metric-hint { color: var(--subtle); font-size: 10px; }
.metric-hint.warning { color: var(--orange); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(270px,.9fr); gap: 15px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #0c1a2a; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 19px 20px 14px; }
.panel-heading h2 { margin: 0; font: 700 14px Manrope,sans-serif; }
.panel-heading p { margin: 5px 0 0; color: var(--subtle); font-size: 11px; }
.panel-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: var(--accent); background: var(--accent-soft); }
.chart { display: flex; align-items: stretch; gap: 12px; height: 206px; margin: 8px 18px 17px; padding: 5px 3px 0; border-bottom: 1px solid #1b2e41; }
.chart-column { display: flex; flex: 1; min-width: 0; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; color: var(--subtle); font-size: 10px; }
.chart-bar-wrap { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 160px; }
.chart-bar { width: min(34px,65%); min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg,#65e1c7,#239b86); box-shadow: 0 0 18px rgba(64,204,174,.08); }
.chart-label { padding-bottom: 9px; }
.compact-list { padding: 2px 18px 17px; }
.compact-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #182a3d; }
.compact-item:last-child { border-bottom: 0; }
.item-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #a4c5dc; background: #152a40; font-size: 13px; font-weight: 700; }
.compact-copy { min-width: 0; flex: 1; }
.compact-copy strong { display: block; overflow: hidden; color: #dce6ef; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.compact-copy small { display: block; margin-top: 4px; color: var(--subtle); font-size: 10px; }
.stock-level { flex: 0 0 auto; color: var(--orange); font-size: 10px; font-weight: 700; }
.recent-panel { grid-column: 1 / -1; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 11px 16px; color: #758ba0; background: #0a1725; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
td { padding: 12px 16px; border-top: 1px solid #182b3e; color: #bfcedb; font-size: 11px; }
tbody tr:hover { background: rgba(23,43,62,.45); }
td strong { color: #e2ebf2; font-weight: 600; }
.align-right { text-align: right; }
.table-footer { padding: 12px 17px; border-top: 1px solid #182b3e; color: var(--subtle); font-size: 10px; }
.empty-state { padding: 30px 18px; color: var(--subtle); text-align: center; font-size: 12px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 30px; color: #80dbc2; background: rgba(49,198,165,.1); font-size: 9px; font-weight: 700; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.inactive { color: #91a1b1; background: rgba(145,161,177,.1); }
.status-badge.warning { color: var(--orange); background: rgba(240,185,104,.1); }
.row-action { padding: 6px 8px; border: 1px solid #253b50; border-radius: 7px; color: #9fb3c5; background: #102135; font-size: 10px; }
.row-action:hover { color: var(--accent); border-color: #3c726b; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px; }
.toolbar > input, .toolbar > select { width: auto; min-width: 150px; }
.toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.toolbar label input { width: auto; }
.search-box { position: relative; display: flex; align-items: center; min-width: min(100%,250px); flex: 1; }
.search-box > span { position: absolute; left: 12px; color: var(--subtle); font-size: 20px; }
.search-box input { padding-left: 36px; }
.sales-toolbar { border-bottom: 1px solid #182b3e; }
.panel-heading-padded { padding-top: 20px; }
.report-panel .toolbar { padding: 18px; border-bottom: 1px solid #182b3e; }
.report-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 17px; border-bottom: 1px solid #182b3e; }
.report-stat { padding: 14px; border: 1px solid #20354a; border-radius: 10px; background: #102135; }
.report-stat span { display: block; color: var(--muted); font-size: 10px; }
.report-stat strong { display: block; margin-top: 8px; font: 700 18px Manrope,sans-serif; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 25px 3px 8px; color: #587087; font-size: 10px; }

.modal { width: min(calc(100% - 28px), 580px); max-width: none; max-height: min(90vh,850px); padding: 0; overflow: auto; border: 1px solid #294156; border-radius: 16px; color: var(--text); background: #0c1a2a; box-shadow: 0 25px 100px rgba(0,0,0,.55); }
.modal::backdrop { background: rgba(1,8,15,.74); backdrop-filter: blur(3px); }
.modal-card { padding: 23px; }
.wide-modal { width: min(100%,760px); }
.compact-modal { display: grid; gap: 14px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.modal-header h2 { margin: 6px 0 0; font: 800 20px Manrope,sans-serif; letter-spacing: -.03em; }
.modal-header .icon-button { margin: -4px -7px 0 0; font-size: 25px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid input { margin-top: 1px; }
.form-span-2 { grid-column: 1 / -1; }
.checkbox-label { display: flex !important; align-items: center; gap: 9px !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.sale-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(220px,.8fr); gap: 22px; }
.sale-add-row { display: grid; grid-template-columns: minmax(0,1fr) 85px auto; align-items: end; gap: 9px; }
.sale-add-row .button { min-height: 42px; }
.cart-list { display: grid; gap: 7px; max-height: 220px; overflow-y: auto; margin-top: 14px; }
.cart-row { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #1f3448; border-radius: 9px; background: #0a1725; }
.cart-product { flex: 1; min-width: 0; }
.cart-product strong { display: block; overflow: hidden; color: #dce7ef; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cart-product small { display: block; margin-top: 3px; color: var(--subtle); font-size: 10px; }
.cart-line-total { color: #dce7ef; font-size: 11px; font-weight: 700; }
.cart-remove { border: 0; color: var(--red); background: transparent; font-size: 16px; }
.sale-details { display: grid; align-content: start; gap: 14px; }
.sale-total { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; padding: 16px 0; border-top: 1px solid #263a4d; color: var(--muted); font-size: 12px; }
.sale-total strong { color: var(--accent); font: 800 21px Manrope,sans-serif; }
.toast-region { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: grid; gap: 9px; width: min(360px,calc(100vw - 40px)); }
.toast { padding: 13px 15px; border: 1px solid #2a524b; border-radius: 10px; color: #d8f6eb; background: #102d2b; box-shadow: 0 12px 30px rgba(0,0,0,.25); font-size: 12px; animation: toast-in .18s ease-out; }
.toast.error { color: #ffe1e3; border-color: #653b45; background: #301d29; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

@media (max-width: 1080px) {
  .sidebar { width: 220px; }
  .workspace { width: calc(100% - 220px); margin-left: 220px; }
  .topbar { padding: 0 24px; }
  .main-content { padding: 27px 24px 18px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .toolbar { gap: 8px; }
}
@media (max-width: 760px) {
  .sidebar { width: 260px; transform: translateX(-101%); transition: transform .2s ease; box-shadow: 20px 0 40px rgba(0,0,0,.24); }
  .sidebar.open { transform: translateX(0); }
  .workspace { width: 100%; margin-left: 0; }
  .topbar { height: 60px; padding: 0 16px; }
  .mobile-menu { display: grid; margin-left: -9px; margin-right: 7px; }
  .breadcrumb { flex: 1; gap: 7px; font-size: 11px; }
  .topbar-actions { gap: 9px; }
  .status-pill { padding: 6px 8px; font-size: 0; }
  .status-dot { width: 7px; height: 7px; }
  .avatar { width: 29px; height: 29px; }
  .main-content { padding: 23px 16px 16px; }
  .page-heading { align-items: flex-start; gap: 12px; margin-bottom: 19px; }
  .page-heading > .button { align-self: center; }
  .page-heading .page-subtitle { max-width: 350px; font-size: 11px; line-height: 1.5; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .recent-panel { grid-column: auto; }
  .chart { height: 185px; }
  .chart-bar-wrap { height: 140px; }
  .report-metrics { grid-template-columns: 1fr; }
  .app-footer { flex-direction: column; gap: 5px; }
}
@media (max-width: 520px) {
  .login-card { padding: 29px 23px; }
  .page-heading { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .page-heading > div { grid-column: 1 / -1; }
  .page-heading > .button { grid-column: 1 / -1; justify-self: start; }
  .page-heading h1 { font-size: 25px; }
  .metric-grid { gap: 9px; }
  .metric-card { padding: 14px 13px; }
  .metric-top { font-size: 10px; }
  .metric-icon { width: 27px; height: 27px; }
  .metric-value { font-size: 21px; }
  .metric-hint { font-size: 9px; }
  .panel-heading { padding-right: 15px; padding-left: 15px; }
  .chart { gap: 5px; margin-right: 12px; margin-left: 12px; }
  .toolbar > input, .toolbar > select { flex: 1 1 45%; min-width: 120px; }
  .search-box { flex-basis: 100%; }
  .toolbar .button { flex: 1; }
  .sales-toolbar { align-items: stretch; }
  .sales-toolbar label { flex: 1 1 calc(50% - 8px); display: grid; }
  .sales-toolbar label input { width: 100%; min-width: 0; }
  .sales-toolbar .button { flex-basis: 100%; }
  .report-panel .toolbar label { flex: 1 1 calc(50% - 8px); display: grid; }
  .report-panel .toolbar label input { width: 100%; min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: auto; }
  .sale-layout { grid-template-columns: 1fr; gap: 15px; }
  .sale-add-row { grid-template-columns: minmax(0,1fr) 68px; }
  .sale-add-row .button { grid-column: 1 / -1; }
  .modal-card { padding: 19px; }
  td, th { padding-right: 12px; padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
