/* Shared public admin UI */
:root {
  --primary: #4361ee;
  --primary-hover: #3f37c9;
  --secondary: #3f37c9;
  --success: #2ec4b6;
  --danger: #e71d36;
  --warning: #ff9f1c;
  --info: #4895ef;
  --dark: #172033;
  --light: #f8fafc;
  --bg-color: #f4f7fa;
  --bg-body: #f4f7fa;
  --bg-card: #ffffff;
  --card-bg: #ffffff;
  --text-main: #172033;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-color: #e2e8f0;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.1);
  --focus-ring: 0 0 0 3px rgba(67, 97, 238, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 40px;
  background: var(--bg-color);
  color: var(--dark);
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  letter-spacing: 0;
}

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

button {
  touch-action: manipulation;
}

a {
  color: inherit;
}

/* Login and report center */
.container {
  min-height: 100vh;
}

.login-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f4f6f9;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 36px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
  text-align: center;
}

.login-header {
  margin-bottom: 24px;
}

.login-header i {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 2.8rem;
}

.login-header h1 {
  margin: 8px 0 18px;
  color: var(--dark);
  font-family: "Poppins", sans-serif;
  font-size: 1.5rem;
}

.login-header p {
  margin: 0;
  color: var(--text-muted);
}

.login-form,
#loginForm {
  text-align: left;
}

.login-btn {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
}

.login-btn:hover {
  background: var(--primary-hover);
}

.dashboard-section {
  min-height: 100vh;
}

/* Page shell */
.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.header-left h1,
.header-content h1 {
  margin: 0;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Poppins", sans-serif;
  font-size: 1.35rem;
  line-height: 1.2;
}

.header-left h1 i,
.header-content h1 i {
  color: var(--primary);
}

.kitajima-brand {
  gap: 14px;
}

.kitajima-logo {
  display: block;
  width: clamp(116px, 8.5vw, 140px);
  height: auto;
  max-height: 42px;
  object-fit: contain;
}

.header-right,
.header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.user-info,
#userInfo,
#adminUserInfo {
  color: var(--dark);
  font-size: 0.9rem;
  font-weight: 600;
}

.dashboard-main,
.dashboard-container {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 28px 20px;
}

.dashboard-container {
  padding-top: 0;
}

.date-badge {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
}

.nav-link,
.nav-btn,
.dropdown-btn,
.btn,
.reload-btn,
.refresh-btn,
.load-btn,
.export-btn,
.btn-generate,
.btn-export,
.btn-logout,
.primary-btn {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.1;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-link:hover,
.nav-btn:hover,
.dropdown-btn:hover,
.btn-secondary:hover,
.btn-export:hover {
  border-color: rgba(67, 97, 238, 0.35);
  background: #f8faff;
  color: var(--primary);
}

.btn-primary,
.refresh-btn,
.load-btn,
.btn-generate,
.primary-btn {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover,
.refresh-btn:hover,
.load-btn:hover,
.btn-generate:hover,
.primary-btn:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-warning {
  border-color: var(--warning);
  background: var(--warning);
  color: #ffffff;
}

.btn-warning:hover {
  border-color: #d97706;
  background: #d97706;
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-muted);
}

.reload-btn {
  border-color: var(--dark);
  background: var(--dark);
  color: #ffffff;
}

.reload-btn:hover {
  background: #0f172a;
  color: #ffffff;
}

.btn-logout {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.btn-logout:hover {
  background: #fecaca;
}

.btn-small,
.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.btn-icon {
  width: 36px;
  padding: 0;
}

/* Dropdown navigation */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
  z-index: 120;
}

.dropdown.show .dropdown-menu {
  display: grid;
  gap: 2px;
}

.dropdown-item {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  text-decoration: none;
  font-size: 0.9rem;
}

.dropdown-item:hover {
  background: #f8faff;
  color: var(--primary);
}

.dropdown-item i {
  width: 18px;
  color: var(--text-muted);
  text-align: center;
}

/* Cards, filters, stats */
.stats-container,
.summary-grid,
.truck-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card,
.summary-card,
.filter-card,
.table-card,
.details-container,
.controls-card,
.report-panel,
.card,
.truck-summary-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 82px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.stat-icon,
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.25rem;
}

.stat-info h4,
.truck-summary-label {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-info p,
.truck-summary-value {
  margin: 0;
  color: var(--dark);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.icon-total,
.icon-new,
.icon-count,
.theme-sales .card-icon {
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
}

.icon-full,
.icon-avail,
.icon-hosp,
.icon-money,
.icon-success,
.icon-sold,
.theme-filling .card-icon {
  background: rgba(46, 196, 182, 0.11);
  color: var(--success);
}

.icon-empty,
.icon-factory,
.icon-maint,
.icon-danger,
.theme-returns .card-icon {
  background: rgba(231, 29, 54, 0.1);
  color: var(--danger);
}

.icon-indiv,
.icon-busy,
.icon-returned,
.icon-delivered,
.theme-inspection .card-icon {
  background: rgba(255, 159, 28, 0.12);
  color: var(--warning);
}

.icon-shop,
.icon-info {
  background: rgba(72, 149, 239, 0.11);
  color: var(--info);
}

.filter-card,
.controls-card {
  padding: 18px;
  margin-bottom: 22px;
}

.inventory-filter-card {
  padding: 16px;
}

.inventory-toolbar {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.inventory-heading {
  min-width: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-heading h2,
.filter-card-header h3,
.table-card-header h3 {
  margin: 0;
  color: var(--dark);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.inventory-heading h2 {
  font-size: 1.12rem;
}

.inventory-heading p,
.filter-card-header p,
.table-card-header p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.inventory-filter-header {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.inventory-actions,
.table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.last-sync,
.filter-count {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.filter-card-header,
.table-card-header {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.filter-count {
  color: var(--primary);
  background: rgba(67, 97, 238, 0.08);
}

.compact-stats {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.compact-stats .stat-card {
  min-height: 62px;
  padding: 10px 12px;
  box-shadow: none;
}

.compact-stats .stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.compact-stats .stat-info h4 {
  font-size: 0.68rem;
}

.compact-stats .stat-info p {
  font-size: 1.05rem;
}

.quick-filter-bar {
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filter {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
}

.quick-filter:hover,
.quick-filter.active {
  border-color: rgba(67, 97, 238, 0.35);
  background: rgba(67, 97, 238, 0.08);
  color: var(--primary);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: end;
}

.filters-row,
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.controls-bar {
  justify-content: flex-end;
  margin-bottom: 18px;
}

.filter-actions,
.form-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-span-2 {
  grid-column: span 2;
}

.toolbar-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.push-right {
  margin-left: auto;
}

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

.empty-row {
  padding: 40px 18px;
  color: var(--text-muted);
  text-align: center;
}

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

.empty-icon {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 2rem;
  opacity: 0.35;
}

.icon-primary {
  color: var(--primary);
}

.icon-info {
  color: var(--info);
}

.icon-success {
  color: var(--success);
}

.icon-warning {
  color: var(--warning);
}

.icon-muted {
  color: var(--text-muted);
}

.chevron-sm {
  font-size: 0.7em;
}

.login-error {
  display: none;
  margin-top: 1rem;
  color: var(--danger);
  font-size: 0.9rem;
}

.system-menu-btn {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #065f46;
}

.system-menu-btn i {
  color: #059669;
}

.divider-vertical {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

.qr-help {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.readonly-input {
  background: #e9eef5 !important;
}

.form-group {
  min-width: 0;
  margin: 0;
}

.form-group label,
.control-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-input,
.filter-select,
.search-input,
.form-group input,
.form-group select,
.form-group textarea,
.control-group input,
.control-group select,
.control-group textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--dark);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.filter-input:focus,
.filter-select:focus,
.search-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.control-group input:focus,
.control-group select:focus,
.control-group textarea:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: var(--focus-ring);
}

.search-wrapper {
  position: relative;
  min-width: 220px;
  flex: 1;
}

.search-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  color: var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-wrapper .search-input {
  padding-left: 36px;
}

/* Tables */
.table-card {
  overflow: hidden;
}

.table-card-header {
  margin: 0;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.table-tools label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-select {
  width: auto;
  min-width: 82px;
  height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.table-responsive {
  overflow: auto;
  max-height: 68vh;
}

.data-table,
.report-table,
.history-table,
.logs-table,
.maintenance-table,
.modal-table,
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.report-table th,
.history-table th,
.logs-table th,
.maintenance-table th,
.modal-table th,
table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td,
.report-table td,
.history-table td,
.logs-table td,
.maintenance-table td,
.modal-table td,
table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--dark);
  vertical-align: middle;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.data-table tr:hover,
.report-table tr:hover,
.history-table tr:hover,
.logs-table tr:hover,
.maintenance-table tr:hover {
  background: #f8fafc;
}

.data-table tr:last-child td,
.report-table tr:last-child td,
.history-table tr:last-child td {
  border-bottom: 0;
}

.pagination {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Badges and action buttons */
.status-badge,
.badge,
.type-badge,
.number-badge,
.size-badge,
.customer-type {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  align-items: center;
  gap: 5px;
  background: #eef2f7;
  color: var(--dark);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.number-badge,
.serial-text {
  border-radius: 7px;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
}

.cell-primary {
  color: var(--dark);
  font-weight: 750;
  line-height: 1.35;
}

.cell-meta {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.metric-success {
  color: var(--success);
}

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

.table-strong {
  color: var(--dark);
  font-weight: 800;
}

.log-type-badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  align-items: center;
  gap: 5px;
  background: #eef2f7;
  color: var(--dark);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.2;
  text-transform: capitalize;
  overflow-wrap: anywhere;
}

.log-type-info,
.log-type-system {
  background: rgba(72, 149, 239, 0.12);
  color: #1d4ed8;
}

.log-type-warning {
  background: rgba(255, 159, 28, 0.14);
  color: #b45309;
}

.log-type-error {
  background: rgba(231, 29, 54, 0.1);
  color: #b42318;
}

.log-type-success {
  background: rgba(46, 196, 182, 0.13);
  color: #0f766e;
}

.log-type-debug,
.log-type-default {
  background: #eef2f7;
  color: #475569;
}

.staff-info {
  min-width: 170px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.staff-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(67, 97, 238, 0.11);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.76rem;
  font-weight: 850;
}

.staff-details {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.staff-name {
  color: var(--dark);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
}

.staff-role {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: capitalize;
}

.log-remarks {
  max-width: 620px;
  color: var(--dark);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-detail-pre {
  white-space: pre-wrap;
}

.empty-table-cell {
  padding: 40px 20px !important;
  color: var(--text-muted);
  text-align: center;
}

.empty-table-cell p {
  margin: 0;
}

.skeleton-short {
  width: 44px;
}

.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
}

.log-date-skeleton {
  width: 128px;
}

.log-user-skeleton {
  width: 116px;
}

.metric-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metric-pill,
.sale-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.sale-type-badge {
  background: rgba(67, 97, 238, 0.08);
  color: var(--primary);
}

.stock-panel {
  margin-bottom: 22px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px;
}

.stock-tile {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stock-size {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.stock-qty {
  margin-top: 5px;
  color: var(--primary);
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1.1;
}

.size-report-empty {
  color: var(--text-muted);
  text-align: center;
}

.size-total {
  color: var(--primary);
  font-weight: 850;
}

.filling-detail-hero {
  margin-bottom: 22px;
}

.process-info-list {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.process-info-list .detail-list-item {
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
}

.process-info-list .label,
.filling-remark .label {
  display: block;
}

.filling-remark {
  border-color: #fde68a;
  background: #fffbeb;
}

.filling-remark .label {
  color: #92400e;
}

.filling-remark .value {
  color: #78350f;
  font-weight: 650;
}

.loading-copy {
  margin: 0;
  color: var(--text-muted);
  font-weight: 650;
}

.helper-text,
.modal-help-text {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.form-inline-footer {
  margin-top: 10px;
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-row {
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
}

.entry-row-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.entry-row-grid label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.entry-remove {
  white-space: nowrap;
}

.status-full,
.status-completed,
.status-passed,
.status-available,
.status-fixed,
.status-fillingfinished,
.status-deliverycompleted,
.badge-deliverycompleted,
.type-hospital,
.type-cash {
  background: rgba(46, 196, 182, 0.12);
  color: #0f766e;
}

.status-empty,
.status-failed,
.status-rejected,
.status-error,
.status-notavailable,
.status-maintenance,
.status-fillingcancelled,
.type-factory,
.status-leakage-error,
.status-valve-error,
.status-key-error,
.status-damaged-error,
.status-other-error {
  background: rgba(231, 29, 54, 0.1);
  color: #b42318;
}

.status-delivered,
.status-progress,
.status-pending,
.status-return,
.status-ondelivery,
.status-busy,
.status-filling,
.status-fillingstarted,
.badge-deliverystarted,
.type-shop {
  background: rgba(255, 159, 28, 0.13);
  color: #b45309;
}

.status-taken,
.status-in-transit,
.status-loading,
.status-waitfilling,
.badge-loading,
.status-credit,
.type-individual,
.type-workshop {
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
}

.action-btn,
.edit-btn,
.delete-btn,
.btn-icon-view,
.btn-icon-qr,
.btn-icon-edit,
.btn-edit,
.btn-icon-delete,
.btn-view,
.btn-add,
.btn-history,
.btn-qr,
.btn-status,
.btn-delete,
.action-end,
.action-edit,
.action-delete,
.action-view {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--info);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-right: 4px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.action-button-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: max-content;
}

.action-button-group .action-btn {
  margin-right: 0;
}

.action-btn:focus-visible {
  outline: 2px solid rgba(67, 97, 238, 0.35);
  outline-offset: 2px;
}

.table-actions-cell {
  min-width: 168px;
  text-align: right;
  white-space: nowrap;
}

.table-actions-cell .action-button-group {
  width: 100%;
}

.btn-icon-view,
.btn-view,
.action-view {
  background: rgba(72, 149, 239, 0.1);
  color: var(--info);
}

.btn-icon-view:hover,
.btn-view:hover,
.action-view:hover {
  background: var(--info);
  color: #ffffff;
}

.btn-icon-qr,
.btn-add,
.btn-qr,
.btn-history {
  background: rgba(114, 9, 183, 0.09);
  color: #7209b7;
}

.btn-icon-qr:hover,
.btn-add:hover,
.btn-qr:hover,
.btn-history:hover {
  background: #7209b7;
  color: #ffffff;
}

.btn-icon-edit,
.btn-edit,
.btn-status,
.action-end,
.action-edit,
.edit-btn {
  background: rgba(255, 159, 28, 0.12);
  color: var(--warning);
}

.btn-icon-edit:hover,
.btn-edit:hover,
.btn-status:hover,
.action-end:hover,
.action-edit:hover,
.edit-btn:hover {
  background: var(--warning);
  color: #ffffff;
}

.btn-icon-delete,
.btn-delete,
.action-delete,
.delete-btn {
  background: rgba(231, 29, 54, 0.1);
  color: var(--danger);
}

.btn-icon-delete:hover,
.btn-delete:hover,
.action-delete:hover,
.delete-btn:hover {
  background: var(--danger);
  color: #ffffff;
}

.details-btn {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.details-btn:hover,
.details-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

/* Customer cards */
.customers-grid,
.customer-sales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.customer-sales-grid {
  margin-bottom: 30px;
}

.customer-card {
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  min-width: 0;
}

.customer-card:hover {
  border-color: rgba(67, 97, 238, 0.4);
}

.card-header,
.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.1rem;
  font-weight: 800;
}

.customer-main h3,
.customer-info h4 {
  margin: 0 0 4px;
  color: var(--dark);
  font-size: 1rem;
}

.customer-info {
  flex: 1;
  min-width: 0;
}

.customer-info span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.customer-metrics {
  text-align: right;
}

.metric-main {
  color: var(--success);
  font-size: 1.05rem;
  font-weight: 800;
}

.metric-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.card-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.info-row {
  margin-bottom: 7px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.info-row i {
  width: 16px;
  text-align: center;
}

.card-footer {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Pricing management */
.pricing-control-card {
  overflow: hidden;
}

.pricing-tabs {
  margin: 0 0 14px;
}

.pricing-toolbar {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.pricing-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.pricing-card {
  min-width: 0;
  padding: 15px;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  border-color: rgba(67, 97, 238, 0.35);
}

.pricing-card .card-header {
  margin-bottom: 12px;
}

.card-title {
  min-width: 0;
  color: var(--dark);
  font-size: 1rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.price-list-preview {
  min-height: 120px;
  max-height: 190px;
  overflow: auto;
}

.price-row {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-row:last-child {
  border-bottom: 0;
}

.price-specs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.spec-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.1;
}

.spec-badge.size-badge {
  background: rgba(72, 149, 239, 0.11);
  color: var(--info);
}

.price-val {
  color: var(--dark);
  font-weight: 850;
  white-space: nowrap;
}

.price-more-count,
.price-empty-text {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.pricing-empty {
  grid-column: 1 / -1;
}

.full-width-btn {
  width: 100%;
}

.customer-meta {
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.customer-meta-label {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-meta-value {
  color: var(--dark);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.customer-meta-value.missing {
  color: var(--danger);
}

.customer-type-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  align-items: center;
  background: #eef2f7;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.section-subheader {
  margin: 18px 0 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-subheader h3 {
  margin: 0;
  color: var(--dark);
  font-size: 1rem;
  font-weight: 800;
}

.section-subheader p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.input-cell {
  min-width: 96px;
}

.pricing-assignment-modal {
  width: min(92vw, 560px);
}

.assignment-summary {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #f8fafc;
}

.assignment-summary-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.assignment-summary-name {
  margin-top: 4px;
  color: var(--dark);
  font-size: 1.05rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.assignment-help {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.assignment-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.skeleton-card {
  min-height: 170px;
}

.card-footer .action-btn {
  width: auto;
  min-width: 34px;
  padding: 0 10px;
}

/* Dashboard/reports */
.summary-card {
  padding: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-item h4 {
  margin: 0;
  color: var(--dark);
  font-size: 1.35rem;
}

.stat-item p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.section-title {
  margin: 26px 0 14px;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.section-title::after {
  content: "";
  height: 1px;
  background: var(--border-color);
  flex: 1;
}

.details-container {
  padding: 20px;
}

.details-tabs,
.report-tabs,
.tabs-container {
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 10px;
  background: #eef2f7;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tab-button,
.tab-btn {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
}

.tab-button.active,
.tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-content,
.tab-pane {
  display: none;
}

.tab-content.active,
.tab-pane.active {
  display: block;
}

.controls-card {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
}

.control-group {
  min-width: 190px;
  flex: 1;
}

.report-panel {
  min-height: 380px;
  overflow: hidden;
}

.tab-pane {
  padding: 20px;
}

.pane-header,
.report-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pane-header h2,
.report-header h2 {
  margin: 0;
  color: var(--dark);
  font-size: 1.1rem;
}

.no-data,
.empty-state {
  padding: 34px 18px;
  color: var(--text-muted);
  text-align: center;
}

.truck-report-layout {
  display: grid;
  gap: 16px;
}

.truck-summary-card {
  padding: 14px;
}

.truck-report-cell {
  min-width: 220px;
  background: #f8fafc;
  white-space: normal;
}

.truck-report-name {
  color: var(--dark);
  font-weight: 800;
}

.truck-report-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.reports-login-card {
  max-width: 380px;
  padding: 30px;
  text-align: left;
}

.reports-login-card .login-header {
  margin-bottom: 20px;
  text-align: left;
}

.reports-login-card .login-header i {
  width: 42px;
  height: 42px;
  margin: 0 0 12px;
  border-radius: 10px;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.reports-login-card .login-header h1 {
  margin-bottom: 6px;
}

.reports-login-card .login-btn {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.reports-header {
  align-items: center;
}

.reports-nav,
.primary-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-nav {
  justify-content: flex-end;
}

.reports-main {
  max-width: 1500px;
}

.reports-filter-card {
  margin-bottom: 18px;
}

.reports-filters-grid {
  grid-template-columns: minmax(180px, 220px) minmax(180px, 220px) minmax(180px, 220px);
  align-items: end;
}

.reports-generate-group {
  align-self: end;
}

.reports-generate-group .btn {
  width: 100%;
  min-width: 180px;
}

.reports-workspace {
  overflow: hidden;
}

.reports-workspace-header {
  border-bottom: 0;
  padding-bottom: 8px;
}

.reports-workspace .report-tabs {
  margin: 0 16px 12px;
}

.reports-workspace .report-panel {
  border-top: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: none;
}

.reports-workspace .tab-pane {
  padding: 0;
}

.reports-workspace .pane-header {
  margin: 0;
  padding: 14px 16px;
  background: #ffffff;
}

.reports-workspace .table-responsive {
  max-height: 62vh;
}

.report-cell-strong {
  font-weight: 800;
}

.report-cell-left {
  text-align: left;
}

.report-cell-left-strong {
  text-align: left;
  font-weight: 800;
}

.current-stock-section {
  margin-bottom: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.current-stock-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.current-stock-header h3 {
  margin: 0;
  color: var(--dark);
  font-size: 1rem;
}

.current-stock-generated {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.current-stock-summary {
  margin-bottom: 14px;
}

.current-stock-table {
  margin-top: 6px;
}

.stock-breakdown-cell {
  min-width: 220px;
  text-align: left;
  white-space: normal;
}

.current-stock-empty {
  padding: 18px;
}

.report-cell-center-strong {
  text-align: center;
  font-weight: 750;
}

.report-cell-separator {
  border-top: 2px solid #334155 !important;
}

.report-cell-total,
.report-cell-total-strong,
.report-cell-total-left-strong {
  background: #f8fafc;
}

.report-cell-total-strong {
  font-weight: 800;
}

.report-cell-total-left-strong {
  text-align: left;
  font-weight: 800;
}

/* User admin */
.hidden {
  display: none !important;
}

.admin-main {
  max-width: 1540px;
  padding: 18px 20px 30px;
}

.admin-header-actions {
  gap: 12px;
}

.environment-badge {
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.environment-badge i {
  color: inherit;
  font-size: 0.72rem;
}

.admin-control-card {
  margin-bottom: 14px;
  padding: 14px 16px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.admin-control-header {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.admin-tabs {
  margin: 0;
  padding: 3px;
}

.admin-tabs .tab-btn {
  min-height: 34px;
  padding: 6px 12px;
}

.admin-panel {
  margin-top: 14px;
}

.admin-panel > .table-card-header {
  padding: 12px 16px;
}

.admin-panel-body {
  padding: 14px 16px 16px;
}

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

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

.admin-form .form-group > label {
  margin-bottom: 5px;
}

.admin-form .form-group > input,
.admin-form .form-group > select,
.admin-form .form-group > textarea {
  min-height: 38px;
  padding: 8px 10px;
}

.form-section-title {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border-color);
  color: var(--dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-form-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.admin-table-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.filters-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-users-table .table-actions-cell {
  width: 1%;
}

.admin-users-table .password-column {
  min-width: 170px;
}

.password-reveal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}

.password-mask,
.password-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
}

.password-mask {
  color: var(--text-muted);
}

.password-value {
  color: var(--dark);
}

.btn-icon-password {
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
}

.btn-icon-password:hover {
  background: rgba(67, 97, 238, 0.18);
  color: var(--primary-hover);
}

.btn-icon-role {
  background: rgba(72, 149, 239, 0.12);
  color: #1d4ed8;
}

.btn-icon-role:hover {
  background: rgba(72, 149, 239, 0.22);
  color: #1e40af;
}

.user-cell {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(67, 97, 238, 0.12);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 850;
}

.admin-user-text {
  min-width: 0;
}

.admin-user-name {
  color: var(--dark);
  font-weight: 750;
  line-height: 1.3;
}

.admin-user-email {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.admin-role-stack {
  display: inline-flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.admin-role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-badge {
  background: #eef6ff;
  color: #0369a1;
}

.role-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.role-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  transition: border-color 0.16s ease, background-color 0.16s ease,
    color 0.16s ease;
}

.role-checkbox:hover {
  border-color: rgba(67, 97, 238, 0.38);
  background: #f8faff;
}

.role-checkbox:has(input:checked) {
  border-color: rgba(67, 97, 238, 0.55);
  background: rgba(67, 97, 238, 0.08);
  color: var(--primary);
}

.role-checkbox input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
  accent-color: var(--primary);
}

.admin-permission-group .role-checkbox-grid {
  grid-template-columns: minmax(180px, 260px);
}

.company-badge {
  max-width: 180px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--text-muted);
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-edit-user {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #f8fafc;
}

.role-edit-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-edit-current {
  margin-top: 7px;
}

.role-root {
  background: #172033;
  color: #ffffff;
}

.role-admin {
  background: rgba(67, 97, 238, 0.12);
  color: var(--primary);
}

.role-manager,
.status-verified {
  background: rgba(46, 196, 182, 0.13);
  color: #0f766e;
}

.role-sale {
  background: rgba(255, 159, 28, 0.14);
  color: #b45309;
}

.role-fill {
  background: rgba(72, 149, 239, 0.13);
  color: #1d4ed8;
}

.status-unverified {
  border: 1px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-muted);
}

.status-banned {
  background: rgba(231, 29, 54, 0.11);
  color: #b91c1c;
}

.btn-icon-verify {
  background: rgba(46, 196, 182, 0.13);
  color: #0f766e;
}

.btn-icon-verify:hover {
  background: rgba(46, 196, 182, 0.22);
}

.btn-icon-ban,
.btn-icon-delete {
  background: rgba(231, 29, 54, 0.1);
  color: #b91c1c;
}

.btn-icon-ban:hover,
.btn-icon-delete:hover {
  background: rgba(231, 29, 54, 0.18);
}

.btn-icon-unban {
  background: rgba(255, 159, 28, 0.14);
  color: #b45309;
}

.btn-icon-unban:hover {
  background: rgba(255, 159, 28, 0.23);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.admin-stat-card {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.admin-stat-card.skeleton-card {
  min-height: 96px;
}

.admin-stat-primary {
  border-left: 4px solid var(--primary);
}

.admin-stat-success {
  border-left: 4px solid var(--success);
}

.admin-stat-danger {
  border-left: 4px solid var(--danger);
}

.admin-stat-info {
  border-left: 4px solid var(--info);
}

.admin-stat-number {
  color: var(--dark);
  font-size: 1.65rem;
  font-weight: 850;
  line-height: 1.1;
}

.admin-stat-success .admin-stat-number {
  color: #0f766e;
}

.admin-stat-danger .admin-stat-number {
  color: #b91c1c;
}

.admin-stat-info .admin-stat-number {
  color: #1d4ed8;
}

.admin-stat-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-section-title {
  margin: 24px 0 12px;
  color: var(--dark);
  font-size: 1rem;
  font-weight: 850;
}

.admin-role-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.admin-role-card {
  min-height: 88px;
  align-items: center;
  text-align: center;
}

.admin-role-count {
  font-size: 1.35rem;
}

.admin-skeleton-name {
  width: 150px;
}

.admin-skeleton-status {
  width: 84px;
}

.skeleton-number {
  width: 90px;
  height: 26px;
}

/* Modals */
.modal,
.modal-overlay,
.log-details-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal.show,
.modal-overlay.show,
.log-details-modal.show {
  display: flex;
}

.modal-content,
.modal-container {
  width: min(92vw, 600px);
  max-height: 90vh;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-content.wide,
.modal-wide {
  width: min(96vw, 980px);
  max-width: 980px;
}

.modal-header,
.modal-footer {
  padding: 16px 20px;
  background: #f8fafc;
  border-color: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  justify-content: flex-end;
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
}

.modal-body {
  padding: 20px;
  overflow: auto;
}

.close,
.close-modal {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.close:hover,
.close-modal:hover {
  background: #fee2e2;
  color: var(--danger);
}

.form-grid,
.detail-grid,
.details-grid,
.address-grid,
.address-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-span-full,
.detail-span-full,
.address-grid,
.modal-table-wrap {
  grid-column: 1 / -1;
}

.address-grid {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  margin-bottom: 10px;
}

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

.modal-body.modal-table-wrap {
  padding: 0;
}

.detail-section {
  margin-bottom: 22px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.detail-section h4 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.detail-section-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-section-title {
  color: var(--dark);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.detail-section-title i {
  color: var(--primary);
}

.detail-section-count {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.detail-section-body {
  padding: 14px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.detail-list-item .label,
.detail-note .label,
.info-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list-item .value,
.detail-note .value,
.info-value {
  margin-top: 3px;
  color: var(--dark);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.detail-note {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.detail-table th,
.detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.detail-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.detail-table tr:last-child td {
  border-bottom: 0;
}

.modal-form-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.compact-textarea {
  min-height: 86px;
  resize: vertical;
}

.form-help {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.detail-item label {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.detail-item div {
  margin-top: 2px;
  color: var(--dark);
  font-weight: 700;
}

.readonly-field {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--dark);
}

.detail-card {
  min-height: 40px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--dark);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.detail-card.primary {
  color: var(--primary);
  font-weight: 800;
}

.detail-card.note {
  border-color: #fed7aa;
  background: #fff7ed;
}

.detail-panel {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.detail-panel label {
  color: var(--dark);
}

.detail-holder {
  background: #ecfeff;
  color: #155e75;
}

.detail-meta {
  font-size: 0.9rem;
  line-height: 1.55;
}

.qr-print-container {
  text-align: center;
}

.qr-code-display {
  display: inline-block;
  margin: 0 auto 12px;
  padding: 18px;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  background: #ffffff;
}

#qrCanvas {
  min-width: 180px;
  min-height: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-labels {
  margin-top: 12px;
}

.qr-label {
  color: var(--dark);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.qr-meta,
.qr-original,
.qr-label.qr-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

/* Alerts/loading/skeletons */
.alert,
.error-message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
}

.alert-success {
  border: 1px solid rgba(46, 196, 182, 0.35);
  background: #e0fbf6;
  color: #0f5132;
}

.alert-error,
.error-message {
  border: 1px solid rgba(231, 29, 54, 0.35);
  background: #fceceb;
  color: #842029;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

.is-hidden {
  display: none !important;
}

.loading-spinner,
.spinner {
  color: var(--primary);
  font-size: 2rem;
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.25s ease infinite;
}

.skeleton-text {
  height: 14px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.text-warning {
  color: var(--warning);
}

.text-muted {
  color: var(--text-muted);
}

/* Round detail support */
.list-header {
  color: var(--primary);
  font-weight: 800;
}

.history-details-content {
  padding: 18px !important;
  border-top: 1px dashed var(--border-color);
  background: #f8fafc;
}

.detail-empty-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.details-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.details-grid li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .dashboard-header {
    position: static;
    padding: 14px 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-right,
  .header-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-main,
  .dashboard-container {
    padding: 18px 14px;
  }

  .inventory-toolbar,
  .inventory-filter-header,
  .filter-card-header,
  .table-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-actions,
  .table-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .last-sync {
    width: auto;
  }

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

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .reports-nav,
  .primary-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .reports-filters-grid {
    grid-template-columns: 1fr;
  }

  .reports-generate-group .btn {
    min-width: 0;
  }

  .reports-workspace .report-tabs {
    margin-right: 12px;
    margin-left: 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .reports-workspace .tab-btn {
    flex: 0 0 auto;
  }

  .admin-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-table-toolbar .search-wrapper,
  .admin-table-toolbar .filters-wrapper,
  .admin-table-toolbar .btn,
  .admin-table-toolbar select {
    width: 100%;
  }

	  .admin-form-grid,
	  .admin-stats-grid,
	  .admin-role-grid,
	  .role-checkbox-grid {
	    grid-template-columns: 1fr 1fr;
	  }

  .admin-permission-group .role-checkbox-grid {
    grid-template-columns: minmax(180px, 1fr);
  }

  .filter-actions,
  .form-actions,
  .action-row {
    width: 100%;
  }

  .filter-actions .btn,
  .form-actions .btn,
  .action-row .btn {
    flex: 1;
  }

  .entry-row-grid {
    grid-template-columns: 1fr;
  }

  .entry-remove {
    width: 100%;
  }

  .table-responsive {
    max-height: none;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 20px;
  }

  .login-card {
    padding: 26px 20px;
  }

  .header-left h1,
  .header-content h1 {
    font-size: 1.12rem;
  }

  .stats-container,
  .summary-grid,
  .customers-grid,
  .customer-sales-grid {
    grid-template-columns: 1fr;
  }

  .filter-card,
  .details-container,
  .summary-card,
  .stat-card {
    border-radius: 10px;
  }

  .modal,
  .modal-overlay,
  .log-details-modal {
    padding: 10px;
    align-items: flex-start;
  }

  .modal-content,
  .modal-container {
    width: 100%;
    max-height: calc(100vh - 20px);
  }

  .modal-footer {
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1;
  }

  .inventory-toolbar,
  .inventory-filter-card {
    padding: 15px;
  }

  .inventory-actions .btn,
  .inline-actions .btn,
  .table-tools .filter-select {
    flex: 1;
  }

  .inventory-actions .filter-count,
  .inventory-actions .last-sync {
    flex: 1 1 100%;
    justify-content: center;
  }

  .reports-nav .nav-link,
  .reports-nav .dropdown,
  .reports-nav .dropdown-btn,
  .reports-nav .btn-logout {
    width: 100%;
  }

  .reports-nav .dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }

  .admin-header-actions,
  .admin-form-actions,
  .admin-form-actions .btn {
    width: 100%;
  }

  .admin-form-grid,
  .admin-stats-grid,
  .admin-role-grid {
    grid-template-columns: 1fr;
  }

  .role-checkbox-grid,
  .admin-permission-group .role-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel-body,
  .admin-table-toolbar {
    padding: 14px;
  }

  .compact-stats {
    grid-template-columns: 1fr 1fr;
  }

  .quick-filter {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .qr-print-container,
  .qr-print-container * {
    visibility: visible;
  }

  .qr-print-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .modal,
  .modal-content {
    position: static;
    box-shadow: none;
    background: #ffffff;
  }

  .modal-header,
  .modal-footer,
  .btn,
  .nav-btn {
    display: none !important;
  }
}
