/* =========================
   WELE HOUSE OF DECOR
   ENTERPRISE UI SYSTEM
   ========================= */

:root {
  --bg: #f5f7fb;
  --bg-soft: #fafbfc;
  --panel: #ffffff;
  --panel-2: #f9fafb;

  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;

  --gold: #c9a227;
  --gold-2: #b68d13;
  --gold-soft: #f8f0cc;

  --navy: #0f1c33;
  --navy-2: #162845;
  --navy-3: #1f3558;

  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #0ea5e9;

  --line: rgba(15, 23, 42, 0.10);
  --line-strong: rgba(15, 23, 42, 0.16);

  --shadow-xs: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.14);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --transition-fast: 0.18s ease;
  --transition: 0.28s ease;

  --max-width: 1240px;

  --font-main: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
}

/* =========================
   RESET
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(201, 162, 39, 0.08), transparent 30%),
    radial-gradient(circle at top right, rgba(15, 28, 51, 0.05), transparent 25%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.app-body {
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  text-decoration: none;
}

/* =========================
   SCROLLBAR
   ========================= */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gold) #edf2f7;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: #edf2f7;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  border-radius: 999px;
}

/* =========================
   APP SHELL
   ========================= */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
}

/* =========================
   ENTERPRISE HEADER
   ========================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.app-header-inner,
.app-header {
  width: 100%;
}

.app-header {
  padding: 0.85rem 1.25rem;
}

.app-header::after {
  content: "";
  display: block;
  clear: both;
}

.app-header-left {
  float: left;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.app-header-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.app-header-branch {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* =========================
   NAV LINKS
   ========================= */
.nav-links {
  float: right;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-soft);
  font-size: 0.88rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 700;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.nav-links a:hover {
  background: #fff;
  border-color: var(--line);
  color: var(--navy);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

.nav-links a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(201, 162, 39, 0.24);
}

.nav-links a#logoutBtn {
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
}

.nav-links a#logoutBtn:hover {
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

/* =========================
   PAGE SECTIONS
   ========================= */
.quote-section,
.invoice-section,
.activity-card,
.branch-widget,
.chart-card,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.quote-section,
.invoice-section,
.activity-card,
.branch-widget {
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
}

h1,
h2,
h3 {
  color: var(--navy);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.08rem;
  font-weight: 800;
  margin: 0 0 0.85rem;
}

h3 {
  font-size: 0.98rem;
  font-weight: 700;
}

p {
  margin: 0;
}

/* =========================
   KPI GRID
   ========================= */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 0.95rem;
  margin-bottom: 1rem;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 1rem 1rem;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition-fast);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  opacity: 0.9;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(201, 162, 39, 0.35);
}

.card-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.card-value {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 900;
  color: var(--navy);
  line-height: 1.15;
}

.card-sub {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

/* =========================
   CHARTS
   ========================= */
.charts-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-card {
  padding: 1rem 1rem 0.85rem;
  min-height: 320px;
}

.chart-card .card-title {
  margin-bottom: 0.8rem;
}

.chart-card canvas {
  width: 100% !important;
  height: 260px !important;
}

/* =========================
   BRANCH SNAPSHOT
   ========================= */
.branch-widget {
  margin-bottom: 1rem;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.branch-card {
  background: linear-gradient(180deg, #ffffff, #fcfcfd);
  border: 1px solid rgba(201, 162, 39, 0.24);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.branch-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(201, 162, 39, 0.45);
}

.branch-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold-2);
  margin-bottom: 0.55rem;
}

.branch-line {
  font-size: 0.86rem;
  color: var(--text-soft);
  margin-top: 0.3rem;
}

/* =========================
   FORMS
   ========================= */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-size: 0.88rem;
}

.field label {
  font-weight: 700;
  color: var(--text-soft);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0.72rem 0.82rem;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(201, 162, 39, 0.7);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.14);
  background: #fffdf5;
  transform: translateY(-1px);
}

/* =========================
   FORM GRIDS
   ========================= */
.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

/* =========================
   BUTTONS
   ========================= */
button {
  font-family: inherit;
}

.btn-primary,
.btn-secondary,
.btn-soft {
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background var(--transition-fast);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 10px 24px rgba(201, 162, 39, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 14px 26px rgba(201, 162, 39, 0.34);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  box-shadow: 0 10px 24px rgba(15, 28, 51, 0.20);
}

.btn-soft {
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.btn-soft:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

/* =========================
   TABLES
   ========================= */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

thead th,
.th {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0.65rem;
  text-align: left;
}

tbody td {
  padding: 0.78rem 0.65rem;
  font-size: 0.88rem;
  color: var(--text);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

tbody tr:nth-child(even) {
  background: #fcfcfd;
}

tbody tr:hover {
  background: #fffdf5;
}

/* =========================
   ACTIVITY
   ========================= */
.activity-card {
  margin-bottom: 1rem;
}

.activity-list,
#activityList {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
}

#activityList li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  background: linear-gradient(180deg, #ffffff, #fafbfc);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.72rem 0.8rem;
}

#activityList li span:first-child {
  color: var(--text);
  font-size: 0.87rem;
  line-height: 1.45;
}

.activity-time {
  color: var(--text-muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

/* =========================
   LOGIN / AUTH
   ========================= */
.auth-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at top left, rgba(201, 162, 39, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(15, 28, 51, 0.10), transparent 26%),
    linear-gradient(180deg, #fcf8ea 0%, #f4f7fb 100%);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(15, 28, 51, 0.96);
  color: #fff;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 28px;
  padding: 1.6rem 1.4rem 1.25rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.30);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(201, 162, 39, 0.14), transparent 35%),
    radial-gradient(circle at bottom, rgba(255, 255, 255, 0.05), transparent 40%);
  pointer-events: none;
}

.auth-header,
.auth-form,
.footer-note {
  position: relative;
  z-index: 1;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.2rem;
}

.auth-header .logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.9rem;
  border-radius: 18px;
  border: 2px solid rgba(201, 162, 39, 0.7);
  box-shadow: 0 10px 26px rgba(201, 162, 39, 0.22);
}

.auth-header h1 {
  font-size: 1.85rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 0.45rem;
}

.subtitle {
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.80);
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.auth-form .field label {
  color: rgba(255, 255, 255, 0.90);
}

.auth-form input {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  border: 1px solid rgba(201, 162, 39, 0.16);
  padding: 0.9rem 1rem;
  border-radius: 16px;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.auth-form input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(201, 162, 39, 0.62);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.14);
}

.auth-form .btn-primary {
  width: 100%;
  padding: 0.92rem 1rem;
  font-size: 1rem;
  margin-top: 0.4rem;
}

.footer-note {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.error-msg {
  color: #fecaca;
  font-size: 0.84rem;
  min-height: 1.1rem;
  margin-top: 0.1rem;
}

/* =========================
   SMALL UTILITY BLOCKS
   ========================= */
.section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.kicker {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.center {
  text-align: center;
}

/* =========================
   MOBILE / TABLET
   ========================= */
@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-header {
    padding: 0.8rem 0.85rem;
  }

  .app-header-left,
  .nav-links {
    float: none;
  }

  .app-header-left {
    margin-bottom: 0.65rem;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .app-main {
    padding: 1rem 0.85rem 1.5rem;
  }

  .grid-two,
  .grid-three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    gap: 0.32rem;
  }

  .nav-links a {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  .app-header-title {
    font-size: 0.93rem;
  }

  .logo {
    width: 36px;
    height: 36px;
  }

  .grid-cards {
    grid-template-columns: 1fr;
  }

  .quote-section,
  .invoice-section,
  .activity-card,
  .branch-widget,
  .chart-card,
  .card {
    border-radius: 16px;
  }

  .auth-card {
    padding: 1.25rem 1rem 1rem;
    border-radius: 22px;
  }

  .auth-header h1 {
    font-size: 1.5rem;
  }

  .auth-header .logo {
    width: 56px;
    height: 56px;
  }

  .btn-primary,
  .btn-secondary,
  .btn-soft {
    width: 100%;
  }

  table {
    min-width: 760px;
  }
}
.nav-links {
  visibility: hidden;
}

.nav-links.guard-ready {
  visibility: visible;
}
.calendar-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-top: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.calendar-event {
  padding: 8px 12px;
  margin: 6px 0;
  background: #f7f7f7;
  border-left: 4px solid #caa463;
  border-radius: 6px;
  font-size: 13px;
}
/* =========================
   FINAL PREMIUM UI UPGRADE
   ========================= */

/* smoother layout rhythm */
.quote-section,
.invoice-section,
.activity-card,
.branch-widget,
.chart-card,
.card,
.calendar-card {
  position: relative;
}

.quote-section::before,
.invoice-section::before,
.activity-card::before,
.branch-widget::before,
.chart-card::before,
.calendar-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

/* section headers feel stronger */
.quote-section h2,
.invoice-section h2,
.activity-card h2,
.branch-widget h2,
.chart-card h2,
.calendar-card h2,
.section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.quote-section h2::before,
.invoice-section h2::before,
.activity-card h2::before,
.branch-widget h2::before,
.chart-card h2::before,
.calendar-card h2::before,
.section-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 0 0 5px rgba(201, 162, 39, 0.12);
}

/* filter bars / search rows */
.filters-row,
.toolbar,
.top-filters,
.filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}

@media (max-width: 900px) {
  .filters-row,
  .toolbar,
  .top-filters,
  .filter-bar {
    grid-template-columns: 1fr;
  }
}

/* better table wrapper */
.table-wrap,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

/* stronger tables */
table {
  border-spacing: 0;
}

thead th,
.th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #f9fbfd, #f1f5f9);
}

tbody tr {
  transition: background var(--transition-fast), transform var(--transition-fast);
}

tbody tr:hover {
  background: #fffcf3;
}

tbody td strong {
  color: var(--navy);
}

/* invoice and quote numbers */
.code-text,
.invoice-code,
.quote-code {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* action buttons inside tables */
td button,
.actions button,
.action-group button {
  box-shadow: none;
}

td button:hover,
.actions button:hover,
.action-group button:hover {
  transform: translateY(-1px);
}

/* premium message banners */
#invoiceMessage,
#repMessage,
#errorMsg,
#authError,
.message-box,
.status-message {
  min-height: 1.1rem;
  margin-top: 0.75rem;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

/* stat cards feel more premium */
.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,250,251,0.98));
}

.card-value {
  letter-spacing: -0.03em;
}

.card-sub {
  line-height: 1.45;
}

/* stronger chart cards */
.chart-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,1), rgba(250,251,252,1));
}

/* better branch cards */
.branch-card {
  position: relative;
  overflow: hidden;
}

.branch-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 92px;
  height: 92px;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.12), transparent 70%);
  pointer-events: none;
}

/* polished search / inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
select,
textarea {
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(201, 162, 39, 0.35);
}

/* placeholder visual improvement */
input::placeholder,
textarea::placeholder {
  color: #9aa7b7;
}

/* status badges */
.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-paid,
.status-paid {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.badge-pending,
.status-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

.badge-approved,
.status-approved {
  background: rgba(14, 165, 233, 0.12);
  color: #075985;
}

.badge-declined,
.status-declined {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

.badge-draft,
.status-draft {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

/* summary emphasis */
.summary-strip,
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.summary-box,
.metric-box {
  background: linear-gradient(180deg, #ffffff, #fafbfd);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow-xs);
}

.summary-box .label,
.metric-box .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 0.28rem;
}

.summary-box .value,
.metric-box .value {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--navy);
}

@media (max-width: 760px) {
  .summary-strip,
  .metrics-strip {
    grid-template-columns: 1fr;
  }
}

/* page intro banner */
.page-hero,
.dashboard-hero,
.module-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background:
    linear-gradient(135deg, rgba(15,28,51,0.98), rgba(31,53,88,0.96));
  color: #fff;
  border-radius: 24px;
  padding: 1.2rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(201, 162, 39, 0.22);
  overflow: hidden;
  position: relative;
}

.page-hero::after,
.dashboard-hero::after,
.module-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -30px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(201,162,39,0.2), transparent 70%);
  pointer-events: none;
}

.page-hero h1,
.dashboard-hero h1,
.module-hero h1 {
  color: #fff;
  margin: 0 0 0.2rem;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.page-hero p,
.dashboard-hero p,
.module-hero p {
  color: rgba(255,255,255,0.78);
  line-height: 1.45;
}

/* calendar */
.calendar-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.calendar-event {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(180deg, #ffffff, #fafaf9);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font-size: 0.84rem;
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
}

.calendar-event strong {
  color: var(--navy);
}

/* scrollable mobile tables */
@media (max-width: 640px) {
  .table-wrap,
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 860px;
  }
}

/* cleaner nav reveal */
.nav-links {
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.nav-links.guard-ready {
  visibility: visible;
  opacity: 1;
}

/* slightly more luxurious page spacing */
.app-main > * + * {
  margin-top: 0;
}

/* dashboard-specific polish */
.dashboard-hero {
  margin-bottom: 1rem;
}

.table-wrap table th:last-child,
.table-wrap table td:last-child {
  text-align: left;
}

#eventCalendar {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.activity-card h2,
.calendar-card h2,
.branch-widget h2,
.chart-card h2 {
  margin-top: 0;
}

.chart-card h2 {
  margin-bottom: 1rem;
}
/* invoices page polish */
.invoice-section {
  padding: 1.2rem;
}

#invoiceMessage {
  margin-top: 0.9rem;
}

.summary-box .value {
  font-size: 1.2rem;
}

.table-wrap td:last-child,
.table-wrap th:last-child {
  white-space: nowrap;
}

.table-wrap td:nth-child(6),
.table-wrap th:nth-child(6) {
  text-align: right;
}

.table-wrap td:nth-child(8),
.table-wrap th:nth-child(8) {
  text-align: right;
}

/* quotes page polish */
#quoteForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#quoteForm .grid-two,
#quoteForm .grid-three {
  margin-bottom: 0;
}

#quoteMessage,
#quoteListMessage {
  margin-top: 0.9rem;
}

#itemsTableBody td:last-child,
#quotesTableBody td:last-child {
  white-space: nowrap;
}

#itemsTableBody td:nth-child(2),
#itemsTableBody td:nth-child(3),
#itemsTableBody td:nth-child(4),
#quotesTableBody td:nth-child(6) {
  text-align: right;
}

#totalDisplay {
  color: var(--gold-2);
}

.quote-section .summary-box .value,
.invoice-section .summary-box .value {
  font-size: 1.15rem;
}

/* reports page polish */
#repMessage {
  margin-top: 0.9rem;
}

#repTableBody td:nth-child(6),
.table-wrap th:nth-child(6) {
  text-align: right;
}

#topClientName,
#topItemName {
  font-size: 1.1rem;
}

#topClientValue,
#topItemQty {
  margin-top: 0.35rem;
}

.invoice-section .summary-strip {
  margin-bottom: 1rem;
}

@media (min-width: 761px) {
  .invoice-section .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.app-header .logo {
  width: 36px;
  height: 36px;
  margin: 0;
}

/* =========================
   ADMIN / CATALOG PAGE
   ========================= */
.admin-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1rem;
  align-items: start;
}

.admin-panel,
.admin-content,
.content-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.admin-panel {
  padding: 1.1rem 1.15rem;
  position: sticky;
  top: 88px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.preview-box {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #ffffff, #fafbfd);
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.preview-box img {
  max-width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 14px;
  display: none;
  margin: 0 auto;
}

.preview-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1.5rem 0;
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-row .btn-primary,
.btn-row .btn-soft {
  min-width: 130px;
}

.admin-content {
  padding: 1.15rem;
}

.toolbar-left h2,
.admin-panel h2,
.admin-content h2 {
  margin: 0;
}

.search,
.filter {
  min-height: 46px;
}

.search {
  min-width: 260px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.filter {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.search:focus,
.filter:focus {
  border-color: rgba(201, 162, 39, 0.7);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.14);
  background: #fffdf5;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.stat {
  background: linear-gradient(180deg, #ffffff, #fafbfd);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow-xs);
}

.stat-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.03em;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.catalog-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.catalog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(201, 162, 39, 0.35);
}

.card-image {
  height: 190px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}

.catalog-card:hover .card-image img {
  transform: scale(1.03);
}

.badge-row {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.36rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.badge-category {
  background: rgba(19, 35, 59, 0.88);
  color: #fff;
}

.badge-available {
  background: rgba(22, 163, 74, 0.92);
  color: #fff;
}

.badge-booked {
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
}

.badge-maintenance {
  background: rgba(245, 158, 11, 0.92);
  color: #fff;
}

.card-body {
  padding: 0.95rem;
}

.catalog-card .card-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 900;
  color: var(--navy);
}

.card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  min-height: 40px;
  margin-bottom: 0.8rem;
  line-height: 1.45;
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
  font-size: 0.82rem;
}

.meta div {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
}

.meta strong {
  display: block;
  color: #334155;
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--gold-2);
  margin-bottom: 0.85rem;
}

.actions {
  display: flex;
  gap: 0.55rem;
}

.actions button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.actions button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.edit-btn {
  background: #e0f2fe;
  color: #075985;
}

.delete-btn {
  background: #fee2e2;
  color: #991b1b;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  background: #fafcff;
  box-shadow: var(--shadow-xs);
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-panel {
    position: static;
    top: auto;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .search,
  .filter {
    width: 100%;
    min-width: 100%;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-row .btn-primary,
  .btn-row .btn-soft {
    width: 100%;
  }
}

/* =========================================
   PRINT / SAVE PDF STYLING
========================================= */
.print-sheet {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 28px;
  background: #ffffff;
  color: #111827;
  font-family: Arial, sans-serif;
}

.print-header {
  display: grid;
  grid-template-columns: 110px 1fr 180px;
  gap: 20px;
  align-items: start;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 2px solid #d4af37;
}

.print-logo {
  width: 100px;
  max-width: 100%;
  object-fit: contain;
}

.print-company h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
}

.print-company p {
  margin: 3px 0;
  font-size: 14px;
  line-height: 1.4;
}

.print-meta {
  text-align: right;
  font-size: 14px;
  line-height: 1.6;
}

.print-meta div {
  margin-bottom: 6px;
}

.print-client-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.print-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafafa;
}

.print-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  color: #6b7280;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  margin-bottom: 20px;
}

.print-table th {
  padding: 10px 8px;
  border-bottom: 2px solid #d4af37;
  border-top: 1px solid #e5e7eb;
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  background: #f8fafc;
}

.print-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

.print-totals {
  width: 320px;
  margin-left: auto;
  margin-top: 18px;
  text-align: right;
}

.print-totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  font-size: 14px;
}

.print-totals .grand-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid #111827;
  font-size: 22px;
  font-weight: 700;
}

.print-payment,
.print-terms {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #d1d5db;
}

.print-payment h3,
.print-terms h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.print-payment p,
.print-terms p {
  margin: 4px 0;
  line-height: 1.5;
  font-size: 13px;
}

.print-footer {
  margin-top: 24px;
  font-size: 13px;
}

.signature {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-top: 26px;
}

.signature div {
  width: 45%;
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid #111827;
  font-size: 13px;
}

/* =========================================
   MOBILE FORM BUTTONS
========================================= */
@media (max-width: 600px) {
  input,
  select,
  button,
  textarea {
    width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    margin-top: 6px;
  }
}

/* =========================================
   PRINT-ONLY BEHAVIOUR
========================================= */
@media print {
  body * {
    visibility: hidden;
  }

  #printQuoteArea,
  #printQuoteArea * {
    visibility: visible;
  }

  #printQuoteArea {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 18px 22px;
    background: #ffffff;
  }

  .print-sheet {
    display: block !important;
  }

  .app-header,
  .nav-links,
  button {
    display: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 10mm;
  }
}
.print-header{
border-bottom:3px solid #c9a227;
}

.print-table th{
border-bottom:2px solid #c9a227;
}

.grand-total{
color:#111;
font-size:22px;
font-weight:700;
}

