/* SmartSales ERP Professional Theme v2.1.0
 * Overlay on top of smartsales.css (Phase 2A).
 * Presentation-only: no business logic, route, migration or API changes.
 * Palette: balanced blue-slate / soft gray / desaturated steel blue.
 */
:root {
  --ink: #27374a;
  --muted: #718296;
  --subtle: #8e9cab;
  --line: #e2e8ed;
  --canvas: #f4f6f8;
  --white: #ffffff;
  --primary: #406b87;
  --primary-hover: #315771;
  --primary-soft: #e9f1f6;
  --success: #217957;
  --success-soft: #eaf6ef;
  --warning: #a36520;
  --warning-soft: #fff4e5;
  --danger: #b3424a;
  --danger-soft: #fff0f1;
  --sidebar: #283b4f;
  --radius: 15px;
  --shadow: 0 8px 27px rgba(40, 62, 84, .045);
}

/* Global scale and keyboard accessibility */
body { background: var(--canvas); color: var(--ink); }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #80a8c1;
  outline-offset: 2px;
}
::selection { background: #dce9f1; color: #1e394f; }
h1, h2, h3 { color: #25384b; letter-spacing: -.026em; }

/* Sidebar stays accessible for long navigation lists without hiding logout. */
.sidebar {
  background: linear-gradient(180deg, #30475d 0%, #293e51 58%, #263849 100%);
  color: #e3ebf1;
  padding: 23px 13px 14px;
  box-shadow: 1px 0 0 rgba(13, 33, 50, .11);
}
.brand-link { padding: 4px 10px 20px; gap: 12px; }
.brand-logo {
  background: linear-gradient(145deg, #6c93a8, #416e88);
  box-shadow: 0 3px 12px rgba(17, 38, 58, .18);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 11px;
}
.brand-copy strong { color: #fbfdff; font-weight: 760; }
.brand-copy small { color: #bbccd9; }
.sidebar > .nav-heading { color: #b3c7d6; padding: 15px 13px 6px; }
.sidebar .nav-links {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 3px 10px 0;
  gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: #698094 transparent;
}
.sidebar .nav-links::-webkit-scrollbar { width: 5px; }
.sidebar .nav-links::-webkit-scrollbar-thumb {
  background: rgba(198, 216, 228, .36); border-radius: 20px;
}
.sidebar .nav-links .nav-heading {
  color: #b6c9d8;
  font-weight: 750;
  letter-spacing: .115em;
  font-size: 10px;
  padding: 22px 11px 7px;
}
.sidebar .nav-link {
  position: relative;
  min-height: 43px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 560;
  letter-spacing: 0;
  color: #d8e2ea;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.sidebar .nav-link .icon { color: #adc1d0; width: 18px; height: 18px; }
.sidebar .nav-link:hover { background: rgba(235, 246, 255, .095); color: #fff; }
.sidebar .nav-link:hover .icon { color: #f4fbff; }
.sidebar .nav-link.active {
  background: #3d617b;
  color: #ffffff;
  box-shadow: inset 3px 0 0 #b9d2e0;
  font-weight: 700;
}
.sidebar .nav-link.active .icon { color: #f2faff; }
.sidebar .nav-link:focus-visible { outline-color: #d9eaf4; outline-offset: -2px; }
.sidebar-footer {
  flex: 0 0 auto;
  padding-top: 12px;
  margin-top: 0;
  border-top: 1px solid rgba(225, 240, 250, .13);
}
.sidebar-profile {
  background: rgba(233, 246, 255, .065);
  border: 1px solid rgba(231, 243, 250, .09);
  padding: 11px;
  border-radius: 11px;
}
.sidebar-profile .avatar { background: #516d81; color: #fff; }
.profile-name { color: #fff; }
.profile-role { color: #b6cbd9; }
.logout-btn { color: #d6e2ea; margin-top: 5px; font-weight: 600; }
.logout-btn:hover { background: rgba(255, 255, 255, .085); color: #fff; }
.sidebar-close { color: #fff; }

/* Topbar: quieter information hierarchy */
.topbar {
  height: 68px;
  background: rgba(255, 255, 255, .95);
  border-bottom: 1px solid #e5eaee;
  box-shadow: 0 1px 7px rgba(40, 58, 78, .025);
  backdrop-filter: blur(12px);
}
.topbar-title { color: #8997a7; font-weight: 550; }
.topbar-title b { color: #354c60; font-weight: 750; }
.topbar-right { gap: 12px; }
.topbar-user { color: #68798b !important; }
.topbar .avatar { background: #e4edf3; color: #365a75; font-size: 12px; }
.topbar-right .badge.neutral {
  background: #edf2f5;
  color: #5d7487;
  border: 1px solid #e0e8ee;
  font-weight: 650;
}
.menu-toggle { color: var(--ink); }
.menu-toggle:hover { background: #eaf1f5; }

/* Page titles, surface and content density */
.workspace { padding-top: 30px; }
.page-heading { margin-bottom: 22px; }
.page-heading h1 { font-size: clamp(24px, 2vw, 29px); color: #22364a; font-weight: 790; }
.page-description { color: #77899a; line-height: 1.65; }
.footer-note { color: #8c9baa; }
.card {
  border: 1px solid #e1e8ed;
  border-radius: 15px;
  box-shadow: var(--shadow);
}
.card-header { margin-bottom: 17px; }
.card-header h2, .section-heading h2 { color: #273b4d; font-weight: 750; }
.card-subtitle { color: #78899a; line-height: 1.58; }
.stat-card { background: linear-gradient(175deg, #fff 73%, #fcfdfe); }
.stat-label { color: #6f8294; }
.stat-number { color: #253b50; }
.stat-icon { background: #e9f1f5; color: #46738b; }
.stat-icon.dark { background: #ecf1f4; color: #617a8e; }

/* Buttons are muted steel blue, never bright neon. */
.btn {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(41, 91, 119, .09);
  border-radius: 9px;
  font-weight: 700;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.secondary { background: #e9f0f4; border-color: #e9f0f4; color: #3d6882; }
.btn.secondary:hover { background: #dbe8ee; border-color: #dbe8ee; }
.btn.outline {
  background: white;
  color: #486075;
  border-color: #d5e0e6;
  box-shadow: none;
}
.btn.outline:hover { background: #f3f7f9; border-color: #a9c0cd; color: #315773; }
.btn.text-btn { background: transparent; color: #697d8e; border: 0; box-shadow: none; }
.btn.text-btn:hover { background: #edf3f6; color: var(--primary); }
.btn:disabled, button:disabled { opacity: .55; cursor: not-allowed; }

/* Indicators: low saturation, accessible labels */
.badge, .chip { background: #e8f1f5; color: #3d6882; }
.badge.neutral { background: #edf1f4; color: #647788; }
.badge.success { background: #e7f4ed; color: #23744d; }
.badge.warning, .pill { background: #fbf0e2; color: #925b1c; }
.badge.danger { background: #fae9e9; color: #ac4046; }

/* Forms: clear labels, better focus, less visual noise */
.form-grid { gap: 18px 20px; }
.form-field { gap: 8px; }
.form-field label { color: #415569; font-size: 12.5px; font-weight: 700; }
.form-field input,
.form-field select,
.form-field textarea,
.field-input,
.filter-select,
.table-search input,
.sale-qty-input,
.inline-edit-form input {
  background: #fff;
  border: 1px solid #d5e0e7;
  border-radius: 10px;
  color: #273a4d;
  box-shadow: 0 1px 2px rgba(36, 54, 73, .018);
}
.form-field input, .form-field select, .field-input { min-height: 45px; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #98a8b5; }
.form-field input:hover, .form-field select:hover, .form-field textarea:hover,
.filter-select:hover, .table-search input:hover { border-color: #bacbd5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
.field-input:focus, .table-search input:focus, .filter-select:focus,
.inline-edit-form input:focus, .sale-qty-input:focus {
  outline: none;
  border-color: #7395a9;
  box-shadow: 0 0 0 3px rgba(101, 149, 177, .16);
}
.form-field [aria-invalid="true"] { border-color: #bd5d63; }
.form-field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(185, 75, 88, .12); }
.form-note {
  background: #f2f6f8;
  border-color: #dfe9ee;
  color: #617a8d;
  border-radius: 10px;
}
.form-note .icon { color: #5a829a; }
.form-actions { border-color: #e4e9ed; }
.hint { color: #7c8d9e; }

/* Tables, search and transactional lists */
.table-wrap { border-color: #e2e8ed; border-radius: 11px; }
thead th { background: #f6f8f9; color: #657b8c; font-weight: 750; }
td, th { border-bottom-color: #ebeff2; }
tbody tr:hover { background: #f7fafb; }
.cell-title { color: #30495c; }
.cell-sub { color: #8294a4; }
.cell-code { background: #eff3f5; color: #506c80; }
.empty-icon { background: #eef3f6; color: #718c9d; }
.empty-state strong { color: #405b70; }
.table-search .icon { color: #859ba9; }
.quick-link { border-color: #e0e7eb; }
.quick-link:hover { background: #f4f8fa; border-color: #b5cbd6; color: #3a6c88; }
.quick-link .icon { color: #497a94; }
.guide-step .number { background: #e7f0f5; color: #426e89; }
.info-block { background: #f5f8fa; }

/* Invoice and stock screen: group facts visually with less spacing waste. */
.sale-item-row {
  background: #f7f9fa;
  border-color: #e0e7eb;
  border-radius: 12px;
  padding: 14px;
}
.sales-facts { gap: 10px; }
.sales-facts > div {
  background: #f6f8f9;
  border: 1px solid #edf1f3;
  border-radius: 9px;
  padding: 13px 14px;
}
.sales-facts dt { color: #788c9b; font-weight: 550; }
.sales-facts dd { color: #2c465a; font-size: 13px; font-weight: 730; }
.sales-metric { background: #f3f7f9; border: 1px solid #e4ecf0; }
.sale-qty-input { min-width: 84px; }
.sales-review-actions { align-items:center; }

/* Alerts and approval notice surfaces */
.notice { border-radius: 11px; }
.notice.good { background: #edf7f1; border-color: #cbe7d6; color: #246b49; }
.notice.bad { background: #fdf1f0; border-color: #eccfd0; color: #9c4149; }
.alert-row-icon { background: #fbf0e2; color: #93611f; }

/* Login matches the same professional palette */
.auth-body { background: #f4f7f8; }
.auth-showcase {
  background: radial-gradient(circle at 95% 12%, rgba(143, 181, 200, .16), transparent 35%),
    linear-gradient(150deg, #2b4559 0%, #304f63 58%, #273e53 100%);
}
.auth-showcase p { color: #d1e1eb; }
.auth-showcase h2 { color: #ffffff; text-shadow: 0 2px 18px rgba(4,20,35,.20); }
.auth-footer { color: #b9d1df; }
.auth-pill {
  background: rgba(225, 242, 251, .10);
  border-color: rgba(231, 246, 254, .18);
  color: #edf7fc;
}
.auth-panel h1 { color: #2b4254; }
.auth-meta { border-color: #dce5eb; color: #8193a2; }
.password-toggle:hover { background: #e9f2f6; }

/* Layout for small devices and reduced motion. */
@media (max-width: 900px) {
  .sidebar { box-shadow: 14px 0 35px rgba(24, 40, 54, .21); }
  .sidebar-backdrop { background: rgba(22, 38, 51, .58); }
  .topbar { padding: 0 20px; }
  .auth-logo-mobile { color: #36576b; }
}
@media (max-width: 610px) {
  .sidebar { width: min(290px, 86vw); flex-basis: auto; }
  .topbar { height: 62px; padding: 0 14px; }
  .topbar-right { gap: 7px; }
  .topbar-right .badge.neutral { padding: 5px 8px; font-size: 10px; }
  .workspace { padding: 22px 14px 48px; }
  .page-heading h1 { font-size: 24px; }
  .card { border-radius: 12px; padding: 17px; }
  .form-grid { gap: 15px; }
  .sale-item-row { gap: 10px; }
  .sales-facts { gap: 8px; }
}
@media print {
  .sidebar, .sidebar-backdrop, .topbar, .footer-note, .page-heading-right { display: none !important; }
  .page-shell { width: 100%; }
  .workspace { padding: 0; }
  .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar .nav-link { transition: none; }
}
