/* Cooley Construction App — UI v2 */

:root {
  --cooley-blue:    #1a3a5c;
  --cooley-blue-mid:#234e7a;
  --cooley-orange:  #d4622a;
  --cooley-orange-lt:#f0874e;
  --cooley-light:   #f8f6f2;
  --sidebar-w:      250px;
  --header-h:       64px;
  --radius:         8px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 4px 12px rgba(0,0,0,.10);
  --transition:     .18s ease;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1e2a38;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Sidebar ── */
.nav-header {
  background: var(--cooley-blue);
  height: var(--header-h);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  z-index: 1100;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.dlabnav {
  background: var(--cooley-blue);
  width: var(--sidebar-w);
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 2px 0 12px rgba(0,0,0,.15);
  transition: transform var(--transition);
}

.dlabnav-scroll { padding: 0.75rem 0 2rem; }

/* Sidebar section label */
.nav-label {
  color: rgba(255,255,255,.35);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 1.25rem 1.25rem 0.35rem;
  display: block;
}

.metismenu { list-style: none; margin: 0; padding: 0; }

.metismenu li { margin: 2px 0.5rem; }

.metismenu li a {
  color: rgba(255,255,255,.68);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 450;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.metismenu li a:hover {
  color: #fff;
  background: rgba(255,255,255,.10);
}

.metismenu li.active > a {
  color: #fff;
  background: var(--cooley-orange);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(212,98,42,.35);
}

.metismenu li a i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Top Header ── */
.header {
  height: var(--header-h);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.07);
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.header-content { width: 100%; }

/* ── Content area ── */
.content-body {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 1.5rem 1.75rem 3rem;
  min-height: calc(100vh - var(--header-h));
}

/* ── Page title bar ── */
.page-titles {
  padding: 0.5rem 0 1rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

.page-titles .breadcrumb {
  margin-bottom: 0;
  font-size: 0.8rem;
}

.breadcrumb-item a { color: var(--cooley-blue); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ── Cards ── */
.card {
  border: 1px solid rgba(0,0,0,.055);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 1.25rem;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.055);
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h4,
.card-header h5,
.card-header .card-title { margin-bottom: 0; font-weight: 600; font-size: 0.95rem; }

.card-footer {
  background: #fafafa;
  border-top: 1px solid rgba(0,0,0,.055);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.75rem 1.25rem;
}

/* KPI stat cards */
.stat-card {
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  border: none;
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  opacity: .15;
}

.stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 0.8rem; opacity: .85; margin-top: .25rem; }

/* ── Tables ── */
.table > :not(caption) > * > * {
  padding: 0.7rem 1rem;
  vertical-align: middle;
}

.table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  border-bottom: 2px solid rgba(0,0,0,.07);
  background: #fafafa;
}

.table tbody tr:hover { background: #f8faff; }

/* ── Forms ── */
.form-control, .form-select {
  border-radius: 6px;
  border-color: #d1d5db;
  font-size: 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--cooley-blue);
  box-shadow: 0 0 0 3px rgba(26,58,92,.12);
}

.form-label {
  font-weight: 500;
  font-size: 0.825rem;
  color: #374151;
  margin-bottom: 0.35rem;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--cooley-blue);
  border-color: var(--cooley-blue);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--cooley-blue-mid);
  border-color: var(--cooley-blue-mid);
}

.btn-xs {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
  line-height: 1.4;
}

/* ── Badges ── */
.badge { font-weight: 500; letter-spacing: .02em; }

/* ── Alerts ── */
.alert {
  border-radius: var(--radius);
  border: none;
  font-size: 0.875rem;
  padding: 0.75rem 1.1rem;
}

/* ── Auth pages ── */
.authincation {
  background: linear-gradient(135deg, var(--cooley-blue) 0%, #0f2340 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.auth-form {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ── Hover lift for portal cards ── */
.hover-shadow {
  transition: box-shadow var(--transition), transform var(--transition);
}
.hover-shadow:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── Utilities ── */
.x-small { font-size: 0.7rem; }
.text-cooley-blue  { color: var(--cooley-blue) !important; }
.text-cooley-orange { color: var(--cooley-orange) !important; }
.bg-cooley-blue    { background: var(--cooley-blue) !important; }

/* ── Scrollbar (WebKit) ── */
.dlabnav::-webkit-scrollbar { width: 4px; }
.dlabnav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

/* ── Responsive ── */
@media (max-width: 991px) {
  .dlabnav { transform: translateX(-100%); }
  .dlabnav.open { transform: translateX(0); }
  .nav-header { width: 100%; }
  .header { left: 0; }
  .content-body { margin-left: 0; }
}

/* ── Hamburger button ── */
.hamburger { cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.hamburger .line {
  width: 24px; height: 2px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  transition: all var(--transition);
}
