/* ============================================================
   RBS - Room Booking System
   Main Stylesheet
   Design: Clean institutional / utilitarian
   Color: Deep teal primary + warm amber accent
   Font: Source Sans 3 (body) + Playfair Display (brand)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --c-primary:       #1a4a5e;   /* deep teal */
  --c-primary-dark:  #123545;
  --c-primary-light: #246480;
  --c-accent:        #d97706;   /* warm amber */
  --c-accent-light:  #f59e0b;
  --c-accent-bg:     #fffbeb;

  --c-white:         #ffffff;
  --c-bg:            #f0f4f7;
  --c-surface:       #ffffff;
  --c-border:        #dce4ea;
  --c-border-strong: #b0c0cb;

  --c-text:          #1a2e3b;
  --c-text-mid:      #4a6070;
  --c-text-muted:    #7a96a8;
  --c-text-inv:      #ffffff;

  --c-success:       #16a34a;
  --c-success-bg:    #f0fdf4;
  --c-success-border:#bbf7d0;
  --c-error:         #dc2626;
  --c-error-bg:      #fef2f2;
  --c-error-border:  #fecaca;
  --c-warning:       #d97706;
  --c-warning-bg:    #fffbeb;
  --c-warning-border:#fde68a;
  --c-info:          #0284c7;
  --c-info-bg:       #f0f9ff;
  --c-info-border:   #bae6fd;

  --c-status-available:    #16a34a;
  --c-status-occupied:     #dc2626;
  --c-status-cleaning:     #d97706;
  --c-status-maintenance:  #7c3aed;
  --c-status-disabled:     #9ca3af;

  --radius-sm:    4px;
  --radius:       6px;
  --radius-md:    8px;
  --radius-lg:    12px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 2px 8px rgba(0,0,0,.10);
  --shadow-md:    0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.15);

  --sidebar-w:          240px;
  --sidebar-collapsed-w: 56px;
  --topnav-h:     56px;
  --transition:   0.18s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--c-primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

h1,h2,h3,h4,h5 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--c-text);
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem;   }

p { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }

img { max-width: 100%; }

/* ============================================================
   AUTH LAYOUT (Login page)
   ============================================================ */
.auth-body {
  background: var(--c-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(36,100,128,.6) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(217,119,6,.15) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--c-white);
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: .02em;
  opacity: .95;
}

.auth-logo span {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-top: .25rem;
}

.login-box {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
}

.login-box h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text-mid);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--c-border);
}

/* ============================================================
   APP LAYOUT (Authenticated pages)
   ============================================================ */

/* Top navigation bar */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: var(--c-primary);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--c-white);
  white-space: nowrap;
  letter-spacing: .01em;
}

.nav-branch {
  flex: 1;
  font-size: .85rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .85rem;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
}

.role-badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--c-accent-light);
}

.btn-end-shift,
.btn-logout {
  background: rgba(217,119,6,.9);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .3rem .85rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
}
.btn-end-shift:hover { background: #b45309; }
.btn-logout { background: rgba(255,255,255,.12); }
.btn-logout:hover { background: rgba(255,255,255,.22); }

/* Sidebar */
.app-wrapper {
  display: flex;
  flex: 1;
  width: 100%;
  padding-top: var(--topnav-h);
  min-height: 100vh;
}

/* Body flex layout (sidebar + main-wrap side by side) */
body:not(.auth-body) {
  display: flex;
  align-items: flex-start;
}

#main-wrap {
  flex: 1;
  min-width: 0;
  transition: margin-left var(--transition);
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--c-primary-dark);
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width 0.22s cubic-bezier(.4,0,.2,1),
              min-width 0.22s cubic-bezier(.4,0,.2,1);
}

/* ── Collapsed state ───────────────────────────────────────── */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
  min-width: var(--sidebar-collapsed-w);
}

/* Brand area */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.1rem 1rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
  overflow: hidden;
  min-height: 56px;
}
.sidebar-logo { font-size: 1.35rem; flex-shrink: 0; }
.sidebar-name { font-size: 1rem; font-weight: 700; letter-spacing: .04em; transition: opacity .15s, width .22s; }

/* Branch + shift info */
.sidebar-branch {
  padding: .6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
  overflow: hidden;
  transition: height .22s, opacity .22s, padding .22s;
}
.sidebar-branch-name { font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.8); }
.sidebar-shift       { font-size: .68rem; color: rgba(255,255,255,.45); margin-top:.15rem; }
.sidebar-branch-select {
  width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9); font-size: .75rem; font-weight: 600;
  border-radius: 4px; padding: .25rem .4rem; cursor: pointer; outline: none;
}
.sidebar-branch-select:hover { background: rgba(255,255,255,.18); }
.sidebar-branch-select option { background: #1e3a4f; color: #fff; }

/* Nav items */
.sidebar-nav { list-style: none; padding: .5rem 0; }

.nav-item     { position: relative; }
.nav-link     {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 1rem;
  font-size: .875rem;
  font-weight: 400;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: color var(--transition), background var(--transition),
              border-color var(--transition);
  border-left: 3px solid transparent;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  text-decoration: none;
}
.nav-link.active,
.nav-item.active > .nav-link {
  color: #fff;
  background: rgba(255,255,255,.10);
  border-left-color: var(--c-accent);
  font-weight: 600;
}

.nav-icon    { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.nav-label   { transition: opacity .15s; }
.nav-chevron { margin-left: auto; font-size: .7rem; transition: transform .2s, opacity .15s; }

.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-sub {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .2s ease;
  background: rgba(0,0,0,.15);
}
.nav-group.open .nav-sub { max-height: 400px; }
.nav-sub li a {
  display: block;
  padding: .4rem 1rem .4rem 2.8rem;
  font-size: .82rem;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-sub li a:hover,
.nav-sub li a.active { color: #fff; }

.nav-section {
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: .9rem 1rem .25rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .15s;
}

/* Footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
  position: sticky;
  bottom: 0;
  background: var(--c-primary-dark);
}
.sidebar-user { flex: 1; overflow: hidden; min-width: 0; }
.sidebar-user-name { font-size: .8rem; color: rgba(255,255,255,.8); overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
.sidebar-user-role { font-size: .68rem; color: rgba(255,255,255,.4); transition: opacity .15s; }
.sidebar-logout,
.sidebar-end-shift {
  color: rgba(255,255,255,.5);
  font-size: 1rem;
  padding: .3rem;
  transition: color var(--transition);
  flex-shrink: 0;
}
.sidebar-end-shift {
  font-size: .68rem;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: .04em;
}
.sidebar-logout:hover  { color: #fff; }
.sidebar-end-shift:hover { color: var(--c-error, #ef4444) !important; }

/* Collapse toggle button */
.sidebar-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.45);
  font-size: .8rem;
  padding: .3rem;
  margin-left: auto;
  flex-shrink: 0;
  transition: color var(--transition), transform .22s;
  line-height: 1;
}
.sidebar-collapse-btn:hover { color: #fff; }
.sidebar.collapsed .sidebar-collapse-btn { transform: rotate(180deg); }

/* ── Collapsed visibility rules ────────────────────────────── */
.sidebar.collapsed .sidebar-name,
.sidebar.collapsed .sidebar-branch,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .sidebar-user,
.sidebar.collapsed .nav-sub {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: .6rem 0;
  border-left: none;
}
.sidebar.collapsed .nav-link.active,
.sidebar.collapsed .nav-item.active > .nav-link {
  background: rgba(255,255,255,.12);
  border-left: none;
  border-right: 3px solid var(--c-accent);
}
.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  gap: .35rem;
  padding: .75rem .4rem;
}
.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 1rem 0;
}

/* Tooltip on hover in collapsed mode */
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(var(--sidebar-collapsed-w) + 6px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,23,42,.92);
  color: #fff;
  font-size: .78rem;
  white-space: nowrap;
  padding: .3rem .65rem;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 200;
}
.sidebar.collapsed .nav-item:hover::after { opacity: 1; }

/* nav-menu rules moved into .sidebar block above */

/* Main content area */
.main-content {
  flex: 1;
  padding: 1.75rem;
  min-width: 0;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.4rem;
}

.page-header-sub {
  font-size: .85rem;
  color: var(--c-text-muted);
  margin-top: .15rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--c-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--c-text);
}

.card-body { padding: 1.25rem; }

.card-footer {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--c-border);
  background: #f8fafc;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: .83rem;
  font-weight: 600;
  color: var(--c-text-mid);
  margin-bottom: .35rem;
  letter-spacing: .02em;
}

.form-group label .required {
  color: var(--c-error);
  margin-left: .15rem;
}

.form-control,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: .55rem .8rem;
  font-size: .9rem;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-white);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  line-height: 1.5;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--c-primary-light);
  box-shadow: 0 0 0 3px rgba(26,74,94,.1);
}

.form-control.is-invalid,
input.is-invalid,
select.is-invalid {
  border-color: var(--c-error);
}

.form-control.is-invalid:focus,
input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.invalid-feedback {
  font-size: .8rem;
  color: var(--c-error);
  margin-top: .3rem;
}

textarea { resize: vertical; min-height: 80px; }

select { cursor: pointer; }

/* Read-only fields (rate, deposit - locked from master) */
.form-control[readonly],
input[readonly] {
  background: #f3f6f8;
  color: var(--c-text-mid);
  cursor: not-allowed;
  border-color: var(--c-border);
}

.form-row {
  display: grid;
  gap: 1rem;
}
.form-row.col-2 { grid-template-columns: 1fr 1fr; }
.form-row.col-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.col-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--c-border);
}

.form-section:last-of-type { border-bottom: none; }

.form-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  font-size: .875rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--c-primary);
  color: var(--c-white);
  border-color: var(--c-primary);
}
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; }

.btn-accent {
  background: var(--c-accent);
  color: var(--c-white);
  border-color: var(--c-accent);
}
.btn-accent:hover { background: #b45309; border-color: #b45309; color: #fff; }

.btn-secondary {
  background: var(--c-white);
  color: var(--c-text-mid);
  border-color: var(--c-border-strong);
}
.btn-secondary:hover { background: var(--c-bg); }

.btn-danger {
  background: var(--c-error);
  color: var(--c-white);
  border-color: var(--c-error);
}
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-success {
  background: var(--c-success);
  color: var(--c-white);
  border-color: var(--c-success);
}
.btn-success:hover { background: #15803d; color: #fff; }

.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-lg { padding: .7rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn[disabled], .btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: .875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.alert-success {
  background: var(--c-success-bg);
  border-color: var(--c-success-border);
  color: #166534;
}

.alert-error {
  background: var(--c-error-bg);
  border-color: var(--c-error-border);
  color: #991b1b;
}

.alert-warning {
  background: var(--c-warning-bg);
  border-color: var(--c-warning-border);
  color: #92400e;
}

.alert-info {
  background: var(--c-info-bg);
  border-color: var(--c-info-border);
  color: #075985;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
}

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

thead th {
  background: #f1f5f8;
  padding: .7rem .9rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--c-text-mid);
  border-bottom: 2px solid var(--c-border);
  white-space: nowrap;
}

tbody td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: #f8fbfd; }

tfoot td {
  padding: .65rem .9rem;
  background: #f8fafc;
  font-weight: 600;
  border-top: 2px solid var(--c-border);
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--c-text-muted); }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.badge-success   { background: var(--c-success-bg);  color: #166534; border: 1px solid var(--c-success-border); }
.badge-error     { background: var(--c-error-bg);    color: #991b1b; border: 1px solid var(--c-error-border);   }
.badge-warning   { background: var(--c-warning-bg);  color: #92400e; border: 1px solid var(--c-warning-border); }
.badge-info      { background: var(--c-info-bg);     color: #075985; border: 1px solid var(--c-info-border);    }
.badge-neutral   { background: #f1f5f8; color: var(--c-text-mid); border: 1px solid var(--c-border-strong);    }
.badge-primary   { background: var(--c-primary); color: #fff; border: 1px solid var(--c-primary-dark);          }
.badge-accent    { background: var(--c-accent);  color: #fff;                                                   }

/* Room status badges */
.status-Available     { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.status-Occupied      { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.status-NeedsCleaning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.status-UnderMaintenance { background: #f5f3ff; color: #5b21b6; border: 1px solid #ddd6fe; }
.status-Disabled      { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }

/* Booking status badges */
.status-Active    { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.status-CheckedOut{ background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; }
.status-Pending   { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.status-Partial   { background: #fdf4ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.status-Converted { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.status-Cancelled { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--c-primary);
}

.stat-card.accent::before   { background: var(--c-accent); }
.stat-card.success::before  { background: var(--c-success); }
.stat-card.error::before    { background: var(--c-error); }
.stat-card.warning::before  { background: var(--c-warning); }
.stat-card.info::before     { background: var(--c-info); }

.stat-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-text-muted);
  margin-bottom: .35rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
}

.stat-sub {
  font-size: .78rem;
  color: var(--c-text-muted);
  margin-top: .3rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 .5rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  font-size: .825rem;
  color: var(--c-text-mid);
  text-decoration: none;
  transition: all var(--transition);
}

.pagination a:hover { background: var(--c-bg); color: var(--c-primary); }
.pagination .current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ============================================================
   PRINT
   ============================================================ */
.no-print { }

@media print {
  .no-print,
  .sidebar,
  .top-nav,
  .btn-group,
  .page-header { display: none !important; }

  /* Force black text everywhere */
  * {
    color: #000 !important;
    background-color: transparent !important;
    background-image: none !important;
  }

  /* Basic layout */
  .app-wrapper { padding-top: 0; }
  .main-content { padding: 0; }
  body {
    background: white;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
  }

  /* Card styling */
  .card {
    box-shadow: none;
    border: 1px solid #000;
    background-color: white;
  }

  /* Print header */
  .print-header,
  .print-only {
    display: block !important;
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #000;
    padding-bottom: 1rem;
    color: #000;
  }

  /* Override fancy styled elements */
  .receipt-no {
    font-family: Arial, Helvetica, monospace;
    font-weight: normal;
    font-size: 10pt;
    color: #000 !important;
    background: transparent !important;
    padding: 0;
    border: none !important;
    border-radius: 0;
    letter-spacing: normal;
  }

  .amount,
  .amount-large {
    color: #000 !important;
    font-weight: normal;
    font-size: 10pt;
  }

  /* Tables */
  table {
    width: 100%;
    border-collapse: collapse;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
  }

  th, td {
    border: 1px solid #000;
    padding: 4pt 6pt;
    text-align: left;
    color: #000;
    background: white;
  }

  th {
    font-weight: bold;
    background-color: white;
    border: 1px solid #000;
  }

  /* Remove colors and styling */
  .text-muted { color: #000 !important; }
  .text-danger { color: #000 !important; }
  .text-success { color: #000 !important; }
  .badge {
    background: white !important;
    color: #000 !important;
    border: 1px solid #000;
  }

  /* Keep functional borders */
  hr, .divider {
    border: none;
    border-top: 1px solid #000;
  }

  /* Headings */
  h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
    font-weight: bold;
    font-size: inherit;
  }

  /* Links */
  a {
    color: #000 !important;
    text-decoration: none;
  }

  /* Form elements visibility */
  .form-control,
  input, select, textarea {
    border: 1px solid #000;
    background: white;
    color: #000;
  }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex-1 { flex: 1; }

.w-100 { width: 100%; }
.text-small { font-size: .8rem; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Courier New', monospace; letter-spacing: .02em; }

.divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 1.25rem 0;
}

/* Receipt number display */
.receipt-no {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: .9rem;
  color: var(--c-primary);
  background: #eef4f8;
  padding: .2rem .55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  letter-spacing: .04em;
}

/* Amount display */
.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.amount-large {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-primary);
}

/* ── Status Bar (sticky bottom footer) ─────────────────────────── */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  height: 2rem;
  background: #fff;
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  font-size: .72rem;
  color: var(--c-text-muted, #6b7280);
  gap: 1rem;
}
.status-bar-left,
.status-bar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  white-space: nowrap;
}
.status-bar-sep {
  color: var(--c-border);
}
/* Push main content up so it's not hidden behind status bar */
body:not(.auth-body) .main-content {
  padding-bottom: 2.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  body:not(.auth-body) { flex-direction: column; }
  .form-row.col-2,
  .form-row.col-3,
  .form-row.col-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 1rem; }
  .status-bar-right { display: none; }
}
