/* styles.css - Modern Offline 1-Page Layout for Paper Plate Design Store */

:root {
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --primary-light: #e8f0fe;
  --secondary: #5f6368;
  --bg-app: #f1f3f4;
  --bg-surface: #ffffff;
  --bg-hover: #f8f9fa;
  --text-main: #202124;
  --text-muted: #5f6368;
  --border: #dadce0;
  --border-focus: #1a73e8;
  --success: #1e8e3e;
  --success-hover: #137333;
  --danger: #d93025;
  --danger-hover: #b31412;
  --warning: #f9ab00;
  --whatsapp: #25d366;
  --whatsapp-hover: #1ebd5b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(60,64,67, 0.12), 0 1px 2px rgba(60,64,67, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.15), 0 8px 10px -6px rgba(0,0,0,0.1);
  --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Noto Sans Tamil', 'Latha', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

/* --- Top Bar --- */
.top-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  flex-shrink: 0;
}

.shop-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.shop-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 2px 5px rgba(26,115,232,0.3);
}

.shop-info {
  display: flex;
  flex-direction: column;
}

.shop-name-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #172b4d;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-edit-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.top-bar-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 640px;
}

.search-box-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #80868b;
  font-size: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  background: #f1f3f4;
  border: 1px solid transparent;
  border-radius: 24px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #70757a;
  cursor: pointer;
  font-size: 14px;
  display: none;
  border-radius: 50%;
  padding: 2px 6px;
}

.search-clear-btn:hover {
  background: #e0e0e0;
}

.filter-size-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-size-select {
  padding: 9px 14px;
  background: #f1f3f4;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-size-select:focus {
  border-color: var(--primary);
  background: #fff;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #f8f9fa;
  border-color: #c0c4c9;
}

.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-whatsapp {
  background: var(--whatsapp);
  color: #fff;
}
.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* --- Main Layout --- */
.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Left / Centre Gallery */
.gallery-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #eef2f6;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.gallery-header-bar {
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gallery-stats {
  font-weight: 600;
  color: #374151;
}

.gallery-scroll-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.designs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  align-content: start;
}

/* Empty State */
.empty-gallery-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 40px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 54px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.empty-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.empty-desc {
  max-width: 420px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Design Card */
.design-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.design-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.design-card.active-preview {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}

.design-card.is-selected {
  background: #f0f7ff;
}

.card-select-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
}

.card-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--primary);
  border-radius: 4px;
}

.card-size-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(17, 24, 39, 0.75);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  z-index: 5;
}

.card-thumb-wrapper {
  width: 100%;
  aspect-ratio: 1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
}

.card-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.design-card:hover .card-thumb-wrapper img {
  transform: scale(1.04);
}

.card-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-code {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Right Preview Panel --- */
.preview-panel {
  width: 380px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -2px 0 6px rgba(0,0,0,0.04);
  flex-shrink: 0;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 30px;
  color: var(--text-muted);
  text-align: center;
}

.preview-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.preview-img-container {
  width: 100%;
  height: 280px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--border);
  cursor: zoom-in;
}

.preview-img-container img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

.zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
}

.preview-details {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-code-badge {
  display: inline-block;
  align-self: flex-start;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.preview-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.preview-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.preview-meta-label {
  font-weight: 600;
  color: var(--text-muted);
}

.preview-meta-val {
  font-weight: 600;
  color: #1e293b;
}

.preview-notes-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
}

.preview-actions {
  padding: 16px 20px;
  background: #fcfcfd;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* --- Bottom Bar --- */
.bottom-bar {
  background: #1e293b;
  color: #fff;
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.selection-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.selection-count-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 16px;
}

.selection-helper-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 6px;
}

.selection-helper-btn:hover {
  color: #fff;
}

.bottom-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Pop-up Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px);
  transition: transform 0.2s ease;
}

.modal-dialog.modal-lg {
  max-width: 840px;
}

.modal-dialog.modal-xl {
  max-width: 1020px;
}

.modal-overlay.open .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 14px 22px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.form-input, .form-select, .form-textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Drag and Drop Zone */
.dropzone {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius-md);
  padding: 28px 16px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dropzone:hover, .dropzone.drag-active {
  background: #eff6ff;
  border-color: var(--primary);
}

.dropzone-icon {
  font-size: 38px;
  color: var(--primary);
}

.dropzone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Batch Upload Preview List */
.batch-preview-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
}

.batch-item-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px;
}

.batch-thumb {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #cbd5e1;
}

.batch-inputs {
  flex: 1;
  display: grid;
  grid-template-columns: 100px 1fr 120px;
  gap: 10px;
}

/* Print Modal Layout */
.print-modal-content {
  display: flex;
  gap: 20px;
  height: 480px;
}

.print-settings-col {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--border);
  padding-right: 18px;
}

.print-preview-col {
  flex: 1;
  background: #525659;
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.print-sheet-mockup,
.print-sheet-mockup iframe {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
}

@media (max-width: 640px) {
  .print-modal-content { flex-direction: column; height: auto; }
  .print-settings-col { width: 100%; border-right: 0; padding-right: 0; }
  .print-preview-col { flex: none; height: 320px; }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 74px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideInToast 0.25s ease forwards;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}
.toast.toast-error {
  border-left: 4px solid var(--danger);
}
.toast.toast-info {
  border-left: 4px solid var(--primary);
}

@keyframes slideInToast {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Customer master */
.customer-window { background: white; width: min(1150px, 96vw); height: 90vh; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.customer-window > header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border); gap: 12px; }
.customer-window p { color: var(--text-muted); margin: 8px 0; overflow-wrap: anywhere; }
.customer-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 0; flex: 1; }
.customer-layout > aside { padding: 16px; border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
#customer-search { margin: 16px 0; }
#customer-list { flex: 1; min-height: 80px; }
#customer-detail { padding: 24px; overflow: auto; user-select: text; }
.customer-list-item { display: block; width: 100%; text-align: left; padding: 14px 10px; margin-bottom: 8px; border: 1px solid var(--border); background: white; border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.customer-list-item.active { background: var(--primary-light); border-color: var(--primary); }
.customer-list-item small { display: block; margin-top: 6px; }
.customer-toolbar, .customer-summary { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0; }
.customer-summary span { background: var(--primary-light); padding: 15px; border-radius: 8px; }
.customer-summary b { margin-left: 8px; }
.customer-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding: 16px 0; }
.customer-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.customer-form > div { grid-column: 1 / -1; }
.customer-order { padding: 18px; border: 1px solid var(--border); border-radius: 10px; margin: 16px 0; }
.customer-order-heading { display: flex; justify-content: space-between; gap: 12px; }
.customer-order details { margin: 14px 0; }
.customer-order summary { cursor: pointer; color: var(--primary); }
.customer-overdue { color: var(--danger); }

/* Customer pagination (sidebar) */
.customer-pagination {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.customer-pagination-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.customer-pagination-info {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
}
.customer-pagination-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* Orders and table pagination bar */
.orders-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.orders-pagination-summary {
  font-size: 0.85rem;
  color: #475569;
}
.orders-pagination-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.orders-per-page {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.orders-per-page select {
  padding: 4px 8px;
  font-size: 0.82rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
}
.orders-pagination-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.orders-pagination-nav .page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.orders-pagination-nav .page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.orders-pagination-nav .page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 700;
}
.orders-pagination-nav .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.orders-pagination-nav .page-dots {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
@media (max-width: 800px) { .top-bar { height: auto; flex-wrap: wrap; padding: 10px; } .customer-layout { grid-template-columns: 180px 1fr; } .customer-form { grid-template-columns: 1fr; } #customer-detail { padding: 12px; } }
@media (max-width: 540px) { .customer-layout { grid-template-columns: 1fr; overflow: auto; } .customer-layout > aside { max-height: 210px; } #customer-detail { overflow: visible; } }

/* Chronological customer order list */
.order-filter-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#order-results { overflow-x: auto; }
.customer-orders-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.customer-orders-table th, .customer-orders-table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.customer-orders-table th { background: var(--primary-light); white-space: nowrap; }
.customer-orders-table small { display: block; margin-top: 5px; color: var(--text-muted); }
.customer-orders-table td:nth-child(3), .customer-orders-table td:nth-child(4) { white-space: nowrap; }

/* ================= ADMIN AUTH STYLES ================= */
.admin-auth-bar {
  display: flex;
  align-items: center;
}
.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}
.admin-pill-dot {
  color: #10b981;
  font-size: 0.75rem;
}
.admin-pill-role {
  opacity: 0.8;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-pill strong {
  font-weight: 700;
  color: #047857;
}

/* Form icon input & toggle button */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}
.input-with-icon .form-input {
  padding-left: 38px;
  padding-right: 42px;
  width: 100%;
}
.btn-toggle-pwd {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  padding: 4px;
  opacity: 0.65;
  transition: opacity 0.15s;
  z-index: 2;
}
.btn-toggle-pwd:hover {
  opacity: 1;
}

.auth-error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.4;
}
.auth-hint-box {
  background: #f8fafc;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.auth-hint-box:hover {
  background: #eff6ff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}
.auth-hint-box:active {
  transform: translateY(0);
  background: #dbeafe;
}
.autofill-badge {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
  background: #e0e7ff;
  padding: 2px 8px;
  border-radius: 12px;
  transition: all 0.2s ease;
}
.auth-hint-box:hover .autofill-badge {
  background: var(--primary);
  color: white;
}

/* ================= LOGIN GATE SCREEN (BEFORE ENTERING WEBSITE) ================= */
.login-gate-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body:not(.app-locked) .login-gate-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.app-locked .top-bar,
body.app-locked .main-content,
body.app-locked .bottom-bar {
  display: none !important;
}

.login-gate-card {
  background: white;
  width: min(440px, 94vw);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  padding: 32px 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: gate-card-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gate-card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-gate-header {
  text-align: center;
  margin-bottom: 22px;
}

.login-gate-logo {
  font-size: 3rem;
  margin-bottom: 8px;
  display: inline-block;
}

.login-gate-title {
  font-size: 1.35rem;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-gate-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

