/* ==========================================================================
   RentFlow styles. Bootstrap 5.3 does the layout; this file only adds
     1. the brand colours (Bootstrap CSS variables)
     2. the app shell (sidebar, top bar)
     3. a few small components Bootstrap does not have (thumbnails, calendar, login page)
   To change the brand colour, edit --brand and --brand-dark below.
   ========================================================================== */

/* ---------- 1. Brand colours -------------------------------------------- */
:root {
  --brand:        #d89f92;
  --brand-dark:   #c98b7c;
  --brand-ink:    #3a2420;   /* text on the brand colour */
  --brand-link:   #a35b4c;

  --bs-font-sans-serif: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: .9rem;
  --bs-body-bg: #f3f4f7;          /* page background: neutral light grey */
  --bs-body-color: #1f2430;
  --bs-secondary-color: #6b7280;
  --bs-tertiary-bg: #f6f7fa;
  --bs-secondary-bg: #eceef3;
  --bs-border-color: #e5e7ee;
  --bs-border-radius: .6rem;
  --bs-border-radius-lg: .85rem;

  --bs-primary: var(--brand);
  --bs-primary-rgb: 216, 159, 146;
  --bs-primary-bg-subtle: #f8e9e5;
  --bs-primary-text-emphasis: #8c4a3c;
  --bs-link-color: var(--brand-link);
  --bs-link-color-rgb: 163, 91, 76;
  --bs-link-hover-color: #8c4a3c;

  --rf-surface: #fff;             /* cards, inputs, top bar */
  --rf-sidebar: #181b26;          /* dark sidebar */
  --rf-sidebar-text: #aeb4c4;
}

[data-bs-theme="dark"] {
  --bs-body-bg: #0f1117;
  --bs-body-color: #e8eaf0;
  --bs-secondary-color: #98a0b3;
  --bs-tertiary-bg: #1b1e29;
  --bs-secondary-bg: #232734;
  --bs-border-color: #2a2e3b;
  --bs-primary-bg-subtle: #3a2a26;
  --bs-primary-text-emphasis: #e4b2a6;
  --bs-link-color: #e4b2a6;
  --bs-link-color-rgb: 228, 178, 166;
  --bs-link-hover-color: #f0c8bd;
  --rf-surface: #171a23;
  --rf-sidebar: #0b0d13;
}

/* Brand button: Bootstrap's .btn-primary, recoloured */
.btn-primary {
  --bs-btn-color: var(--brand-ink);
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand-link);
  --bs-btn-hover-color: var(--brand-ink);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-link);
  --bs-btn-active-color: var(--brand-ink);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-link);
  --bs-btn-disabled-color: var(--brand-ink);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: 216, 159, 146;
}
.btn-light { --bs-btn-bg: var(--rf-surface); --bs-btn-border-color: var(--bs-border-color); }
.btn-whatsapp {
  --bs-btn-color: #fff;
  --bs-btn-bg: #25d366;
  --bs-btn-border-color: #25d366;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #1fb958;
  --bs-btn-hover-border-color: #1fb958;
}

/* Tabs / pills use the brand colour instead of Bootstrap blue */
.nav-pills {
  --bs-nav-pills-link-active-color: var(--brand-ink);
  --bs-nav-pills-link-active-bg: var(--brand);
  --bs-nav-link-color: var(--bs-body-color);
  --bs-nav-link-hover-color: var(--brand-link);
}
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-active-color: var(--brand-ink); --bs-pagination-color: var(--brand-link); }

/* Cards, inputs and tables sit on the "surface" colour */
/* Cards: white surface, thin border, soft shadow, light grey table headers */
.card { --bs-card-bg: var(--rf-surface); --bs-card-cap-bg: transparent; --bs-card-border-color: var(--bs-border-color); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.card-header { background: transparent; border-bottom: 1px solid var(--bs-border-color); padding: .85rem 1.1rem; }
.card > .table-responsive > .table > thead th, .card > .table > thead th { background: var(--bs-tertiary-bg); border-bottom: 1px solid var(--bs-border-color); }
.table a:not(.btn):not(.badge), .list-group-item a:not(.btn):not(.badge) { color: var(--bs-body-color); font-weight: 600; }
.table a:not(.btn):not(.badge):hover, .list-group-item a:not(.btn):not(.badge):hover { color: var(--brand-link); }
.form-control, .form-select, .input-group-text { background-color: var(--rf-surface); }
.form-control:focus, .form-select:focus { border-color: var(--brand-link); box-shadow: 0 0 0 .2rem rgba(216, 159, 146, .3); }
.form-check-input:checked { background-color: var(--brand-link); border-color: var(--brand-link); }
.form-label { font-weight: 600; font-size: .8rem; color: var(--bs-secondary-color); margin-bottom: .25rem; }
.table { --bs-table-bg: transparent; }
.table > thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--bs-secondary-color); font-weight: 600; white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .7rem .9rem; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--bs-tertiary-bg); }
.modal-content { border: 0; border-radius: 1.1rem; background: var(--rf-surface); }
h1, h2, h3, h4, h5 { letter-spacing: -.01em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .list-group-item-action:hover { text-decoration: none; }

.icon { flex: none; vertical-align: -.2em; }

/* ---------- 2. App shell ------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; }

.sidebar {
  --bs-offcanvas-width: 262px;
  --bs-offcanvas-bg: var(--rf-sidebar);
  --bs-offcanvas-color: #fff;
  --bs-offcanvas-border-width: 0;
  background: var(--rf-sidebar);
  color: #fff;
}
.sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 1.2rem .9rem 1rem; }
.sidebar-muted { color: rgba(255, 255, 255, .5); }
.sidebar .nav-link {
  --bs-nav-link-color: var(--rf-sidebar-text);
  --bs-nav-link-hover-color: #fff;
  --bs-nav-pills-link-active-color: #f3c9be;
  --bs-nav-pills-link-active-bg: rgba(216, 159, 146, .16);
  --bs-nav-link-padding-y: .55rem;
  border-radius: .6rem;
  font-weight: 500;
}
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); }
.sidebar .nav-link.active { font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.sidebar .badge { background: var(--brand) !important; color: var(--brand-ink); }
.sidebar .avatar { background: rgba(216, 159, 146, .22); color: #f3c9be; }
.sidebar .btn-light { --bs-btn-bg: rgba(255, 255, 255, .08); --bs-btn-color: #fff; --bs-btn-border-color: transparent; --bs-btn-hover-bg: rgba(255, 255, 255, .18); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: transparent; }
.sidebar .btn-close { filter: invert(1); }
.sidebar .border-top { border-color: rgba(255, 255, 255, .1) !important; }

/* From the "lg" breakpoint the offcanvas becomes a normal fixed column */
@media (min-width: 992px) {
    .sidebar.offcanvas-lg { position: sticky; top: 0; height: 100vh; flex: 0 0 262px; width: 262px; visibility: visible !important; background-color: var(--rf-sidebar) !important; }
}

/* Top bar: white strip with a thin line, grey search box */
.topbar { background: var(--rf-surface); border-bottom: 1px solid var(--bs-border-color); z-index: 1020; }
.topbar .form-control, .topbar .input-group-text { background: var(--bs-tertiary-bg) !important; border-color: transparent; }

.brand-logo {
  display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 42px; height: 42px; border-radius: 13px; background: #fff; color: var(--brand-link);
  box-shadow: 0 4px 14px rgba(90, 45, 35, .18);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo.lg { width: 64px; height: 64px; border-radius: 18px; }
.brand-logo.xl { width: 92px; height: 92px; border-radius: 26px; box-shadow: 0 14px 40px rgba(90, 45, 35, .28); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .7); color: var(--brand-ink); font-weight: 700; font-size: .8rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 84px; height: 84px; font-size: 1.9rem; border-radius: 1.1rem; background: var(--bs-primary-bg-subtle); color: var(--brand-link); }

/* ---------- 3. Components ------------------------------------------------ */

/* Item thumbnails: photo or colour tile */
.thumb, .thumb-sm, .thumb-lg {
  display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: .7rem;
  background: var(--bs-tertiary-bg); font-weight: 700; color: #fff;
}
.thumb    { width: 44px; height: 44px; font-size: 1.1rem; }
.thumb-sm { width: 34px; height: 34px; font-size: .9rem; border-radius: .55rem; }
.thumb-lg { width: 100%; aspect-ratio: 16 / 9; font-size: 2.2rem; border-radius: .8rem; }
.thumb img, .thumb-sm img, .thumb-lg img { width: 100%; height: 100%; object-fit: cover; }
.thumb-color { background: linear-gradient(135deg, var(--swatch), color-mix(in srgb, var(--swatch) 70%, #000)); }

/* KPI cards (dashboard): number on the left, coloured icon chip on the right */
.kpi { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.kpi-label { font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); }
.kpi-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.kpi-hint { font-size: .75rem; color: var(--bs-secondary-color); margin-top: .15rem; }
.kpi-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: .7rem; }

/* Summary strip on the dashboard: several numbers in one card */
.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  background: var(--rf-surface); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); overflow: hidden;
}
.stat-strip > div { padding: .8rem 1rem; border-right: 1px solid var(--bs-border-color); border-bottom: 1px solid var(--bs-border-color); margin: 0 -1px -1px 0; }
.stat-strip span { display: block; font-size: .75rem; color: var(--bs-secondary-color); margin-bottom: .15rem; }
.stat-strip b { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Utilisation bar and simple bar chart (reports) */
.mini-bar { height: 8px; min-width: 90px; border-radius: 99px; background: var(--bs-tertiary-bg); overflow: hidden; }
.mini-bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* Monthly revenue bars (reports) */
.bars { display: flex; align-items: flex-end; gap: .4rem; height: 175px; }
.bars > div { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: .7rem; color: var(--bs-secondary-color); }
.bars b { font-weight: 600; color: var(--bs-body-color); margin-bottom: 2px; }
.bars i { display: block; width: 100%; max-width: 34px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: var(--brand); }

/* Calendar grid */
.cal { border-collapse: separate; border-spacing: 0; }
.cal th, .cal td {
  padding: 0; text-align: center; min-width: 36px; height: 46px; font-size: .75rem;
  border-bottom: 1px solid var(--bs-border-color); border-right: 1px solid var(--bs-border-color);
}
.cal .name { position: sticky; left: 0; z-index: 3; min-width: 230px; text-align: left; padding: .4rem .8rem; background: var(--rf-surface); border-right: 2px solid var(--bs-border-color); }
.cal td.free { cursor: pointer; }
.cal td.free:hover { background: var(--bs-primary-bg-subtle); }
.cal td.sel  { background: var(--brand) !important; color: var(--brand-ink); }
.cal td.range { background: var(--bs-primary-bg-subtle); }
.cal .is-reserved { background: var(--bs-info-bg-subtle);    color: var(--bs-info-text-emphasis);    font-weight: 600; }
.cal .is-picked   { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); font-weight: 600; }
.cal .is-pending  { background: repeating-linear-gradient(45deg, var(--bs-warning-bg-subtle), var(--bs-warning-bg-subtle) 4px, transparent 4px, transparent 8px); }
.cal .is-gap      { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
/* several-piece items: how many pieces are booked that day */
.cal .is-part     { background: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); font-size: .7rem; font-weight: 600; }
.cal .is-full     { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); font-size: .7rem; font-weight: 600; }
.cal .is-overdue  { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); font-weight: 600; }
.cal .is-off      { background: var(--bs-secondary-bg); }
.cal th.today     { color: var(--brand-link); background: var(--bs-primary-bg-subtle); }
.cal td:not(.name) a { display: block; height: 100%; line-height: 46px; color: inherit; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }

/* Booking timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; margin-left: .4rem; border-left: 2px solid var(--bs-border-color); }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid var(--rf-surface); }

/* ---------- Login page --------------------------------------------------- */
.login-art {
  position: relative; overflow: hidden; color: #2b1815;
  background: linear-gradient(155deg, #e6b8ac 0%, #d89f92 48%, #c98a7b 100%);
}
.login-art .ring { position: absolute; border-radius: 50%; border: 56px solid rgba(255, 255, 255, .13); pointer-events: none; }
.login-art .ring.r1 { width: 460px; height: 460px; left: -170px; bottom: -190px; }
.login-art .ring.r2 { width: 300px; height: 300px; right: -90px; top: -100px; }

/* ---------- Print (invoices, QR labels) ---------------------------------- */
@media print {
  .sidebar, .topbar, .no-print, .alert { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
