:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-soft: #eef3f6;
  --ink: #172026;
  --muted: #687681;
  --line: #dce5ea;
  --primary: #146c63;
  --primary-dark: #0f514b;
  --accent: #c7832f;
  --danger: #b73535;
  --success: #24794d;
  --shadow: 0 16px 40px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  color: #ffffff;
  background-color: #0f1422;
  background-image: radial-gradient(circle at 50% -20%, #1a2234, #0f1422 60%);
}

.auth-screen.hidden,
.app-shell.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.role-hidden,
[hidden].role-hidden,
.nav-item.role-hidden,
[data-dashboard-action].role-hidden {
  display: none !important;
}

.login-container {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  width: 100%;
  max-width: 1150px;
  gap: 48px;
}

.brand-section {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.login-logo-img {
  display: block;
  width: min(430px, 100%);
  height: auto;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.3));
}

.hero-text h1 {
  margin-bottom: 16px;
  color: #ffffff;
  font-size: clamp(2.25rem, 6vw, 2.75rem);
  line-height: 1.2;
  font-weight: 700;
}

.hero-text h1 span {
  color: #2e78ff;
}

.hero-slider {
  width: min(390px, 100%);
  overflow: hidden;
}

.hero-slider-track {
  display: flex;
  transition: transform 520ms ease;
}

.hero-slide {
  flex: 0 0 100%;
  min-width: 100%;
}

.hero-slide strong {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 1.05rem;
}

.hero-slide p {
  max-width: 350px;
  margin-bottom: 0;
  color: #9ca3af;
  font-size: 0.875rem;
  line-height: 1.6;
}

.image-section {
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 350px;
}

.glow-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 75%;
  height: 75%;
  border-radius: 50%;
  background: #2e78ff;
  filter: blur(40px);
  opacity: 0.2;
  transform: translate(-50%, -50%);
}

.robot-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.42));
}

.form-section {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 40px;
  text-align: center;
}

.form-header h2 {
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 2.25rem;
  font-weight: 700;
}

.form-header p {
  margin-bottom: 0;
  color: #d1d5db;
  font-size: 1.125rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  margin-left: 8px;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.input-field {
  width: 100%;
  border: 1px solid rgba(75, 85, 99, 0.4);
  border-radius: 999px;
  padding: 16px 24px;
  color: #ffffff;
  font-size: 1rem;
  background: #1a2234;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field::placeholder {
  color: #6b7280;
}

.input-field.password {
  font-size: 1.125rem;
  letter-spacing: 0.2em;
}

.input-field:focus {
  border-color: rgba(46, 120, 255, 0.5);
  outline: 0;
  box-shadow: 0 0 0 2px rgba(46, 120, 255, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.submit-btn {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  padding: 16px 24px;
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 600;
  background: #2e78ff;
  box-shadow: 0 4px 20px -4px rgba(46, 120, 255, 0.6);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.submit-btn:hover {
  background: #3b82f6;
  box-shadow: 0 6px 25px -4px rgba(46, 120, 255, 0.8);
  transform: translateY(-1px);
}

.login-hint,
.session-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.login-form .login-hint {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
  text-align: center;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  background: #ffffff;
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 22px;
  color: #ffffff;
  background: #0b2b68;
  overflow: visible;
  transition: opacity 160ms ease, transform 160ms ease, padding 160ms ease;
}

.app-shell.sidebar-collapsed .sidebar {
  overflow: hidden;
  opacity: 0;
  transform: translateX(-16px);
  pointer-events: none;
  padding-left: 0;
  padding-right: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
}

.dashboard-brand {
  display: block;
  padding: 0 0 42px;
}

.dashboard-logo-img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
  color: #132326;
  background: #9be1d3;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-footer span {
  color: #a9bbb9;
  font-size: 0.82rem;
}

.nav-list {
  display: grid;
  gap: 22px;
}

.nav-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px 0 8px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: left;
  background: transparent;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.14);
}

.nav-item.active {
  color: #0b2b68;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.nav-icon i {
  line-height: 1;
}

.nav-item.active .nav-icon {
  border-color: rgba(11, 43, 104, 0.28);
  color: #0b2b68;
  background: #edf3ff;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.sidebar-footer strong {
  display: block;
  margin-top: 4px;
}

.main {
  min-width: 0;
  padding: 0;
  background: #ffffff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  margin-bottom: 0;
  padding: 16px 28px;
  color: #111111;
  background: #ffffff;
  box-shadow: 0 13px 26px rgba(0, 0, 0, 0.22);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.topbar-left .date-block {
  margin-left: auto;
  margin-right: auto;
}

.global-search {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(220px, 360px);
  align-items: center;
  gap: 8px;
  margin-left: 54px;
  min-height: 42px;
  border: 1px solid #d7e0eb;
  border-radius: 12px;
  padding: 0 12px;
  background: #f8fbff;
}

.global-search i {
  color: #607083;
}

.global-search input {
  width: 100%;
  min-height: 38px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

.global-search-results {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 80;
  display: none;
  width: min(460px, 88vw);
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.global-search-results.open {
  display: grid;
  gap: 6px;
}

.global-search-results button {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
}

.global-search-results button:hover {
  border-color: #c8d7e8;
  background: #f4f8fc;
}

.global-search-results span,
.global-search-results small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.sidebar-toggle-btn {
  position: fixed;
  top: 22px;
  left: 244px;
  z-index: 70;
  width: 48px;
  height: 48px;
  border: 1px solid #cfd8e4;
  border-radius: 12px;
  color: #274567;
  background: #f8fbff;
  box-shadow: 0 8px 18px rgba(16, 33, 61, 0.16);
}

.sidebar-toggle-btn i {
  font-size: 1.2rem;
}

.app-shell.sidebar-collapsed .sidebar-toggle-btn {
  left: 10px;
}

.date-block {
  display: grid;
  gap: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.date-block span {
  color: #676767;
}

.date-block strong {
  color: #111111;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.topbar-actions,
.panel-header,
.panel-header.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-actions {
  gap: 16px;
}

.notification-menu-wrap {
  position: relative;
}

.notification-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 0;
  color: #222222;
  background: transparent;
}

.notification-button i {
  font-size: 1.9rem;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  right: 2px;
  top: 2px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: #d92d20;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.notification-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 75;
  display: none;
  width: min(390px, 88vw);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.notification-menu.open {
  display: grid;
  gap: 10px;
}

.notification-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.notification-menu-head strong {
  color: var(--ink);
}

.notification-menu-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.notification-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
}

.notification-item:hover {
  border-color: #aebfd4;
  background: #f7fbff;
}

.notification-item.unread {
  border-color: #8bb8f5;
  background: #eef6ff;
}

.notification-item > i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: #ffffff;
  background: #1f74e0;
}

.notification-item strong,
.notification-item span,
.notification-item small {
  display: block;
}

.notification-item span {
  margin-top: 2px;
  color: #3a4757;
  font-size: 0.86rem;
}

.notification-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.notification-item .notification-inline-action {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  margin-top: 8px;
  border-radius: 8px;
  padding: 0 10px;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  background: #117f62;
  font-size: 0.76rem;
  font-weight: 900;
}

.user-chip {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  color: #111111;
}

.user-chip strong,
.user-chip small {
  display: block;
  line-height: 1;
}

.user-chip small {
  margin-top: 4px;
  font-size: 0.95rem;
}

.avatar-shape {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0b2b68;
  background-position: center;
  background-size: cover;
}

.avatar-shape:not(.has-photo)::before {
  position: absolute;
  left: 17px;
  top: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
}

.avatar-shape:not(.has-photo)::after {
  position: absolute;
  left: 11px;
  bottom: 9px;
  width: 26px;
  height: 14px;
  border-radius: 24px 24px 8px 8px;
  background: #ffffff;
  content: "";
}

.chevron {
  font-size: 1.1rem;
  color: #333333;
}

.user-menu {
  position: relative;
}

.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 20;
  display: none;
  width: 290px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.profile-menu.open {
  display: grid;
  gap: 14px;
}

.profile-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-card-head strong,
.profile-card-head span {
  display: block;
}

.profile-card-head strong {
  font-size: 1.1rem;
}

.profile-card-head span {
  color: var(--muted);
}

.profile-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.profile-details div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: baseline;
}

.profile-details dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
}

.avatar-shape.large {
  width: 64px;
  height: 64px;
}

.avatar-shape.large:not(.has-photo)::before {
  left: 23px;
  top: 13px;
  width: 18px;
  height: 18px;
}

.avatar-shape.large:not(.has-photo)::after {
  left: 15px;
  bottom: 12px;
  width: 34px;
  height: 18px;
}

.profile-upload {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px dashed #0b2b68;
  border-radius: 8px;
  color: #0b2b68;
  font-weight: 800;
  cursor: pointer;
}

.profile-upload input {
  display: none;
}

.profile-admin-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-admin-action span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #d84a32;
  font-size: 0.75rem;
  font-weight: 900;
}

.theme-toggle-block {
  display: grid;
  gap: 8px;
}

.theme-toggle-block > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.theme-toggle-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.theme-option {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  background: #ffffff;
}

.theme-option i {
  margin-right: 6px;
}

.theme-option.active {
  color: #ffffff;
  border-color: #1f62d2;
  background: #2a79ed;
}

.panel-header {
  margin-bottom: 18px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  padding: 0 16px;
  color: #ffffff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.ghost-button {
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  font-weight: 800;
  background: #ffffff;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  color: var(--danger);
  background: #fbeaea;
}

.full {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.administration-view {
  padding: 26px;
}

.administration-panel {
  border: 0;
  box-shadow: none;
}

.administration-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.administration-header h2 {
  color: #111111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.35rem;
  font-weight: 500;
}

.administration-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.administration-summary span {
  display: grid;
  gap: 2px;
  min-width: 118px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.74rem;
  font-weight: 800;
}

.administration-summary strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.administration-actions {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.admin-action {
  display: grid;
  min-height: 76px;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 800;
}

.admin-action i {
  color: #247ef5;
  font-size: 1.35rem;
}

.admin-action.active {
  color: #ffffff;
  border-color: #247ef5;
  background: #247ef5;
}

.admin-action.active i {
  color: #ffffff;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stat {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-stat span,
.admin-stat small {
  color: var(--muted);
  font-weight: 800;
}

.admin-stat strong {
  color: var(--ink);
  font-size: 1.7rem;
}

.admin-insights,
.admin-workspace,
.admin-chart-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
}

.admin-loss-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-chart-layout {
  grid-template-columns: minmax(0, 1fr) 310px;
}

.admin-insights {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.admin-insights section,
.admin-chart-box,
.admin-category-list {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-insights h3,
.admin-form h3,
.admin-category-list h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1.05rem;
}

.admin-note,
.admin-movement,
.admin-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.admin-note {
  justify-content: flex-start;
}

.admin-note i {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #16b7a0;
}

.admin-movement-list {
  display: grid;
}

.admin-movement span {
  min-width: 74px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-movement strong {
  flex: 1;
}

.admin-movement em {
  color: #247ef5;
  font-style: normal;
  font-weight: 900;
}

.admin-form {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-form .admin-inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--ink);
}

.admin-form .admin-inline-check input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.admin-form input,
.admin-form select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.admin-form button {
  margin-top: 4px;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-form-actions .primary-button,
.admin-form-actions .ghost-button {
  flex: 1 1 140px;
}

.admin-records-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.admin-records-head {
  display: flex;
  justify-content: flex-end;
}

.admin-record-search {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  width: min(520px, 100%);
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-record-search i {
  color: var(--muted);
  text-align: center;
}

.admin-record-search input {
  min-height: 42px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0 12px 0 0;
  color: var(--ink);
  background: transparent;
  outline: 0;
}

.admin-chart-header {
  align-items: flex-start;
  gap: 14px;
}

.admin-chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-chart-controls .tiny-button.active {
  color: #ffffff;
  border-color: #247ef5;
  background: #247ef5;
}

.admin-chart-controls label {
  display: grid;
  gap: 4px;
  min-width: 138px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-chart-controls input {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  color: var(--ink);
  background: #ffffff;
}

.admin-chart-box canvas {
  width: 100%;
  max-width: 100%;
  height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-category-list {
  align-self: start;
}

.admin-category-row strong {
  color: #247ef5;
}

.admin-category-row.total {
  margin-top: 6px;
  border-top: 2px solid var(--line);
  border-bottom: 0;
}

.admin-period-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 92px;
  padding: 12px 16px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  box-shadow: none;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem;
  font-weight: 500;
}

.metric strong {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(1.35rem, 1.9vw, 1.9rem);
  line-height: 1;
}

.metric small {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
}

.metric.warning strong {
  color: var(--accent);
}

.metric-blue {
  background: #247ef5;
}

.metric-green {
  background: #5cc238;
}

.metric-amber {
  background: #ffc45d;
}

.metric-teal {
  background: #16b7a0;
}

.panel {
  padding: 20px;
}

#dashboard {
  padding: 26px 26px 22px;
}

.dashboard-title {
  margin: 0 0 16px;
  color: #111111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 18px;
  margin-top: 16px;
}

.chart-panel {
  min-height: 230px;
  border: 0;
  box-shadow: none;
}

.dashboard-panel-header h2 {
  color: #111111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.chart-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
}

.chart-filter span {
  color: #555555;
}

.chart-filter select {
  min-height: 34px;
  border: 1px solid #cfd7df;
  border-radius: 8px;
  padding: 0 30px 0 10px;
  color: #111111;
  background: #ffffff;
}

.sales-summary {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 170px;
}

.sales-summary canvas,
#topProductsChart {
  width: 100%;
  max-width: 100%;
  height: 170px;
}

.dashboard-comparison-panel {
  margin-top: 18px;
  border: 0;
  box-shadow: none;
}

.dashboard-period-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #d6dee6;
  border-radius: 999px;
  padding: 0 12px;
  color: #4c5662;
  background: #f7fafc;
  font-size: 0.82rem;
  font-weight: 800;
}

.dashboard-comparison-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 10px;
}

.dashboard-comparison-summary article {
  border: 1px solid #e0e7ee;
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
}

.dashboard-comparison-summary span {
  display: block;
  margin-bottom: 6px;
  color: #5c6672;
  font-size: 0.82rem;
  font-weight: 800;
}

.dashboard-comparison-summary strong {
  display: block;
  color: #111111;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  line-height: 1;
}

.dashboard-comparison-summary strong.negative {
  color: #d84a32;
}

#salesExpensesChart {
  width: 100%;
  max-width: 100%;
  height: 300px;
}

.sales-summary ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  color: #222222;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  list-style: none;
}

.growth-graphic {
  position: relative;
  display: flex;
  align-items: end;
  gap: 12px;
  width: min(220px, 100%);
  height: 130px;
  padding: 0 0 22px 20px;
  border-bottom: 5px solid #000000;
}

.growth-graphic::before {
  position: absolute;
  right: 14px;
  top: 8px;
  width: 118px;
  height: 72px;
  border-top: 6px solid #000000;
  border-right: 6px solid #000000;
  border-radius: 0 70px 0 0;
  content: "";
  transform: rotate(-14deg);
}

.growth-graphic span {
  width: 28px;
  border: 5px solid #000000;
  border-bottom-width: 7px;
  border-radius: 6px 6px 0 0;
}

.growth-graphic span:nth-child(1) { height: 30px; }
.growth-graphic span:nth-child(2) { height: 40px; }
.growth-graphic span:nth-child(3) { height: 54px; }
.growth-graphic span:nth-child(4) { height: 72px; }
.growth-graphic span:nth-child(5) { height: 100px; }

.product-bars {
  display: flex;
  align-items: end;
  gap: 9px;
  min-height: 170px;
  padding: 18px 6px 0;
}

.product-bar {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 6px;
  min-width: 26px;
  flex: 1;
  color: #777777;
  font-size: 0.62rem;
}

.product-bar span {
  display: block;
  width: 18px;
  border-radius: 7px 7px 0 0;
  background: #9d9d9d;
}

.product-bar strong {
  color: #555555;
  font-size: 0.62rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 14px;
  padding: 0 10px;
}

.dashboard-quick-actions-top {
  margin-top: -2px;
}

.dashboard-action-panel {
  display: none;
  margin-top: 18px;
  border: 1px solid var(--line);
  box-shadow: none;
}

.dashboard-action-panel.open {
  display: block;
}

.action-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.cancellation-action-grid {
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1.42fr);
  align-items: start;
}

.action-form {
  display: grid;
  gap: 10px;
}

.cancellation-form {
  gap: 8px;
}

.action-form input,
.action-form select,
.action-form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
}

.action-form textarea {
  min-height: 96px;
  resize: vertical;
}

.cancellation-form textarea {
  min-height: 74px;
}

.dashboard-lookup {
  position: relative;
  display: grid;
  gap: 8px;
}

.dashboard-lookup-results {
  display: grid;
  gap: 6px;
}

.dashboard-lookup-option {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid #dbe3eb;
  border-radius: 8px;
  padding: 9px 10px;
  color: #1b2733;
  text-align: left;
  background: #ffffff;
}

.dashboard-lookup-option small,
.cancellation-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

.dashboard-action-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted);
  background: #ffffff;
}

.dashboard-action-search input {
  width: 100%;
  min-height: 34px;
  border: 0;
  outline: 0;
  font: inherit;
  background: transparent;
}

.action-list {
  display: grid;
  gap: 10px;
}

.cancelled-invoices-panel {
  display: grid;
  gap: 8px;
}

.cancelled-invoices-scroll {
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.compact-action-list {
  gap: 8px;
}

.action-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.cancellation-item {
  align-items: center;
  min-height: 88px;
  padding: 10px 12px;
}

.cancellation-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cancellation-main strong,
.cancellation-main small,
.cancellation-main em {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cancellation-main em {
  display: block;
  color: #324052;
  font-size: 0.84rem;
  font-style: normal;
  white-space: nowrap;
}

.cancellation-meta {
  white-space: nowrap;
}

.action-item-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 152px;
}

.quote-action-item {
  align-items: center;
}

.action-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  width: 100%;
  border-color: #cbd6e2;
  color: #24415f;
  background: #ffffff;
  font-size: 0.78rem;
}

.action-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.action-icon-button i {
  font-size: 0.95rem;
}

.action-icon-button.pdf-button {
  border-color: #f0c7c1;
  color: #b42318;
  background: #fff7f5;
}

.action-icon-button.danger-button {
  border-color: #f4b7b2;
  color: #b42318;
  background: #fff1ef;
}

.action-icon-button:hover {
  border-color: #9db5d6;
  background: #f5f9ff;
}

.action-icon-button.danger-button:hover {
  border-color: #e58b83;
  background: #ffe5e1;
}

.transfer-approval-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 16px;
}

.transfer-approval-layout h3 {
  margin: 0 0 10px;
  color: var(--ink);
}

.transfer-approval-item {
  align-items: center;
}

.transfer-approval-item.pending {
  align-items: stretch;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.transfer-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.transfer-detail-grid div {
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  padding: 8px 9px;
  background: #ffffff;
}

.transfer-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.transfer-detail-grid strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.9rem;
}

.transfer-approval-actions {
  min-width: 190px;
}

.transfer-upload-card {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 84px;
  border: 1px dashed #8fb2dd;
  border-radius: 10px;
  padding: 10px;
  color: #24415f;
  background: #f4f8ff;
  cursor: pointer;
}

.transfer-upload-card input {
  display: none;
}

.transfer-upload-card strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
}

.transfer-upload-card span {
  color: #55708e;
  font-size: 0.76rem;
  font-weight: 800;
}

.transfer-upload-card.has-file {
  border-style: solid;
  border-color: #23a26d;
  background: #eefbf5;
}

.status-danger {
  color: #d84a32;
  font-weight: 800;
}

.user-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.user-status.active {
  color: #0d6936;
  background: #dff7e9;
}

.user-status.inactive {
  color: #a13a2d;
  background: #ffe4df;
}

.user-status.loss {
  color: #ffffff;
  background: linear-gradient(135deg, #b42318, #dc2626);
}

.cash-panel {
  display: grid;
  gap: 16px;
}

#cashContent {
  display: grid;
  gap: 18px;
}

.cash-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.cash-form,
.cash-current-card,
.cash-note,
.cash-history-panel {
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #fbfdff;
}

.cash-form {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.cash-form h3,
.cash-history-head h3 {
  margin: 0;
  color: #172334;
  font-size: 1.05rem;
}

.cash-form label {
  display: grid;
  gap: 6px;
  color: #556273;
  font-size: 0.82rem;
  font-weight: 800;
}

.cash-form input,
.cash-form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #ccd8e5;
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  background: #ffffff;
}

.cash-form textarea {
  min-height: 76px;
  resize: vertical;
}

.cash-current-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.cash-current-card > div:first-child,
.cash-note {
  display: grid;
  gap: 4px;
}

.cash-current-card span,
.cash-note span,
.cash-history-head p {
  color: var(--muted);
  font-size: 0.84rem;
}

.cash-current-card strong {
  color: #172334;
  font-size: 1.2rem;
}

.cash-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cash-summary-grid article {
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.cash-summary-grid article span {
  display: block;
  margin-bottom: 5px;
  color: #667486;
  font-size: 0.74rem;
  font-weight: 800;
}

.cash-summary-grid article strong {
  display: block;
  font-size: 1rem;
}

.cash-note {
  padding: 16px;
}

.cash-difference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8e4ef;
  border-radius: 8px;
  padding: 10px 12px;
  color: #175333;
  background: #eefbf3;
}

.cash-difference.negative {
  color: #a13a2d;
  background: #fff0ed;
}

.cash-history-panel {
  padding: 16px;
}

.cash-history-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.cash-history-search {
  margin: 0;
}

.quick-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 54px;
  border: 0;
  color: #111111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  background: transparent;
}

.quick-actions small {
  display: block;
  font-size: 1rem;
  text-align: left;
}

.quick-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid #0b2b68;
  border-radius: 15px;
  color: #0b2b68;
  font-family: Inter, Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.quick-icon i {
  font-size: 1.15rem;
  line-height: 1;
}

.content-grid,
.pos-layout {
  display: grid;
  gap: 18px;
}

.sales-mode-switch {
  display: flex;
  gap: 8px;
  width: fit-content;
  margin-bottom: 12px;
  padding: 6px;
  border: 1px solid #cfd8e4;
  border-radius: 999px;
  background: #f4f8ff;
}

.cart-action-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  padding: 5px;
  border: 1px solid #cfd8e4;
  border-radius: 8px;
  background: #f4f8ff;
}

.mode-switch-btn {
  min-height: 36px;
  min-width: 150px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #345172;
  font-size: 0.9rem;
  font-weight: 700;
  background: transparent;
}

.cart-action-mode .mode-switch-btn {
  min-width: 0;
  width: 100%;
  border-radius: 7px;
  font-size: 0.82rem;
}

.cart-action-mode-header {
  width: min(100%, 280px);
}

.mode-switch-btn i {
  margin-right: 7px;
}

.mode-switch-btn.active {
  color: #ffffff;
  border-color: #1f62d2;
  background: linear-gradient(90deg, #1f67dd, #2d89ff);
}

.two-col {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}

.pos-layout {
  grid-template-columns: minmax(0, 1.35fr) 380px;
  align-items: start;
}

.pos-touch-view .checkout-panel {
  margin-top: 14px;
}

.touch-customer-box {
  margin: 6px 0 12px;
  border: 1px solid #d3d9e1;
  border-radius: 10px;
  background: #f6f8fb;
  overflow: hidden;
}

.touch-customer-head {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  background: #2f7e4f;
}

.pos-default-view {
  display: grid;
  gap: 10px;
}

.default-search-results {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.default-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #d6dbe3;
  border-radius: 8px;
  text-align: left;
  background: #ffffff;
}

.default-search-item small {
  display: block;
  color: #6e7782;
  font-size: 0.76rem;
}

.default-sale-panel {
  border: 1px solid #d4dbe4;
  border-radius: 12px;
  background: #ffffff;
}

.default-sale-table thead th {
  color: #ffffff;
  background: #1d1d1f;
}

.default-sale-table tbody td {
  border-bottom-color: #d8dce2;
}

.default-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.default-qty-control button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  color: #ffffff;
  background: #2575e6;
}

.default-delete-btn {
  border: 0;
  color: #e04f4f;
  background: transparent;
}

.default-sale-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
  margin-top: 12px;
}

.default-left-stack {
  display: grid;
  gap: 10px;
}

.default-observation-box {
  display: grid;
  gap: 8px;
  color: #41556f;
  font-size: 0.82rem;
  font-weight: 700;
}

.default-observation-box textarea {
  min-height: 72px;
  border: 1px solid #d2d9e3;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
}

.default-customer-box {
  border: 1px solid #d3d9e1;
  border-radius: 10px;
  background: #f6f8fb;
  overflow: hidden;
}

.default-customer-head {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  background: #5d9f44;
}

.default-customer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 10px;
}

.default-customer-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 10px 10px 0;
}

.default-customer-search {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 38px;
  border: 1px solid #d1d8e3;
  border-radius: 8px;
  background: #ffffff;
}

.default-customer-search i {
  color: #69809a;
  text-align: center;
}

.default-customer-search input {
  border: 0;
  min-height: 36px;
  background: transparent;
}

.default-customer-search input:focus {
  outline: none;
}

.default-customer-search-results {
  display: grid;
  gap: 6px;
  max-height: 156px;
  margin: 8px 10px 0;
  overflow: auto;
}

.default-customer-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #d6dde8;
  border-radius: 7px;
  text-align: left;
  background: #ffffff;
}

.default-customer-result small {
  color: #748194;
  font-size: 0.74rem;
}

.default-customer-result.active {
  border-color: #1c67d8;
  background: #eaf2ff;
}

.default-customer-grid span {
  display: block;
  color: #6f7a87;
  font-size: 0.72rem;
}

.default-customer-grid label {
  display: grid;
  gap: 2px;
}

.default-customer-input {
  width: 100%;
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #182232;
  font-size: 0.82rem;
  padding: 0;
  outline: none;
  box-shadow: none;
}

.default-customer-input::placeholder {
  color: #6f7a87;
}

.default-customer-input:focus {
  outline: none;
  box-shadow: none;
}

.default-customer-register-btn {
  min-height: 38px;
  padding: 0 10px;
  white-space: nowrap;
}

.inline-number {
  min-height: 32px;
  width: 86px;
  border: 0;
  border-radius: 0;
  padding: 0 8px;
  text-align: center;
  background: transparent;
  appearance: textfield;
  outline: none;
  box-shadow: none;
}

.inline-number:focus {
  outline: none;
  box-shadow: none;
}

.inline-number::-webkit-outer-spin-button,
.inline-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-control-inputs {
  align-items: flex-end;
}

.qty-control-inputs label {
  display: grid;
  gap: 4px;
  color: #6f7f94;
  font-size: 0.72rem;
  font-weight: 700;
}

.default-summary-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border: 1px solid #d6dbe3;
  border-radius: 10px;
  background: #fafafa;
}

.default-summary-card label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.default-summary-card label input {
  min-height: 36px;
  max-width: 86px;
  border: 1px solid #ccd5e2;
  border-radius: 8px;
  padding: 0 10px;
  text-align: right;
  background: #ffffff;
}

.default-summary-card .tax-declare-check,
.totals .tax-declare-check {
  padding: 8px 10px;
  border: 1px solid #d6e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.tax-declare-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

body.theme-dark {
  --bg: #111827;
  --surface: #151c29;
  --surface-soft: #1a2333;
  --ink: #ecf1f8;
  --muted: #9db0c8;
  --line: #28364a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

body.theme-dark .topbar,
body.theme-dark .panel,
body.theme-dark .profile-menu,
body.theme-dark .default-sale-panel,
body.theme-dark .products-form-panel,
body.theme-dark .inventory-panel,
body.theme-dark .admin-action,
body.theme-dark .admin-form,
body.theme-dark .admin-insights section,
body.theme-dark .admin-chart-box,
body.theme-dark .admin-category-list,
body.theme-dark .admin-record-search,
body.theme-dark .default-summary-card,
body.theme-dark .default-customer-box,
body.theme-dark .cart-row,
body.theme-dark .notification-menu,
body.theme-dark .notification-item,
body.theme-dark .sales-search-wrap,
body.theme-dark .inventory-search,
body.theme-dark .global-search,
body.theme-dark .global-search-results,
body.theme-dark .settings-card,
body.theme-dark .report-card,
body.theme-dark .company-logo-preview,
body.theme-dark .tax-settings-box,
body.theme-dark .secondary-button,
body.theme-dark .tax-declare-check {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

body.theme-dark .report-card {
  background:
    linear-gradient(180deg, rgba(42, 121, 237, 0.16), rgba(21, 28, 41, 0) 48%),
    var(--surface);
}

body.theme-dark .report-card h3 {
  color: var(--ink);
}

body.theme-dark .report-chip {
  color: #d7e8ff;
  border-color: #2b4d7c;
  background: #142947;
}

body.theme-dark .report-card-meta {
  border-top-color: var(--line);
}

body.theme-dark .global-search-results button {
  color: var(--ink);
  background: var(--surface);
}

body.theme-dark .global-search-results button:hover {
  background: #1b2536;
}

body.theme-dark .notification-item:hover,
body.theme-dark .notification-item.unread {
  background: #162235;
}

body.theme-dark .transfer-detail-grid div,
body.theme-dark .transfer-upload-card {
  border-color: var(--line);
  color: var(--ink);
  background: #111a29;
}

body.theme-dark .table-wrap table th {
  background: #1b2536;
}

body.theme-dark .default-sale-table thead th {
  background: #0f1725;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .theme-option,
body.theme-dark .default-search-item,
body.theme-dark .default-customer-result,
body.theme-dark .default-customer-input,
body.theme-dark .inline-number {
  border-color: var(--line);
  color: var(--ink);
  background: #111a29;
}

body.theme-dark .default-customer-input {
  border-color: transparent;
  background: transparent;
}

body.theme-dark .theme-option.active {
  color: #ffffff;
  background: linear-gradient(90deg, #2459b8, #2b76e3);
}

body.theme-dark .mode-switch-btn {
  color: #b7c8df;
}

body.theme-dark .mode-switch-btn.active {
  color: #ffffff;
}

body.theme-dark .admin-action.active {
  color: #ffffff;
  background: #2459b8;
}

body.theme-dark .admin-chart-box canvas {
  background: #111a29;
}

body.theme-dark .sales-mode-switch {
  border-color: #2c3b53;
  background: #141f30;
}

body.theme-dark .cart-action-mode {
  border-color: #2c3b53;
  background: #141f30;
}

body.theme-dark .default-customer-head {
  background: #3f7d31;
}

body.theme-dark .touch-customer-box {
  border-color: var(--line);
  background: var(--surface);
}

body.theme-dark .touch-customer-head {
  background: #2f8f4d;
}

body.theme-dark .sidebar-toggle-btn {
  border-color: #2e3a50;
  color: #d0def2;
  background: #142033;
}

.search-input,
.form-grid input,
.form-grid select,
.field input,
.field select,
.totals input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.search-input {
  max-width: 280px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.sales-head {
  margin-bottom: 10px;
}

.sales-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.35rem;
}

.sales-search-wrap {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 10px;
  border: 1px solid #d8dce1;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.sales-search-wrap i {
  color: #6a7680;
  font-size: 1.25rem;
}

.sales-search-input {
  max-width: none;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.sales-search-input:focus {
  outline: 0;
}

.tax-input-clean {
  min-height: 32px !important;
  max-width: 64px;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  text-align: center;
  background: transparent !important;
  appearance: textfield;
  outline: none;
  box-shadow: none !important;
}

.tax-input-clean:focus {
  outline: none;
  box-shadow: none !important;
}

.tax-input-clean::-webkit-outer-spin-button,
.tax-input-clean::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sales-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.category-chip {
  min-height: 40px;
  border: 1px solid #d4d9df;
  border-radius: 14px;
  padding: 0 16px;
  color: #3b4651;
  font-size: 1rem;
  background: #ffffff;
}

.category-chip.active {
  color: #ffffff;
  border-color: #2379f1;
  background: #2379f1;
}

.product-card {
  display: grid;
  gap: 8px;
  min-height: 200px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.product-card:hover {
  border-color: #9eb8d4;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.product-card:focus-visible {
  outline: 2px solid #2b76df;
  outline-offset: 2px;
}

.product-card.out-of-stock {
  cursor: not-allowed;
  opacity: 0.74;
  transform: none;
}

.product-card.out-of-stock:hover {
  border-color: var(--line);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.product-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.catalog-price {
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 1.24rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  color: #0f172a;
}

.catalog-brand {
  color: #2f6db2;
  font-size: 0.78rem;
  font-weight: 700;
}

.product-thumb {
  display: grid;
  min-height: 70px;
  place-items: center;
}

.product-photo {
  width: 100%;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
}

.product-thumb i {
  color: #2f6db2;
  font-size: 2.7rem;
}

.product-thumb i.is-hidden,
.cart-icon i.is-hidden,
.product-photo.is-hidden {
  display: none;
}

.product-card h3 {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.2;
}

.product-meta,
.stock-pill {
  color: var(--muted);
  font-size: 0.8rem;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 800;
}

.stock-pill.low {
  color: #ffffff;
  font-weight: 700;
  background: #f15454;
}

.stock-pill {
  justify-self: start;
  border-radius: 8px;
  padding: 2px 8px;
  color: #0c8b49;
  font-size: 0.76rem;
  font-weight: 700;
  background: #bff5d6;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.cart-items {
  display: grid;
  gap: 10px;
  min-height: 120px;
  margin-bottom: 14px;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.cart-row strong {
  display: block;
}

.cart-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #d5dce5;
  border-radius: 10px;
  color: #2f6db2;
  background: #ffffff;
}

.cart-icon i {
  font-size: 1.35rem;
}

.cart-icon .product-photo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-control button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
}

.totals {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.totals label,
.total-line,
.grand-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.totals label span,
.total-line span {
  color: var(--muted);
  font-weight: 700;
}

.totals input {
  max-width: 90px;
}

.grand-total {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1.2rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.products-view .two-col {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.28fr);
  gap: 16px;
}

.products-form-panel,
.inventory-panel {
  border: 1px solid #d7e0ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(16, 33, 61, 0.08);
}

.product-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  margin-bottom: 0;
}

.form-field > span {
  color: #41556f;
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.product-form-grid input,
.product-form-grid select {
  min-height: 40px;
  border: 1px solid #cfd9e6;
  border-radius: 10px;
  background: #fdfefe;
}

.product-form-grid input:focus,
.product-form-grid select:focus {
  border-color: #2b76df;
  box-shadow: 0 0 0 2px rgba(43, 118, 223, 0.14);
  outline: none;
}

.inventory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.inventory-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #c5d5ea;
  border-radius: 999px;
  color: #12365d;
  font-size: 0.8rem;
  font-weight: 700;
  background: #edf5ff;
}

.inventory-chip.warning {
  border-color: #f0c58b;
  color: #8f4d00;
  background: #fff6e9;
}

.inventory-chip strong {
  font-size: 0.9rem;
}

.inventory-toolbar {
  margin: -4px 0 10px;
}

.inventory-toolbar-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.inventory-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-actions .primary-button,
.inventory-actions .ghost-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.inventory-search {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #d4deea;
  border-radius: 10px;
  background: #f9fbff;
}

.inventory-search i {
  color: #667c97;
  font-size: 1rem;
}

.inventory-search input {
  min-height: 40px;
  border: 0;
  color: #14263b;
  background: transparent;
}

.inventory-search input:focus {
  outline: none;
}

.inventory-panel table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7fc;
}

.inventory-panel table tbody tr:hover {
  background: #f8fbff;
}

.inventory-panel .tiny-button {
  min-height: 32px;
  border-radius: 8px;
}

.inventory-panel .tiny-button:not(.danger) {
  color: #0a4a91;
  border-color: #b9d2f2;
  background: #ecf5ff;
}

.products-crud-panel {
  min-height: 520px;
}

.image-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.image-source-row .ghost-button {
  min-height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.file-button {
  cursor: pointer;
  position: relative;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.product-image-preview {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed #bfc7d2;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.product-image-preview img {
  width: 100%;
  height: 178px;
  object-fit: contain;
}

.product-image-preview .empty {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 34px 20px;
  background: rgba(7, 15, 35, 0.48);
}

.payment-modal.open {
  display: flex;
}

.payment-modal-card {
  width: min(460px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.28);
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.product-edit-card {
  width: min(760px, 100%);
}

#productEditModal {
  align-items: flex-start;
  padding-top: 108px;
}

#productEditModal .product-edit-card {
  max-height: calc(100vh - 128px);
}

.product-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.payment-cash-fields {
  display: grid;
  gap: 10px;
}

.payment-customer-results {
  display: grid;
  gap: 6px;
  max-height: 160px;
  margin-top: -4px;
  margin-bottom: 10px;
  overflow: auto;
}

.payment-customer-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
}

.payment-customer-option small {
  color: var(--muted);
  font-size: 0.74rem;
}

.payment-customer-option:hover {
  border-color: #98afd0;
  background: #f5f8fd;
}

.payment-customer-option.active {
  border-color: #0b2b68;
  color: #0b2b68;
  background: #ecf3ff;
}

.payment-selected-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.payment-selected-row span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.payment-selected-row strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.payment-cash-fields.hidden {
  display: none;
}

.payment-summary {
  display: grid;
  gap: 6px;
  margin: 14px 0 16px;
}

.payment-summary small {
  color: var(--muted);
  font-size: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tiny-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
}

.danger {
  color: var(--danger);
}

.rank-list,
.alert-list,
.customer-list,
.stack {
  display: grid;
  gap: 10px;
}

.rank-item,
.alert-item,
.customer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.alert-item strong {
  color: var(--danger);
}

.file-drop {
  display: grid;
  min-height: 96px;
  place-items: center;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  color: var(--primary);
  font-weight: 800;
  background: #edf8f6;
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.settings-panel {
  overflow: visible;
}

.settings-actions {
  margin-bottom: 18px;
}

.settings-content {
  display: grid;
  gap: 18px;
}

.settings-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.settings-card[hidden] {
  display: none !important;
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.settings-card-head > i {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
}

.settings-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.settings-card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.company-settings-form {
  display: grid;
  gap: 18px;
}

.company-logo-uploader {
  display: grid;
  grid-template-columns: 160px auto;
  gap: 10px 16px;
  align-items: center;
}

.company-logo-preview {
  display: grid;
  width: 160px;
  min-height: 86px;
  place-items: center;
  grid-row: span 3;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.company-logo-preview img {
  max-width: 100%;
  max-height: 86px;
  object-fit: contain;
}

.company-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.company-wide-field {
  grid-column: 1 / -1;
}

.tax-settings-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9e4f2;
  border-radius: 10px;
  background: #f7fbff;
}

.cai-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cai-summary article {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #d1deec;
  border-radius: 10px;
  background: #ffffff;
}

.cai-summary span {
  color: #5d6b7c;
  font-size: 0.76rem;
  font-weight: 800;
}

.cai-summary strong {
  color: #16283d;
  font-size: 1rem;
}

.cai-preview-box {
  display: grid;
  gap: 10px;
}

.cai-preview-box .ghost-button {
  justify-self: start;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cai-preview-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px dashed #b7c9df;
  border-radius: 10px;
  background: #ffffff;
}

.cai-preview-list span {
  min-height: 30px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #edf2f7;
  color: #1a2b3e;
  font-weight: 800;
}

.cai-preview-list span:last-child {
  border-bottom: 0;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.settings-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.reports-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.report-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 232px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(42, 121, 237, 0.08), rgba(255, 255, 255, 0) 44%),
    #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.09);
  overflow: hidden;
}

.report-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #2a79ed, #15b59f, #f6b84b);
}

.report-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-card-icon,
.report-chart-card i {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b2b68, #2a79ed);
  box-shadow: 0 10px 22px rgba(42, 121, 237, 0.28);
  font-size: 1.25rem;
}

.report-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cddcf0;
  border-radius: 999px;
  color: #0b2b68;
  font-size: 0.75rem;
  font-weight: 900;
  background: #eef6ff;
}

.report-card-body {
  min-height: 86px;
}

.report-card h3 {
  margin: 0;
  color: #111827;
  font-size: 1.08rem;
  line-height: 1.25;
}

.report-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.report-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #e4eaf2;
}

.report-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 800;
}

.report-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.report-card-actions .primary-button,
.report-card-actions .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
}

.reports-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.report-chart-card {
  grid-template-columns: 1fr;
}

.report-chart-card > div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.report-chart-card canvas {
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
}

.reports-invoices-layout {
  display: grid;
  gap: 16px;
}

.invoice-bulk-card,
.invoice-list-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--modern-line, #dbe5f1);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.1), rgba(255, 255, 255, 0) 46%),
    #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.invoice-bulk-card::before,
.invoice-list-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #14b8a6, #f59e0b);
}

.invoice-bulk-head,
.invoice-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.invoice-bulk-head {
  justify-content: flex-start;
}

.invoice-bulk-head h3,
.invoice-list-head h3 {
  margin: 0;
  color: var(--modern-ink, #111827);
  font-size: 1.12rem;
}

.invoice-bulk-head p,
.invoice-list-head p {
  margin: 5px 0 0;
  color: var(--modern-muted, #667085);
  font-size: 0.86rem;
}

.invoice-range-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.invoice-range-mode label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #d4e1f0;
  border-radius: 12px;
  color: #1d3557;
  font-size: 0.86rem;
  font-weight: 800;
  background: #f8fbff;
}

.invoice-range-mode input {
  width: 17px;
  height: 17px;
  accent-color: var(--modern-primary, #2563eb);
}

.invoice-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.invoice-range-grid .field {
  margin-bottom: 0;
}

.invoice-bulk-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invoice-bulk-summary span,
.invoice-tax-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d8e4f2;
  border-radius: 999px;
  color: #31506f;
  font-size: 0.76rem;
  font-weight: 800;
  background: #f5f9ff;
}

.invoice-bulk-summary strong {
  margin-left: 5px;
  color: #0f2742;
}

.invoice-bulk-button {
  justify-self: start;
  min-height: 48px;
  padding-inline: 18px;
  font-weight: 900;
}

.invoice-search {
  margin-bottom: 0;
}

.report-invoices-table {
  border-radius: 14px;
}

.report-invoices-table small {
  color: #667085;
  font-size: 0.74rem;
  font-weight: 700;
}

.invoice-tax-pill {
  min-height: 26px;
  border-color: #e6dfc5;
  color: #7a4a06;
  background: #fff8e7;
}

.invoice-tax-pill.declared {
  border-color: #bde7d8;
  color: #0b6b47;
  background: #ebfff6;
}

.invoice-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(126px, 1fr));
  gap: 8px;
  min-width: 268px;
}

.invoice-row-actions .action-icon-button {
  min-height: 34px;
}

.category-row-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.category-row-actions .action-icon-button {
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding-inline: 10px;
}

.inventory-toolbar-actions.returns-toolbar {
  grid-template-columns: minmax(220px, 0.7fr) auto;
}

.returns-toolbar .inventory-search {
  max-width: 520px;
}

.return-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(126px, 1fr));
  gap: 8px;
  min-width: 276px;
}

.return-row-actions .user-status {
  grid-column: 1 / -1;
  justify-self: end;
}

#downloadCancelledReturnsInvoicesBtn {
  min-height: 42px;
  padding-inline: 14px;
  font-weight: 900;
  background: linear-gradient(135deg, #0b2b68, #2563eb);
}

.disabled-section {
  opacity: 0.55;
}

.disabled-section input {
  cursor: not-allowed;
}

.receipt-actions {
  display: flex;
  justify-content: flex-end;
}

.receipt-print-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding-inline: 16px;
  font-weight: 900;
  background: linear-gradient(135deg, #0b2b68, #2563eb);
}

.receipt-body {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: #132326;
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.field-error,
.field input.field-error,
.field select.field-error,
.field textarea.field-error,
input.field-error,
select.field-error,
textarea.field-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfd;
}

@media (max-width: 1050px) {
  .app-shell,
  .pos-layout,
  .two-col,
  .metrics-grid,
  .admin-overview-grid,
  .admin-insights,
  .admin-workspace,
  .admin-loss-summary,
  .admin-chart-layout {
    grid-template-columns: 1fr;
  }

  .settings-content,
  .company-logo-uploader,
  .company-form-grid,
  .cai-summary,
  .reports-download-grid,
  .reports-chart-grid {
    grid-template-columns: 1fr;
  }

  .company-wide-field {
    grid-column: auto;
  }

  .dashboard-grid,
  .dashboard-comparison-summary,
  .action-grid,
  .cancellation-action-grid,
  .cash-workspace,
  .cash-history-head {
    grid-template-columns: 1fr;
  }

  .cash-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .administration-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .default-sale-bottom,
  .default-customer-grid {
    grid-template-columns: 1fr;
  }

  .default-customer-search-row {
    grid-template-columns: 1fr;
  }

  .inventory-toolbar-actions {
    grid-template-columns: 1fr;
  }

  .inventory-actions {
    flex-wrap: wrap;
  }

  .global-search,
  .transfer-approval-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .sidebar-toggle-btn {
    display: none;
  }

  .topbar-left .date-block {
    margin-left: 0;
    margin-right: 0;
  }

  .global-search {
    margin-left: 0;
  }
}

@media (min-width: 1024px) {
  .auth-screen {
    padding: 32px;
  }

  .login-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }

  .brand-section {
    gap: 64px;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .image-wrapper {
    max-width: 480px;
  }

  .form-section {
    padding-left: 24px;
  }

  .form-header {
    text-align: left;
  }
}

@media (max-width: 680px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .auth-screen {
    align-items: flex-start;
    padding: 22px;
  }

  .login-container {
    gap: 28px;
  }

  .brand-section {
    gap: 32px;
  }

  .login-logo-img {
    width: min(330px, 100%);
  }

  .hero-text h1 {
    font-size: 2.15rem;
  }

  .image-wrapper {
    max-width: 260px;
  }

  .form-header {
    margin-bottom: 26px;
  }

  .form-header h2 {
    font-size: 2rem;
  }

  .topbar,
  .topbar-left,
  .topbar-actions,
  .administration-header,
  .panel-header.compact,
  .rank-item,
  .alert-item,
  .customer-item {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

  .administration-view {
    padding: 18px;
  }

  .administration-actions {
    grid-template-columns: 1fr 1fr;
  }

  .admin-action {
    min-height: 64px;
  }

  .administration-summary {
    justify-content: stretch;
  }

  .administration-summary span {
    flex: 1 1 100%;
  }

  .search-input {
    max-width: none;
  }

  .global-search {
    width: 100%;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    background: #f6f8fb;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
    background: #f6f8fb;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 80;
    height: auto;
    max-height: 46vh;
    padding: 10px 10px 12px;
    overflow-y: auto;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 12px 24px rgba(11, 43, 104, 0.22);
  }

  .dashboard-brand {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-item {
    grid-template-columns: 26px minmax(0, 1fr);
    min-height: 42px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.1;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 0.78rem;
  }

  .main {
    min-width: 0;
    padding: 0 10px 18px;
  }

  .view.active,
  .view.active > *,
  .panel,
  .panel > *,
  .panel-header,
  .panel-header > *,
  .inventory-header,
  .inventory-header > *,
  .inventory-metrics,
  #cashContent,
  .stack {
    max-width: 100%;
    min-width: 0;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-height: 0;
    margin: 0 -10px 10px;
    padding: 10px;
    box-shadow: 0 8px 18px rgba(16, 33, 61, 0.12);
  }

  .topbar-left,
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-left .date-block {
    margin-left: 0;
  }

  .date-block {
    font-size: 0.95rem;
  }

  .date-block span {
    font-size: 0.78rem;
  }

  .notification-button {
    display: none;
  }

  .user-chip {
    width: 100%;
    justify-content: flex-end;
    font-size: 1rem;
  }

  .profile-menu {
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }

  #dashboard,
  .administration-view {
    padding: 12px 0 0;
  }

  .dashboard-title,
  .sales-head h2 {
    font-size: 1.7rem;
    line-height: 1.15;
  }

  .metrics-grid,
  .dashboard-grid,
  .dashboard-comparison-summary,
  .admin-overview-grid,
  .admin-insights,
  .admin-workspace,
  .admin-chart-layout,
  .cash-workspace,
  .cash-history-head {
    grid-template-columns: 1fr;
  }

  .metric,
  .panel,
  .inventory-panel,
  .default-sale-panel,
  .checkout-panel,
  .catalog-panel {
    border-radius: 10px;
  }

  .panel,
  .inventory-panel,
  .default-sale-panel,
  .checkout-panel,
  .catalog-panel {
    padding: 12px;
  }

  .panel-header,
  .panel-header.compact,
  .inventory-header,
  .administration-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-panel-header,
  .inventory-header {
    align-items: flex-start;
  }

  .inventory-metrics,
  .administration-summary {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  .inventory-chip,
  .administration-summary span {
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .pos-layout {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .pos-layout > *,
  .pos-default-view,
  .pos-touch-view,
  .catalog-panel,
  .checkout-panel,
  .default-sale-panel,
  .default-left-stack,
  .default-summary-card,
  .touch-customer-box,
  .default-customer-box,
  .cart-action-mode,
  .cart-items,
  .totals {
    max-width: 100%;
    min-width: 0;
  }

  .sales-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin-bottom: 10px;
    border-radius: 10px;
  }

  .sales-mode-switch .mode-switch-btn,
  .cart-action-mode .mode-switch-btn {
    min-width: 0;
    min-height: 40px;
    border-radius: 8px;
    font-size: 0.84rem;
  }

  .sales-search-wrap {
    min-height: 44px;
    margin-bottom: 10px;
    border-radius: 10px;
  }

  .catalog-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .product-card {
    min-height: 156px;
    padding: 8px;
    gap: 6px;
    border-radius: 10px;
  }

  .product-thumb {
    min-height: 78px;
  }

  .product-card h3 {
    font-size: 0.86rem;
    line-height: 1.18;
  }

  .catalog-price,
  .stock-pill {
    font-size: 0.78rem;
  }

  .sales-categories {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 -2px 10px;
    padding: 0 2px 4px;
    overflow-x: auto;
  }

  .category-chip {
    flex: 0 0 auto;
    min-height: 36px;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .pos-touch-view .checkout-panel {
    margin-top: 0;
  }

  .checkout-panel {
    position: static;
  }

  .cart-action-mode,
  .cart-action-mode-header {
    width: 100%;
    max-width: none;
  }

  .touch-customer-box,
  .default-customer-box {
    border-radius: 8px;
  }

  .default-customer-search-row {
    grid-template-columns: 1fr;
    margin: 8px 8px 0;
  }

  .default-customer-search,
  .default-customer-register-btn {
    width: 100%;
  }

  .default-customer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }

  .default-customer-grid span {
    font-size: 0.68rem;
  }

  .default-customer-input {
    font-size: 0.78rem;
  }

  .cart-items {
    max-height: 38vh;
    overflow-y: auto;
  }

  .cart-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cart-row-main {
    min-width: 0;
  }

  .cart-row-main strong,
  .cart-row-main span {
    overflow-wrap: anywhere;
  }

  .qty-control-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .inline-number {
    width: 100%;
  }

  .totals {
    gap: 8px;
  }

  .total-line,
  .grand-total {
    min-height: 34px;
  }

  .primary-button.full,
  .ghost-button.full {
    min-height: 44px;
  }

  .default-sale-bottom,
  .default-customer-grid,
  .image-source-row,
  .inventory-toolbar-actions,
  .action-grid,
  .cancellation-action-grid {
    grid-template-columns: 1fr;
  }

  .default-summary-card {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 0 -12px -12px;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -10px 24px rgba(16, 33, 61, 0.12);
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 680px;
  }

  .default-sale-table {
    min-width: 760px;
  }

  .inventory-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .inventory-actions .primary-button,
  .inventory-actions .ghost-button {
    justify-content: center;
    width: 100%;
    white-space: normal;
  }

  .administration-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-action {
    min-height: 58px;
    padding: 8px;
    font-size: 0.82rem;
  }

  .admin-form,
  .admin-record-search,
  .cash-form,
  .cash-current-card,
  .cash-history-panel {
    padding: 12px;
  }

  .cash-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #cashContent {
    grid-template-columns: minmax(0, 1fr);
  }

  .cash-current-card,
  .cash-current-card > *,
  .cash-summary-grid,
  .cash-summary-grid article {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .cash-current-card strong,
  .cash-current-card span,
  .cash-current-card small,
  .cash-summary-grid article strong,
  .cash-summary-grid article span {
    overflow-wrap: anywhere;
  }

  .dashboard-action-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: 82vh;
  }

  .action-item,
  .cancellation-item,
  .quote-action-item {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .action-item-actions {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }

  .payment-modal {
    align-items: flex-end;
    padding: 10px;
  }

  .payment-modal-card {
    width: 100%;
    max-width: none;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 14px;
  }
}

/* Encabezado superior moderno */
.topbar {
  min-height: 78px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(219, 229, 241, 0.9);
  color: var(--modern-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.86));
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-actions {
  gap: 14px;
}

.topbar-left .date-block {
  margin-left: 10px;
  margin-right: 0;
}

.date-block {
  min-width: 238px;
  gap: 2px;
  padding: 8px 14px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
  font-size: 0.9rem;
  background:
    linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.date-block span {
  color: var(--modern-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.date-block strong {
  color: var(--modern-ink);
  font-size: 0.98rem;
  font-weight: 800;
}

.global-search {
  min-height: 46px;
  margin-left: 0;
  grid-template-columns: 22px minmax(230px, 390px);
  border-color: #cddcf0;
  border-radius: 15px;
  background:
    linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.global-search i {
  color: var(--modern-primary);
}

.global-search input {
  color: var(--modern-ink);
  font-weight: 700;
}

.global-search input::placeholder {
  color: #8ba0b8;
  font-weight: 700;
}

.notification-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  color: #0b2b68;
  background:
    linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease;
}

.notification-button:hover {
  color: var(--modern-primary);
  border-color: #bcd3f8;
  transform: translateY(-1px);
}

.notification-button i {
  font-size: 1.25rem;
}

.notification-badge {
  right: -3px;
  top: -3px;
  border-color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.user-chip {
  min-height: 50px;
  padding: 5px 8px 5px 6px;
  border: 1px solid #dbe5f1;
  border-radius: 16px;
  color: var(--modern-ink);
  font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
  font-size: 0.98rem;
  background:
    linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.user-chip:hover {
  border-color: #bcd3f8;
}

.user-chip strong {
  font-size: 1rem;
  font-weight: 800;
}

.user-chip small {
  color: var(--modern-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.avatar-shape {
  width: 40px;
  height: 40px;
  background:
    linear-gradient(135deg, #0b2b68, var(--modern-primary));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.avatar-shape:not(.has-photo)::before {
  left: 14px;
  top: 8px;
  width: 12px;
  height: 12px;
}

.avatar-shape:not(.has-photo)::after {
  left: 9px;
  bottom: 8px;
  width: 22px;
  height: 12px;
}

.chevron {
  color: var(--modern-muted);
  font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
  font-size: 1rem;
}

body.theme-dark .topbar,
body.theme-dark .date-block,
body.theme-dark .global-search,
body.theme-dark .notification-button,
body.theme-dark .user-chip {
  border-color: var(--line);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(21, 28, 41, 0.98), rgba(17, 26, 41, 0.9));
}

body.theme-dark .date-block strong,
body.theme-dark .user-chip strong,
body.theme-dark .global-search input {
  color: var(--ink);
}

@media (max-width: 760px) {
  .topbar {
    min-height: auto;
    padding: 10px;
  }

  .topbar-left .date-block,
  .global-search {
    margin-left: 0;
  }

  .date-block {
    min-width: 0;
  }
}

@media (max-width: 360px) {
  .nav-list,
  .catalog-grid,
  .default-customer-grid,
  .administration-actions {
    grid-template-columns: 1fr;
  }

  .cart-action-mode,
  .sales-mode-switch {
    grid-template-columns: 1fr;
  }

  .product-card {
    min-height: 138px;
  }

  .product-thumb {
    min-height: 66px;
  }
}

/* Modernizacion visual global */
:root {
  --modern-primary: #2563eb;
  --modern-primary-dark: #1746b8;
  --modern-teal: #14b8a6;
  --modern-amber: #f59e0b;
  --modern-surface: #ffffff;
  --modern-soft: #f6f8fc;
  --modern-line: #dbe5f1;
  --modern-ink: #111827;
  --modern-muted: #64748b;
  --modern-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

body,
button,
input,
select,
textarea {
  font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
  letter-spacing: 0;
}

body {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 32rem),
    linear-gradient(180deg, #f7faff, #eef4f8);
}

.dashboard-title,
.administration-header h2,
.sales-head h2,
.panel-header h2,
.settings-card-head h3,
.report-card h3 {
  font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

.dashboard-title {
  color: var(--modern-ink);
  font-size: clamp(2rem, 3.2vw, 2.9rem);
}

.panel,
.inventory-panel,
.default-sale-panel,
.checkout-panel,
.catalog-panel,
.settings-card,
.admin-form,
.admin-insights section,
.admin-chart-box,
.admin-category-list,
.payment-modal-card {
  border-color: var(--modern-line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
    var(--modern-surface);
  box-shadow: var(--modern-shadow);
}

.panel-header h2,
.settings-card-head h3,
.inventory-header h2,
.administration-header h2 {
  color: var(--modern-ink);
}

.panel-header p,
.settings-card-head p,
.inventory-header p {
  color: var(--modern-muted);
}

.primary-button,
.ghost-button,
.secondary-button,
.tiny-button,
.mode-switch-btn,
.admin-action,
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-button,
.submit-btn {
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #ffffff;
  background: linear-gradient(135deg, var(--modern-primary), #1d8cff);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.primary-button:hover,
.submit-btn:hover {
  background: linear-gradient(135deg, var(--modern-primary-dark), #1665d8);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

.ghost-button,
.secondary-button,
.tiny-button {
  border: 1px solid var(--modern-line);
  color: #1e3a5f;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.ghost-button:hover,
.secondary-button:hover,
.tiny-button:hover {
  border-color: #b7c9e3;
  color: var(--modern-primary);
  transform: translateY(-1px);
}

.icon-button {
  border-radius: 11px;
  color: #b42318;
  background: #fff1f0;
}

.mode-switch-btn.active,
.admin-action.active {
  color: #ffffff;
  border-color: rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, #0b2b68, var(--modern-primary));
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.26);
}

.quick-actions {
  padding: 10px 12px;
  border: 1px solid rgba(219, 229, 241, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.quick-actions button {
  min-height: 50px;
  border-radius: 12px;
  font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
}

.quick-actions button:hover {
  color: var(--modern-primary);
  background: #f4f8ff;
}

.quick-icon {
  border-color: #bcd3f8;
  color: var(--modern-primary);
  background: linear-gradient(180deg, #ffffff, #edf5ff);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.metric {
  border-radius: 18px;
  box-shadow: 0 15px 32px rgba(15, 23, 42, 0.11);
}

.metric span,
.metric small {
  font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
  font-weight: 700;
}

.metric strong {
  font-weight: 800;
}

.metric-blue {
  background: linear-gradient(135deg, #2563eb, #1d8cff);
}

.metric-green {
  background: linear-gradient(135deg, #22a447, #63d33a);
}

.metric-amber {
  background: linear-gradient(135deg, #f59e0b, #ffc85a);
}

.metric-teal {
  background: linear-gradient(135deg, #0f9f90, #18c7ae);
}

.field,
.form-field,
.admin-form label {
  color: var(--modern-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.form-grid input,
.form-grid select,
.form-grid textarea,
.product-form-grid input,
.product-form-grid select,
.admin-form input,
.admin-form select,
.admin-form textarea,
.action-form input,
.action-form select,
.action-form textarea {
  min-height: 43px;
  border: 1px solid #cfdced;
  border-radius: 12px;
  color: var(--modern-ink);
  background: linear-gradient(180deg, #ffffff, #f9fbff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.product-form-grid input:focus,
.product-form-grid select:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.action-form input:focus,
.action-form select:focus,
.action-form textarea:focus {
  border-color: #74a7ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.payment-modal {
  backdrop-filter: blur(8px);
  background: rgba(15, 23, 42, 0.34);
  overflow-y: auto;
}

.payment-modal-card {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.payment-modal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #14b8a6, #f59e0b);
}

.product-edit-actions {
  padding-top: 8px;
}

.table-wrap {
  border-radius: 14px;
  border-color: var(--modern-line);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.table-wrap table th,
.inventory-panel table th {
  color: #1d3557;
  background: #eef5ff;
}

.table-wrap table tbody tr:hover,
.inventory-panel table tbody tr:hover {
  background: #f7fbff;
}

.inventory-search,
.sales-search-wrap,
.global-search,
.dashboard-action-search,
.admin-record-search {
  border-color: #cfdbec;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

body.theme-dark {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 32rem),
    #111827;
}

body.theme-dark .panel,
body.theme-dark .inventory-panel,
body.theme-dark .default-sale-panel,
body.theme-dark .checkout-panel,
body.theme-dark .catalog-panel,
body.theme-dark .settings-card,
body.theme-dark .admin-form,
body.theme-dark .admin-insights section,
body.theme-dark .admin-chart-box,
body.theme-dark .admin-category-list,
body.theme-dark .payment-modal-card,
body.theme-dark .quick-actions {
  background:
    linear-gradient(180deg, rgba(21, 28, 41, 0.98), rgba(21, 28, 41, 0.9)),
    var(--surface);
}

/* Barra lateral moderna */
.app-shell {
  grid-template-columns: 256px minmax(0, 1fr);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 32rem),
    #f7faff;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  padding: 22px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 22% 4%, rgba(42, 121, 237, 0.55), transparent 15rem),
    linear-gradient(180deg, #071b44 0%, #0b2b68 48%, #071936 100%);
  box-shadow: 18px 0 44px rgba(11, 43, 104, 0.18);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 32%),
    radial-gradient(circle at 90% 92%, rgba(20, 184, 166, 0.18), transparent 14rem);
}

.dashboard-brand {
  position: relative;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 18px 34px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}

.dashboard-logo-img {
  max-height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.24));
}

.nav-list {
  position: relative;
  gap: 10px;
}

.nav-item {
  position: relative;
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 48px;
  padding: 0 12px 0 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: transparent;
  transition: background 160ms ease;
}

.nav-item:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.nav-item.active {
  color: #ffffff;
  border-color: rgba(125, 179, 255, 0.45);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(20, 184, 166, 0.82));
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.24);
}

.nav-item.active::before {
  background: #ffffff;
}

.nav-icon {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  color: #d9e9ff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

.nav-item:hover .nav-icon {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.13);
}

.nav-item.active .nav-icon {
  color: #0b2b68;
  border-color: rgba(255, 255, 255, 0.75);
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.sidebar-toggle-btn {
  position: static;
  top: auto;
  left: auto;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-color: #cddcf0;
  border-radius: 13px;
  color: #0b2b68;
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.app-shell.sidebar-collapsed .sidebar-toggle-btn {
  left: auto;
}

.app-shell.sidebar-collapsed .sidebar {
  transform: translateX(-24px);
}

body.theme-dark .sidebar {
  background:
    radial-gradient(circle at 22% 4%, rgba(42, 121, 237, 0.42), transparent 15rem),
    linear-gradient(180deg, #071225 0%, #0c1f3c 52%, #08111f 100%);
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    background: #f6f8fb;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    max-height: 46vh;
    padding: 10px;
    border-radius: 0 0 18px 18px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-item {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 42px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

  .nav-icon {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    font-size: 0.78rem;
  }
}

/* Mantiene la barra superior fija mientras se desplaza el modulo activo. */
@media (min-width: 761px) {
  .app-shell {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  .sidebar {
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 120;
    flex-shrink: 0;
  }

  .main > .view {
    min-height: 0;
    overflow: hidden;
  }

  .main > .view.active {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 120;
  }

  #productEditModal {
    padding: 72px 10px 14px;
  }

  #productEditModal .product-edit-card {
    max-height: calc(100vh - 88px);
  }

  .invoice-bulk-head,
  .invoice-list-head {
    display: grid;
  }

  .invoice-range-mode,
  .invoice-range-grid {
    grid-template-columns: 1fr;
  }

  .invoice-row-actions,
  .return-row-actions {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .category-row-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .inventory-toolbar-actions.returns-toolbar {
    grid-template-columns: 1fr;
  }
}

/* Ajustes finales: perfil persistente, modo oscuro y acciones moviles */
.quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
  width: 100%;
}

.quick-actions button {
  justify-content: flex-start;
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.quick-actions button .quick-icon {
  flex: 0 0 42px;
}

body.theme-dark,
body.theme-dark .app-shell {
  color: #eef4ff;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 30rem),
    linear-gradient(180deg, #0f172a, #111827);
}

body.theme-dark .main {
  background: transparent;
}

body.theme-dark .dashboard-title,
body.theme-dark .panel-header h2,
body.theme-dark .inventory-header h2,
body.theme-dark .administration-header h2,
body.theme-dark .settings-card-head h3,
body.theme-dark .cash-form h3,
body.theme-dark .cash-history-head h3,
body.theme-dark .transfer-approval-layout h3 {
  color: #f8fbff;
}

body.theme-dark .panel-header p,
body.theme-dark .inventory-header p,
body.theme-dark .settings-card-head p,
body.theme-dark .profile-card-head span,
body.theme-dark .cash-current-card span,
body.theme-dark .cash-note span,
body.theme-dark .cash-history-head p,
body.theme-dark .quick-actions button {
  color: #c7d5ea;
}

body.theme-dark .quick-actions,
body.theme-dark .action-item,
body.theme-dark .dashboard-lookup-option,
body.theme-dark .cash-form,
body.theme-dark .cash-current-card,
body.theme-dark .cash-note,
body.theme-dark .cash-history-panel,
body.theme-dark .empty-state,
body.theme-dark .table-wrap,
body.theme-dark .sales-summary,
body.theme-dark .dashboard-comparison-summary article {
  border-color: #2b3b52;
  background: linear-gradient(180deg, #151f31, #111a29);
}

body.theme-dark .quick-actions button {
  border: 1px solid #2b3b52;
  color: #eef4ff;
  background: #111a29;
}

body.theme-dark .quick-actions button:hover {
  color: #ffffff;
  border-color: #3b82f6;
  background: #17263d;
}

body.theme-dark .quick-icon {
  border-color: #3b82f6;
  color: #9fc4ff;
  background: #0d1b2f;
  box-shadow: none;
}

body.theme-dark .profile-details dt,
body.theme-dark .dashboard-lookup-option small,
body.theme-dark .cancellation-item small,
body.theme-dark .action-form label,
body.theme-dark .admin-form label,
body.theme-dark .field,
body.theme-dark .form-field {
  color: #9fb1cb;
}

body.theme-dark .profile-details dd,
body.theme-dark .action-item strong,
body.theme-dark .dashboard-lookup-option strong,
body.theme-dark .cash-current-card strong,
body.theme-dark .cash-summary-grid article strong,
body.theme-dark .cancellation-main em {
  color: #f8fbff;
}

body.theme-dark .table-wrap table td,
body.theme-dark .inventory-panel table td {
  color: #dce7f7;
  border-color: #2b3b52;
}

body.theme-dark .table-wrap table tbody tr:hover,
body.theme-dark .inventory-panel table tbody tr:hover {
  background: #17263d;
}

body.theme-dark .field input,
body.theme-dark .field select,
body.theme-dark .field textarea,
body.theme-dark .form-grid input,
body.theme-dark .form-grid select,
body.theme-dark .form-grid textarea,
body.theme-dark .product-form-grid input,
body.theme-dark .product-form-grid select,
body.theme-dark .admin-form input,
body.theme-dark .admin-form select,
body.theme-dark .admin-form textarea,
body.theme-dark .action-form input,
body.theme-dark .action-form select,
body.theme-dark .action-form textarea,
body.theme-dark .dashboard-action-search input {
  border-color: #31445f;
  color: #f8fbff;
  background: #0f172a;
}

body.theme-dark .profile-upload {
  border-color: #3b82f6;
  color: #d8e8ff;
  background: #111a29;
}

@media (max-width: 760px) {
  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  .quick-actions button {
    align-items: center;
    min-height: 68px;
    gap: 9px;
    padding: 9px;
    font-size: 0.82rem;
  }

  .quick-actions button .quick-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }
}

@media (max-width: 420px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .quick-actions button {
    min-height: 54px;
  }
}

.dashboard-quick-actions-top.quick-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-quick-actions-top.quick-actions button {
  gap: 8px;
  min-height: 52px;
  padding: 8px;
  font-size: 0.78rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.dashboard-quick-actions-top.quick-actions .quick-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .dashboard-quick-actions-top.quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-quick-actions-top.quick-actions button {
    font-size: 0.72rem;
  }
}

@media (max-width: 430px) {
  .dashboard-quick-actions-top.quick-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-actions-top.quick-actions button {
    min-height: 48px;
    font-size: 0.76rem;
  }
}

/* Ajuste puntual: acciones del panel en pantallas pequeñas */
@media (max-width: 900px) {
  .dashboard-quick-actions-top.quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-quick-actions-top.quick-actions button {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 74px;
    gap: 5px;
    padding: 7px 6px;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1.08;
  }

  .dashboard-quick-actions-top.quick-actions .quick-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 430px) {
  .dashboard-quick-actions-top.quick-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-actions-top.quick-actions button {
    min-height: 62px;
    font-size: 0.7rem;
  }
}
