/* style.css */
:root {
  --red-primary: #b91c1c;
  --red-dark: #991b1b;
  --red-light: #fef2f2;
  --red-border: #fecaca;
  --white: #ffffff;
  --gray-bg: #f8fafc;
  --gray-border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --success: #15803d;
  --warning: #b45309;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background: var(--gray-bg);
  color: var(--text-main);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* Navbar */
.navbar {
  background: var(--red-primary);
  color: var(--white);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  background: var(--white);
  color: var(--red-primary);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.85rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons & Inputs */
.btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary {
  background: var(--red-primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-white {
  background: var(--white);
  color: var(--red-primary);
}

.btn-white:hover {
  background: var(--red-light);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--red-primary);
  color: var(--red-primary);
}

.btn-outline:hover {
  background: var(--red-light);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.8rem;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-border);
  border-radius: 8px;
  font-size: 0.92rem;
  margin-top: 4px;
  background: var(--white);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red-primary);
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: block;
  margin-top: 12px;
}

/* Private Auth Landing Page */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--red-primary) 0%, #7f1d1d 100%);
}

.auth-card {
  background: var(--white);
  width: 100%;
  max-width: 460px;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: var(--red-primary);
  color: var(--white);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-border);
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.auth-tab.active {
  color: var(--red-primary);
  border-bottom-color: var(--red-primary);
}

/* Main Container & Cards */
.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--gray-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red-primary);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--red-border);
  padding-bottom: 8px;
}

/* Tabs Menu */
.menu-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.menu-tab {
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
}

.menu-tab.active {
  background: var(--red-primary);
  color: var(--white);
  border-color: var(--red-primary);
}

/* Grid & Stats */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.stat-box {
  background: var(--white);
  border-left: 4px solid var(--red-primary);
  padding: 16px;
  border-radius: 10px;
  border-top: 1px solid var(--gray-border);
  border-right: 1px solid var(--gray-border);
  border-bottom: 1px solid var(--gray-border);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

/* Service Package Card */
.pkg-card {
  border: 2px solid var(--gray-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: 0.2s;
}

.pkg-card.selected {
  border-color: var(--red-primary);
  background: var(--red-light);
}

.pkg-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--red-primary);
  margin: 6px 0;
}

/* Badges */
.badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

.badge-wait {
  background: #fef3c7;
  color: #92400e;
}

.badge-proc {
  background: #dbeafe;
  color: #1e40af;
}

.badge-done {
  background: #dcfce7;
  color: #166534;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-border);
  vertical-align: top;
}

th {
  background: var(--red-light);
  color: var(--red-primary);
  font-weight: 700;
}

/* Map & Avatar */
#mapPicker {
  height: 260px;
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid var(--gray-border);
  margin-top: 8px;
  z-index: 1;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--red-primary);
  background: #eee;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
}

.modal-box {
  background: var(--white);
  border-radius: 14px;
  max-width: 540px;
  width: 100%;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Print Receipt Styling */
@media print {
  body * {
    visibility: hidden;
  }
  #printReceiptArea, #printReceiptArea * {
    visibility: visible;
  }
  #printReceiptArea {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    padding: 30px;
    background: white;
    color: black;
  }
  .no-print {
    display: none !important;
  }
}