/* ==========================================================================
   AYLIA-CAISSE - STYLES DE CAISSE ENREGISTREUSE TACTILE & RESPONSIVE
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-hover: #15803d;
  --warning: #f59e0b;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --dark: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pos-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.pos-header {
  height: 64px;
  background-color: var(--dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.header-left .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left .brand i {
  font-size: 1.75rem;
  color: #60a5fa;
}

.header-left h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sub-badge {
  font-size: 0.72rem;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pos-nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.online {
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.clock {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   MAIN CONTENT & TABS
   ========================================================================== */
.pos-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-panel {
  display: none;
  height: 100%;
  padding: 1rem;
  overflow-y: auto;
}

.tab-panel.active {
  display: block;
}

/* ==========================================================================
   ONGLET CAISSE (LAYOUT)
   ========================================================================== */
#tab-caisse {
  padding: 0;
  overflow: hidden;
}

.caisse-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: 100%;
}

/* CATALOG SECTION */
.catalog-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid var(--border-color);
  background: var(--bg-page);
  padding: 1rem;
  overflow: hidden;
}

.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.barcode-icon {
  position: absolute;
  left: 14px;
  font-size: 1.25rem;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 12px 42px 12px 46px;
  font-size: 1.05rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  user-select: text;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}

.categories-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cat-pill {
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.cat-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.cat-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ARTICLES GRID */
.articles-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: min-content;
  gap: 12px;
  padding-right: 4px;
}

.article-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  min-height: 140px;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.article-card:active {
  transform: scale(0.98);
}

.card-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 6px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8px;
}

.card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.card-stock {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--text-muted);
}

.card-stock.low-stock {
  background: #fef3c7;
  color: #b45309;
}

.card-stock.out-of-stock {
  background: #fee2e2;
  color: var(--danger);
}

/* ==========================================================================
   CART SECTION (RIGHT COLUMN)
   ========================================================================== */
.cart-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border-color);
  padding: 1rem;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.cart-header h2 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-items-container {
  flex: 1;
  overflow-y: auto;
  margin: 0.5rem 0;
  padding-right: 4px;
}

.empty-cart-msg {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

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

.item-info {
  flex: 1;
  padding-right: 8px;
}

.item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

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

.item-qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #f8fafc;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.qty-btn:active {
  background: #e2e8f0;
}

.item-qty-val {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.item-total {
  min-width: 65px;
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-left: 8px;
}

.item-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  margin-left: 6px;
}

.item-remove:hover {
  color: var(--danger);
}

/* TOTALS BOX */
.cart-totals {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 1rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.total-row.grand-total {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--dark);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid var(--border-color);
}

.total-row.grand-total span:last-child {
  color: var(--primary);
}

/* PAYMENT BUTTONS */
.payment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.pay-btn {
  height: 64px;
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.pay-btn i {
  font-size: 1.3rem;
}

.pay-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

.pay-btn:not(:disabled):active {
  transform: scale(0.97);
}

.pay-cash {
  background: var(--success);
}
.pay-cash:not(:disabled):hover {
  background: var(--success-hover);
}

.pay-check {
  background: #6366f1;
}
.pay-check:not(:disabled):hover {
  background: #4f46e5;
}

.pay-card {
  background: var(--primary);
}
.pay-card:not(:disabled):hover {
  background: var(--primary-hover);
}

/* ==========================================================================
   PANEL CARD (ARTICLES, JOURNAL, PARAMETRES)
   ========================================================================== */
.panel-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 1400px;
  margin: 0 auto;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sync-info-box {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

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

/* KPI CARDS (JOURNAL) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 2rem;
}

.kpi-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.kpi-card.kpi-main {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  border: none;
}

.kpi-card.kpi-main .kpi-label,
.kpi-card.kpi-main .kpi-sub {
  color: #93c5fd;
}

.kpi-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 6px 0;
}

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

/* TABLES */
.section-block {
  margin-top: 2rem;
}

.section-block h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dark);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

.data-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background: #f1f5f9;
}

.table-total-row {
  background: #e2e8f0;
  font-size: 1rem;
}

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

.table-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.table-filters input {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 320px;
  outline: none;
  user-select: text;
}

/* BADGES */
.badge {
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

/* BUTTONS */
.btn {
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: #f8fafc; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 1.05rem; }

.date-picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.date-picker-group input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.9rem;
}

/* SETTINGS FORM */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 1rem;
}

.settings-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.settings-card h3 {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.9rem;
  user-select: text;
}

.form-group input:focus {
  border-color: var(--primary);
}

.form-checkbox {
  margin-top: 1rem;
}

.form-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.settings-footer {
  grid-column: 1 / -1;
  text-align: right;
  margin-top: 1rem;
}

/* ==========================================================================
   MODALES
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

.modal-footer-spaced {
  justify-content: space-between;
}

.amount-due-box {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.amount-due-box strong {
  font-size: 1.4rem;
  color: var(--dark);
}

/* NUMPAD TACTILE */
.cash-input-display,
.change-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.cash-input-display .val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.change-display .val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--success);
}

.bill-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 1rem 0;
}

.btn-bill {
  padding: 8px;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.1s;
}

.btn-bill:active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.touch-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.num-btn {
  height: 52px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  border-radius: var(--radius-md);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.num-btn:active {
  background: #cbd5e1;
  transform: scale(0.96);
}

/* REVOLUT STATUS */
.revolut-status-box {
  padding: 2rem 1rem;
}

.status-icon-wrapper {
  margin-bottom: 1rem;
}

.pulse-icon {
  font-size: 3rem;
  color: var(--primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* TICKET DE CAISSE (80mm) */
.modal-receipt-content {
  max-width: 400px;
}

.thermal-receipt {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  color: #000;
  line-height: 1.4;
  padding: 10px;
  background: #fff;
  user-select: text;
}

.receipt-center { text-align: center; }
.receipt-bold { font-weight: bold; }
.receipt-title { font-size: 16px; margin-bottom: 4px; }
.receipt-divider {
  border-top: 1px dashed #000;
  margin: 8px 0;
}
.receipt-line {
  display: flex;
  justify-content: space-between;
}

/* TOAST NOTIFICATION */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark);
  color: #fff;
  padding: 12px 24px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success { background: var(--success); }
.toast.danger { background: var(--danger); }
.toast.info { background: var(--primary); }

/* Styles pour tickets annulés */
.ticket-cancelled-row {
  background-color: rgba(239, 68, 68, 0.06) !important;
}
.ticket-cancelled-row td {
  color: var(--text-muted) !important;
}
.cancelled-amount {
  text-decoration: line-through;
  color: var(--danger) !important;
  opacity: 0.85;
}
.receipt-cancelled-banner {
  background: #fee2e2;
  color: #b91c1c;
  border: 2px dashed #b91c1c;
  padding: 8px 12px;
  font-weight: bold;
  text-align: center;
  border-radius: 4px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================================================
   PRINT MEDIA QUERY (POUR IMPRESSION TICKET THERMIQUE 80mm)
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  .modal-receipt-content,
  .modal-receipt-content * {
    visibility: visible;
  }
  .modal-receipt-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm !important;
    box-shadow: none !important;
    border: none !important;
  }
  .no-print {
    display: none !important;
  }
}

/* ==========================================================================
   LOGIN & LOCK SCREEN
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 2.25rem;
  text-align: center;
  animation: slideUp 0.35s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-icon {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  color: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.login-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.login-input-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.login-input-group .input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.login-input-group input {
  width: 100%;
  padding: 0.9rem 2.8rem 0.9rem 2.75rem;
  font-size: 1.15rem;
  letter-spacing: 2px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  color: var(--text-main);
  text-align: center;
  transition: all 0.2s ease;
}

.login-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.btn-toggle-eye {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.1rem;
}

.btn-toggle-eye:hover {
  color: var(--text-main);
}

.login-error-msg {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.login-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 1.25rem;
}

.login-num-btn {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 0.75rem 0;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.login-num-btn:hover {
  background: #e2e8f0;
}

.login-num-btn:active {
  background: #cbd5e1;
  transform: scale(0.96);
}

.login-num-btn.btn-clear {
  color: var(--danger);
}

.login-num-btn.btn-backspace {
  color: var(--text-muted);
}

.btn-login-submit {
  width: 100%;
  padding: 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-hint {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.login-hint code {
  background: var(--bg-page);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--primary);
}

.btn-lock-header {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

.btn-lock-header:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

