/* ============================================================
   Ambal Jewellery — Pawn Broker Style UI
   Purple header, colorful gradient menu buttons
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, sans-serif;
  font-size: 15px;
  background: #f0eef8;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────── */
.top-header {
  background: #6a0dad;
  color: #fff;
  text-align: center;
  padding: 16px 20px;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.top-header .gem { font-size: 22px; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: #6a0dad;
  color: #e0c8ff;
  text-align: center;
  padding: 12px 20px;
  font-size: 13px;
  margin-top: auto;
}

/* ── Page Wrapper ───────────────────────────────────────── */
.page-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 16px;
  width: 100%;
  flex: 1;
}

/* ── Home welcome ───────────────────────────────────────── */
.home-welcome {
  text-align: center;
  margin-bottom: 28px;
}
.home-welcome h2 {
  font-size: 22px;
  font-weight: bold;
  color: #222;
  margin-bottom: 4px;
}
.home-welcome p {
  color: #666;
  font-size: 14px;
}

/* ── Menu Buttons ───────────────────────────────────────── */
.menu-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 580px;
  margin: 0 auto;
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 12px rgba(0,0,0,0.18);
}
.menu-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.22); }
.menu-btn:active { transform: scale(0.98); }

.menu-btn .btn-icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.25);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.menu-btn .btn-text { flex: 1; }
.menu-btn .btn-title { font-size: 15px; font-weight: bold; display: block; margin-bottom: 2px; }
.menu-btn .btn-sub   { font-size: 12px; opacity: 0.88; display: block; }
.menu-btn .btn-arrow { font-size: 18px; opacity: 0.7; flex-shrink: 0; }

/* Gradient colours — matching the screenshot */
.btn-purple  { background: linear-gradient(135deg, #5c3dd8, #7c5ce0); }
.btn-pink    { background: linear-gradient(135deg, #e83e8c, #f06292); }
.btn-cyan    { background: linear-gradient(135deg, #00bcd4, #26c6da); }
.btn-green   { background: linear-gradient(135deg, #00c853, #43e97b); }
.btn-orange  { background: linear-gradient(135deg, #ff9800, #ffb74d); }
.btn-indigo  { background: linear-gradient(135deg, #3949ab, #5c6bc0); }
.btn-red     { background: linear-gradient(135deg, #e53935, #ef5350); }
.btn-teal    { background: linear-gradient(135deg, #00897b, #26a69a); }

/* ── Back button bar ────────────────────────────────────── */
.back-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.back-bar a, .back-bar button {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-back    { background: #6a0dad; color: #fff; }
.btn-back:hover { background: #55099a; }
.btn-action  { background: #fff; color: #6a0dad; border: 2px solid #6a0dad; }
.btn-action:hover { background: #f0eef8; }
.btn-do      { background: #00c853; color: #fff; }
.btn-do:hover { background: #00a844; }
.btn-danger  { background: #e53935; color: #fff; }
.btn-danger:hover { background: #c62828; }

/* ── Section Title ──────────────────────────────────────── */
.section-title {
  font-size: 19px;
  font-weight: bold;
  color: #3a006f;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 3px solid #6a0dad;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Form ───────────────────────────────────────────────── */
.form-box {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 165px;
}
.form-field label {
  font-size: 11px;
  font-weight: bold;
  color: #6a0dad;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-field input,
.form-field select,
.form-field textarea {
  border: 2px solid #d0c0e8;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  width: 100%;
  min-height: 42px;
  background: #faf8ff;
  color: #222;
  transition: border-color 0.15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #6a0dad;
  background: #fff;
}
.form-field textarea { min-height: 72px; resize: vertical; }
.form-field.full { flex: 100%; min-width: 100%; }
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions button, .form-actions a {
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
}
.form-submit { background: #6a0dad; color: #fff; }
.form-submit:hover { background: #55099a; }
.form-cancel { background: #eee; color: #444; }
.form-cancel:hover { background: #ddd; }

/* ── Tables ─────────────────────────────────────────────── */
.table-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 20px;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table th {
  background: #6a0dad;
  color: #fff;
  padding: 11px 12px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0eef8;
  vertical-align: middle;
}
table tbody tr:hover { background: #faf5ff; }
table tbody tr:last-child td { border-bottom: none; }
.td-actions { white-space: nowrap; }
.td-actions a, .td-actions button {
  margin-right: 4px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  min-height: 28px;
}
.btn-view { background: #5c3dd8; color: #fff; }
.btn-edit { background: #00897b; color: #fff; }
.btn-del  { background: #e53935; color: #fff; }
.btn-pdf  { background: #00c853; color: #fff; }
.btn-print { background: #3949ab; color: #fff; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}
.badge-paid    { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.badge-pending { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.badge-late    { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: #e8f5e9; border-left: 4px solid #2e7d32; color: #1b5e20; }
.alert-error   { background: #ffebee; border-left: 4px solid #c62828; color: #8b1a1a; }

/* ── Progress bar ───────────────────────────────────────── */
.prog-wrap { background: #e0d0f5; border-radius: 8px; height: 9px; min-width: 80px; }
.prog-bar  { background: linear-gradient(90deg, #6a0dad, #9c27b0); height: 100%; border-radius: 8px; }

/* ── Invoice box ────────────────────────────────────────── */
.invoice-box {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  max-width: 720px;
  margin-bottom: 20px;
}
.invoice-head {
  background: linear-gradient(135deg, #6a0dad, #3949ab);
  color: #fff;
  padding: 18px 22px;
  border-bottom: 3px solid #f0c040;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.invoice-head .shop h2 { color: #ffe082; font-size: 16px; margin-bottom: 4px; }
.invoice-head .shop p  { font-size: 11px; color: #ccc; line-height: 1.7; }
.invoice-head .inv-info { text-align: right; }
.invoice-head .inv-info h3 { color: #ffe082; font-size: 22px; letter-spacing: 0.15em; }
.invoice-head .inv-info p  { font-size: 12px; color: #ccc; margin-top: 4px; }
.invoice-body { padding: 18px 22px; }
.invoice-parties { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.invoice-party { flex: 1; min-width: 180px; }
.invoice-party .lbl { font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.1em; color: #6a0dad; margin-bottom: 4px; }
.invoice-party .val { font-size: 14px; font-weight: bold; color: #222; }
.invoice-party p    { font-size: 12px; color: #555; margin-top: 2px; line-height: 1.5; }
.invoice-foot {
  background: linear-gradient(135deg, #6a0dad, #3949ab);
  color: #ccc; padding: 10px 22px; font-size: 11px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  border-top: 2px solid #f0c040;
}
.inv-total-block { text-align: right; margin-top: 12px; }
.inv-total-block table { width: auto; margin-left: auto; }
.inv-total-block td { padding: 4px 8px; font-size: 13px; color: #444; }
.inv-total-block .grand td { border-top: 2px solid #6a0dad; font-weight: bold; font-size: 15px; color: #3a006f; padding-top: 8px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .menu-btn { padding: 15px 16px; }
  .menu-btn .btn-icon { width: 36px; height: 36px; font-size: 17px; }
  .menu-btn .btn-title { font-size: 14px; }
  .form-field { min-width: 100%; flex: 100%; }
  .invoice-head { flex-direction: column; }
  .invoice-head .inv-info { text-align: left; }
  .section-title { font-size: 16px; }
  table th, table td { padding: 8px 8px; font-size: 12px; }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .top-header, .site-footer, .back-bar, .inv-actions { display: none !important; }
  body { background: #fff; }
  .invoice-box { box-shadow: none; }
}