
/* =========================================
   ORDER MANAGEMENT — GLOBAL DESIGN
========================================= */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;

  --background: #f7f8fc;
  --surface: #ffffff;
  --surface-hover: #f8fafc;

  --text: #172033;
  --text-secondary: #697386;
  --border: #e6e9f0;

  --green: #15803d;
  --green-bg: #dcfce7;

  --orange: #c2410c;
  --orange-bg: #ffedd5;

  --red: #b91c1c;
  --red-bg: #fee2e2;

  --blue: #1d4ed8;
  --blue-bg: #dbeafe;

  --purple: #7e22ce;
  --purple-bg: #f3e8ff;

  --sidebar-width: 250px;
  --topbar-height: 82px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 35px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

input,
select,
textarea {
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.18);
  outline-offset: 2px;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 0;
  font-size: 23px;
  font-weight: 700;
}

h2 {
  margin-bottom: 5px;
  font-size: 21px;
  font-weight: 700;
}

h3 {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-secondary);
  margin-bottom: 0;
}

.align-right {
  text-align: right !important;
}

.text-button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 650;
}

.text-button:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* =========================================
   BUTTONS
========================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  color: #344054;
  background: #fff;
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: #cbd5e1;
}

.btn-danger {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-full {
  width: 100%;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #fff;
  font-size: 19px;
}

.icon-button:hover {
  background: var(--surface-hover);
}

/* =========================================
   LOGIN
========================================= */

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(
      circle at 15% 15%,
      rgba(99, 102, 241, 0.11),
      transparent 34%
    ),
    radial-gradient(
      circle at 85% 85%,
      rgba(59, 130, 246, 0.10),
      transparent 35%
    ),
    var(--background);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.login-card .brand-mark {
  margin-bottom: 22px;
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 26px;
}

.login-card > p {
  margin-bottom: 27px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 5px 12px rgba(79, 70, 229, 0.2);
}

#loginForm {
  display: flex;
  flex-direction: column;
}

#loginForm label {
  margin: 0 0 7px;
  color: #344054;
  font-weight: 650;
}

#loginForm input {
  width: 100%;
  min-height: 45px;
  margin-bottom: 19px;
  padding: 11px 13px;
  border: 1px solid #d8dee9;
  border-radius: var(--radius-sm);
  background: #fff;
}

#loginForm input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(79, 70, 229, 0.12);
}

.form-error {
  min-height: 0;
  margin: -6px 0 12px;
  color: #dc2626;
  font-size: 13px;
}

.form-error:empty {
  display: none;
}

.login-footer {
  margin: 23px 0 0 !important;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

/* =========================================
   APP SHELL AND SIDEBAR
========================================= */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 100;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 24px 15px 16px;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 7px;
  margin-bottom: 32px;
}

.sidebar-brand .brand-mark {
  width: 41px;
  height: 41px;
  border-radius: 12px;
}

.sidebar-brand strong {
  display: block;
  max-width: 160px;
  font-size: 13px;
  line-height: 1.4;
}

.sidebar-brand small {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-label {
  padding: 0 12px;
  margin: 0 0 8px;
  color: #98a2b3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.nav-label-spaced {
  margin-top: 27px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  color: #596579;
  background: transparent;
  text-align: left;
  font-weight: 550;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  color: var(--primary);
  background: #f6f7ff;
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex: 0 0 20px;
  font-size: 18px;
  line-height: 1;
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 20px;
  background: #e0e7ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding-top: 24px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px #dcfce7;
}

.logout-item:hover {
  color: var(--red);
  background: #fef2f2;
}

.sidebar-overlay {
  display: none;
}

/* =========================================
   TOP BAR
========================================= */

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  gap: 20px;
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.topbar-left h1 {
  margin-top: 3px;
}

.breadcrumb {
  color: var(--text-secondary);
  font-size: 11px;
}

.profile-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 17px;
  border-left: 1px solid var(--border);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-light);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.profile-details strong {
  max-width: 145px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-details span {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: capitalize;
}

.menu-button {
  display: none;
}

/* =========================================
   PAGE CONTENT
========================================= */

.page-content {
  width: 100%;
  max-width: 1700px;
  min-height: calc(100vh - var(--topbar-height) - 65px);
  padding: 29px 30px 38px;
  margin: 0 auto;
}

.page-section {
  animation: fade-in 0.18s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-row,
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 23px;
}

.welcome-row .muted,
.section-toolbar .muted {
  margin-top: 5px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 23px;
}

.stat-card {
  min-width: 0;
  padding: 21px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 800;
}

.icon-blue {
  color: var(--blue);
  background: var(--blue-bg);
}

.icon-orange {
  color: var(--orange);
  background: var(--orange-bg);
}

.icon-green {
  color: var(--green);
  background: var(--green-bg);
}

.icon-purple {
  color: var(--purple);
  background: var(--purple-bg);
}

.stat-value {
  margin-top: 16px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(23px, 2.2vw, 31px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-foot {
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 11px;
}

/* =========================================
   PANELS
========================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(250px, 0.9fr);
  gap: 19px;
  align-items: start;
}

.panel {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 21px;
}

.panel-heading .muted {
  margin-top: 4px;
  font-size: 12px;
}

.payment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 21px;
  border-top: 1px solid var(--border);
}

.payment-summary span {
  font-size: 12px;
}

.payment-summary strong {
  text-align: right;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* =========================================
   FILTERS AND SEARCH
========================================= */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-bar input,
.filter-bar select {
  min-height: 41px;
  padding: 9px 12px;
  border: 1px solid #d8dee9;
  border-radius: var(--radius-sm);
  background: #fff;
}

.filter-bar input {
  width: min(100%, 330px);
  flex: 1 1 240px;
}

.filter-bar select {
  min-width: 150px;
  max-width: 100%;
}

.filter-bar input::placeholder {
  color: #98a2b3;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--primary);
}

/* =========================================
   TABLES
========================================= */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead {
  background: #f9fafb;
}

th {
  padding: 13px 17px;
  color: #667085;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 15px 17px;
  color: #475467;
  font-size: 12px;
  border-bottom: 1px solid #eef0f4;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafbff;
}

td strong {
  color: var(--text);
  font-weight: 650;
}

td .muted {
  font-size: 11px;
}

.empty-cell {
  padding: 38px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.table-footer {
  padding: 13px 17px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
}

/* =========================================
   STATUS BADGES
========================================= */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-ongoing,
.badge-partially-paid {
  color: var(--orange);
  background: var(--orange-bg);
}

.badge-delivered,
.badge-paid,
.badge-active {
  color: var(--green);
  background: var(--green-bg);
}

.badge-canceled,
.badge-refunded,
.badge-inactive,
.badge-unpaid {
  color: var(--red);
  background: var(--red-bg);
}

.badge-neutral {
  color: #475467;
  background: #f2f4f7;
}

/* =========================================
   ROW ACTIONS
========================================= */

.row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #475467;
  background: #fff;
  font-size: 11px;
  font-weight: 650;
}

.action-button:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: #c7d2fe;
}

.action-button.danger:hover {
  color: var(--red);
  background: #fef2f2;
  border-color: #fecaca;
}

/* =========================================
   NOTICES
========================================= */

.notice {
  padding: 13px 15px;
  margin-bottom: 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.notice-info {
  color: #1e40af;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.notice-error {
  color: var(--red);
  background: #fef2f2;
  border-color: #fecaca;
}

.notice-success {
  color: var(--green);
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* =========================================
   MODAL HOST
========================================= */

.modal-host {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}

.modal {
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: modal-in 0.18s ease-out;
}

.modal.modal-wide {
  max-width: 850px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #667085;
  background: #fff;
  font-size: 20px;
}

.modal-body {
  padding: 23px 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 17px 24px;
  border-top: 1px solid var(--border);
}

/* Form controls used inside modals */

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-field.full-width {
  grid-column: 1 / -1;
}

.form-field label {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 41px;
  padding: 9px 11px;
  border: 1px solid #d8dee9;
  border-radius: var(--radius-sm);
  background: #fff;
}

.form-field textarea {
  min-height: 90px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
}

.form-field .field-hint {
  color: var(--text-secondary);
  font-size: 11px;
}

.form-section-title {
  grid-column: 1 / -1;
  padding-bottom: 8px;
  margin-bottom: -2px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 750;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-field input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* =========================================
   TOAST NOTIFICATIONS
========================================= */

.toast-container {
  position: fixed;
  z-index: 1000;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
  animation: fade-in 0.18s ease-out;
}

.toast.toast-success {
  border-left-color: #16a34a;
}

.toast.toast-error {
  border-left-color: #dc2626;
}

.toast.toast-warning {
  border-left-color: #ea580c;
}

/* =========================================
   FOOTER
========================================= */

.app-footer {
  padding: 20px 30px;
  border-top: 1px solid var(--border);
  color: #98a2b3;
  font-size: 11px;
  text-align: center;
}

.app-footer span {
  padding: 0 5px;
}

/* =========================================
   RESPONSIVE: TABLETS
========================================= */

@media (max-width: 1200px) {
  :root {
    --sidebar-width: 225px;
  }

  .page-content {
    padding: 25px 22px 32px;
  }

  .topbar {
    padding-right: 22px;
    padding-left: 22px;
  }

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

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

/* =========================================
   RESPONSIVE: MOBILE
========================================= */

@media (max-width: 760px) {
  :root {
    --topbar-height: 70px;
  }

  .sidebar {
    z-index: 300;
    width: min(290px, 85vw);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }

  .sidebar-overlay.overlay-visible {
    position: fixed;
    z-index: 250;
    inset: 0;
    display: block;
    background: rgba(15, 23, 42, 0.4);
  }

  .main-area {
    margin-left: 0;
  }

  .topbar {
    gap: 10px;
    padding: 12px 15px;
  }

  .topbar-left {
    gap: 10px;
  }

  .topbar-left h1 {
    font-size: 19px;
  }

  .breadcrumb {
    font-size: 10px;
  }

  .menu-button {
    display: inline-flex;
    width: 37px;
    height: 37px;
    flex: 0 0 37px;
  }

  .topbar-right {
    gap: 9px;
  }

  .btn-refresh {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    font-size: 18px;
  }

  .btn-refresh span {
    display: none;
  }

  .profile-area {
    gap: 0;
    padding-left: 9px;
  }

  .avatar {
    width: 35px;
    height: 35px;
  }

  .profile-details {
    display: none;
  }

  .page-content {
    padding: 22px 15px 28px;
  }

  .welcome-row,
  .section-toolbar {
    align-items: flex-start;
  }

  .welcome-row h2,
  .section-toolbar h2 {
    font-size: 19px;
  }

  .welcome-row .btn,
  .section-toolbar .btn {
    min-height: 37px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .stats-grid {
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 13px;
  }

  .stat-label {
    font-size: 11px;
  }

  .dashboard-grid {
    gap: 15px;
  }

  .panel-heading {
    padding: 16px;
  }

  th {
    padding: 12px;
  }

  td {
    padding: 13px 12px;
  }

  .filter-bar {
    gap: 9px;
  }

  .filter-bar input {
    flex-basis: 100%;
    width: 100%;
  }

  .filter-bar select {
    flex: 1 1 135px;
    min-width: 0;
  }

  .app-footer {
    padding: 18px 15px;
  }

  .modal-host {
    align-items: flex-end;
    padding: 0;
  }

  .modal,
  .modal.modal-wide {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }

  .modal-header,
  .modal-body {
    padding: 19px;
  }

  .modal-footer {
    padding: 15px 19px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .form-field.full-width,
  .form-section-title {
    grid-column: auto;
  }

  .toast-container {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}

@media (max-width: 420px) {
  .login-card {
    padding: 26px 21px;
  }

  .welcome-row,
  .section-toolbar {
    gap: 9px;
  }

  .welcome-row .btn,
  .section-toolbar .btn {
    white-space: normal;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-top {
    align-items: flex-start;
  }

  .stat-value {
    font-size: 21px;
  }

  .stat-foot {
    font-size: 10px;
  }
}

/* =========================================
   REDUCED MOTION ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================
   Toggle on off password
========================================= */
.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  width: 100%;
  padding-right: 65px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.password-toggle:hover {
  color: #3730a3;
}

.password-toggle:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
}
