/* ─────────────────────────────────────────────
   Bilto — Main Stylesheet  (Light Mode)
   Theme: Industrial Utility / Construction
   Palette: Warm Cream · Amber · Slate
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700;800&display=swap');


:root {
  /* ── Brand ── */
  --brand-orange:       #d95f0a;
  --brand-amber:        #e8a020;
  --brand-amber-light:  #fef3c7;
  --brand-orange-light: #fff1e6;

  /* ── Surface ── */
  --bg-base:       #f5f2ed;   /* warm parchment */
  --bg-surface:    #ffffff;
  --bg-raised:     #faf8f5;
  --bg-sunken:     #ede9e2;
  --bg-sidebar:    #031432;   /* deep slate — keeps industrial contrast */
  --bg-topbar:     #ffffff;

  /* ── Border ── */
  --border-subtle:  #e5e0d8;
  --border-medium:  #d1cbc0;
  --border-strong:  #b8b0a4;

  /* ── Text ── */
  --text-primary:   #1e1b18;
  --text-secondary: #5a534a;
  --text-muted:     #8a8078;
  --text-inverse:   #f0ece4;

  /* ── Semantic ── */
  --clr-success:    #15803d;
  --clr-success-bg: #f0fdf4;
  --clr-danger:     #b91c1c;
  --clr-danger-bg:  #fef2f2;
  --clr-warning:    #b45309;
  --clr-warning-bg: #fffbeb;
  --clr-info:       #1d4ed8;
  --clr-info-bg:    #eff6ff;

  /* ── Layout ── */
  --sidebar-width:  250px;
  --topbar-height:  60px;

  /* ── Shadow ── */
  --shadow-sm:  0 1px 3px rgba(30,27,24,.06), 0 1px 2px rgba(30,27,24,.04);
  --shadow-md:  0 4px 12px rgba(30,27,24,.08), 0 2px 4px rgba(30,27,24,.05);
  --shadow-lg:  0 12px 32px rgba(30,27,24,.12), 0 4px 8px rgba(30,27,24,.06);
}

* { box-sizing: border-box; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ─── SIDEBAR ─── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
  box-shadow: 2px 0 16px rgba(0,0,0,.15);
}
.sidebar.collapsed { transform: translateX(-100%); }

/* ─── SIDEBAR BRAND ─── */
.sidebar-brand {
  padding: 18px 20px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-amber);
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: center;  /* Horizontal center */
  gap: 10px;
  letter-spacing: 0.5px;
  text-align: center;  /* Text center fallback */
}

.sidebar-brand img {
  height: 50px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
  margin: 0 auto;  /* Perfect horizontal centering */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sidebar-brand {
    padding: 16px;
    justify-content: center;
  }
  .sidebar-brand img {
    height: 28px;
    max-width: 160px;
  }
}

@media (max-width: 480px) {
  .sidebar-brand img {
    height: 24px;
    max-width: 140px;
  }
}

.brand-text { color: #f0ece4; }

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255,255,255,.25);
  padding: 14px 20px 4px;
  text-transform: uppercase;
}
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  border-radius: 0 6px 6px 0;
  margin: 1px 8px 1px 0;
}
.sidebar-nav .nav-link:hover {
  color: #f0ece4;
  background: rgba(255,255,255,.06);
}
.sidebar-nav .nav-link.active {
  color: var(--brand-amber);
  background: rgba(232,160,32,.12);
  border-left-color: var(--brand-amber);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--brand-orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
}
.main-content.expanded { margin-left: 0; }

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  border-radius: 8px;
  transition: all .15s;
}
.sidebar-toggle:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.content-area { padding: 24px; flex: 1; }

/* ─── CARDS ─── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  border-radius: 12px 12px 0 0 !important;
}

/* ─── STAT CARDS ─── */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover {
  border-color: var(--brand-amber);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

/* ─── TABLES ─── */
.table {
  color: var(--text-primary);
  font-size: 14px;
}
.table th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-color: var(--border-subtle);
  background: var(--bg-raised);
  padding: 10px 12px;
}
.table td {
  border-color: var(--border-subtle);
  padding: 10px 12px;
  vertical-align: middle;
  color: var(--text-primary);
}
.table-hover tbody tr:hover { background: #faf7f2; }
.table-striped tbody tr:nth-of-type(odd) { background: rgba(0,0,0,.015); }

/* ─── FORMS ─── */
.form-control, .form-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  background: var(--bg-surface);
  border-color: var(--brand-orange);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(217,95,10,.12);
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.form-control::placeholder { color: var(--text-muted); }
.input-group-text {
  background: var(--bg-raised);
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
}

/* ─── BUTTONS ─── */
.btn { border-radius: 8px; font-weight: 600; transition: all .15s; }
.btn-primary {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #fff;
}
.btn-primary:hover {
  background: #c25209;
  border-color: #c25209;
  color: #fff;
  box-shadow: 0 4px 12px rgba(217,95,10,.3);
}
.btn-warning {
  background: var(--brand-amber);
  border-color: var(--brand-amber);
  color: #fff;
  font-weight: 600;
}
.btn-warning:hover {
  background: #cf8e1a;
  border-color: #cf8e1a;
  color: #fff;
  box-shadow: 0 4px 12px rgba(232,160,32,.3);
}
.btn-outline-warning {
  border-color: var(--brand-amber);
  color: var(--brand-orange);
}
.btn-outline-warning:hover {
  background: var(--brand-amber-light);
  color: var(--brand-orange);
  border-color: var(--brand-amber);
}
.btn-outline-secondary {
  border-color: var(--border-medium);
  color: var(--text-secondary);
  background: transparent;
}
.btn-outline-secondary:hover {
  background: var(--bg-sunken);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ─── BADGES ─── */
.badge { font-weight: 600; font-size: 11px; letter-spacing: 0.3px; }

/* ─── STATUS BADGES ─── */
.status-foundation { background: #f1ede6; color: #5a4e3a; border: 1px solid #ddd4c3; }
.status-walls      { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-roofing    { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.status-finished   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ─── PROGRESS BAR ─── */
.progress {
  background: var(--bg-sunken);
  border-radius: 4px;
  height: 8px;
}
.progress-bar {
  background: linear-gradient(90deg, var(--brand-orange), var(--brand-amber));
  border-radius: 4px;
}

/* ─── ALERTS ─── */
.alert { border-radius: 10px; font-size: 14px; font-weight: 500; }
.alert-success { background: var(--clr-success-bg); border-color: #bbf7d0; color: var(--clr-success); }
.alert-danger   { background: var(--clr-danger-bg);  border-color: #fecaca; color: var(--clr-danger); }
.alert-warning  { background: var(--clr-warning-bg); border-color: #fde68a; color: var(--clr-warning); }
.alert-info     { background: var(--clr-info-bg);    border-color: #bfdbfe; color: var(--clr-info); }

/* ─── PUBLIC LAYOUT ─── */
.public-layout { min-height: 100vh; }

/* ─── LANDING PAGE ─── */
.hero-section {
  background: linear-gradient(150deg,  #f5f2ed,  #2a3559, #031432 0% 50%, 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
/* subtle construction-grid texture */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 20, 80, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 20, 80, 0.04), transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.hero-nav {
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(8px);
  position: relative;
}
/* ─── HERO LOGO ─── */
.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;  /* Perfect horizontal centering */
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
}

.hero-logo img {
  height: 48px;      /* Larger for hero prominence */
  width: auto;
  max-width: 280px;  /* Prevents overflow on wide logos */
  max-height: 56px;
  object-fit: contain;
  display: block;
  margin: 0 auto;    /* Fallback centering */
}

/* Responsive hero logo sizing */
@media (max-width: 768px) {
  .hero-logo img {
    height: 50px;
    max-width: 240px;
    max-height: 48px;
  }
}

@media (max-width: 480px) {
  .hero-logo img {
    height: 36px;
    max-width: 200px;
    max-height: 44px;
  }
}

.hero-logo span { color: var(--brand-orange); }

.hero-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  position: relative;
}
.hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 800;
  line-height: 0.95;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.hero-title .accent { color: var(--brand-orange); }
.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 60px;
}
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 28px;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.feature-card:hover {
  border-color: var(--brand-amber);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.feature-icon { font-size: 32px; margin-bottom: 14px; }
.feature-title { font-weight: 700; font-size: 16px; margin-bottom: 8px; color: var(--text-primary); }
.feature-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ─── SUPPLIER FINDER ─── */
.finder-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.finder-body { display: flex; height: calc(100vh - 70px); }
.finder-sidebar {
  width: 380px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}
.finder-map { flex: 1; }
#map { width: 100%; height: 100%; }
.search-panel {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-raised);
}
.results-panel { flex: 1; overflow-y: auto; }
.supplier-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}
.supplier-card:hover { background: #faf7f2; }
.supplier-card.featured { border-left: 3px solid var(--brand-amber); }
.search-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── MODAL ─── */
.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-raised);
  border-radius: 14px 14px 0 0;
}
.modal-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-raised);
  border-radius: 0 0 14px 14px;
}

/* ─── BUHOS CALENDAR ─── */
.buhos-card {
  border-left: 4px solid var(--brand-orange);
  background: var(--brand-orange-light);
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 10px;
}
.buhos-card.upcoming {
  border-left-color: var(--brand-amber);
  background: var(--brand-amber-light);
}
.buhos-card.completed {
  border-left-color: #15803d;
  background: #f0fdf4;
}

/* ─── ATTENDANCE GRID ─── */
.att-cell {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  border-radius: 6px;
}
.att-cell.present { background: #dcfce7; border-color: #86efac !important; color: #15803d; }
.att-cell.half    { background: #fef9c3; border-color: #fde047 !important; color: #854d0e; }
.att-cell.absent  { background: #fee2e2; border-color: #fca5a5 !important; color: #b91c1c; }

/* ─── WALLET ─── */
.wallet-card {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.wallet-balance {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 56px;
  font-weight: 800;
  color: var(--brand-orange);
  line-height: 1;
}

/* ─── FLASH MESSAGES ─── */
.flash-messages { padding: 12px 0 0; }

/* ─── UTILS ─── */
.fw-600 { font-weight: 600; }
.text-orange { color: var(--brand-orange); }
.text-muted { color: var(--text-muted) !important; }
.bg-dark-card { background: var(--bg-raised); }
.border-dark-subtle { border-color: var(--border-subtle) !important; }
.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-left: 4px solid var(--brand-orange);
  padding-left: 12px;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.peso-sign { color: var(--text-muted); font-size: 0.8em; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .finder-body { flex-direction: column; }
  .finder-sidebar { width: 100%; height: 50vh; }
  .finder-map { height: 50vh; }
  .hero-nav { padding: 14px 20px; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }