/* ══════════════════════════════════════════════════════════
   Folourgo Construction — CIS Brand Layer
   Extracted from folourgoconstruction.com
   Overrides hasight-tokens.css for client-specific branding
   ══════════════════════════════════════════════════════════ */

:root {
  /* ── Brand Palette ── */
  --brand-primary: #066aab;          /* Folourgo blue — buttons, links, active */
  --brand-primary-hover: #0780c5;    /* Lighter hover state */
  --brand-primary-dark: #04567e;     /* Pressed / dark variant */
  --brand-warm: #989285;             /* Dominant sand/olive tone */
  --brand-warm-light: #c5bfb3;       /* Lighter warm accent */
  --brand-charcoal: #32343b;         /* Dark charcoal — topbar, footers */
  --brand-charcoal-light: #4a4c52;   /* Lighter charcoal */
  --brand-danger: #d63637;           /* Error red */
  --brand-surface: #ffffff;
  --brand-bg: #F8F6F3;              /* Warm off-white background */
  --brand-bg-alt: #F0EDE8;          /* Slightly darker warm bg */
  --brand-text: #32343b;             /* Primary text = charcoal */
  --brand-text-secondary: #6b6d72;   /* Secondary text */
  --brand-text-muted: #989285;       /* Muted text = warm tone */
  --brand-border: #E5E0D8;          /* Warm border */
  --brand-border-light: #EDE9E3;    /* Light warm border */

  /* ── Override Core Tokens ── */
  --color-primary: var(--brand-primary);
  --color-primary-light: var(--brand-primary-hover);
  --color-primary-dark: var(--brand-primary-dark);
  --color-accent: var(--brand-primary);
  --color-accent-light: #E8F0F7;
  --color-secondary: var(--brand-warm);
  --color-secondary-light: var(--brand-warm-light);
  --color-secondary-dark: #7a756a;
  --color-background: var(--brand-bg);
  --color-surface: var(--brand-surface);
  --color-text-primary: var(--brand-text);
  --color-text-secondary: var(--brand-text-secondary);
  --color-text-muted: var(--brand-text-muted);
  --color-border: var(--brand-border);
  --color-border-light: var(--brand-border-light);
  --color-border-focus: var(--brand-primary);
  --color-danger: var(--brand-danger);

  /* ── Typography ── */
  --font-family-sans: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-family-heading: 'DM Sans', 'Roboto Slab', Georgia, serif;

  /* ── Border Radius (slightly softer) ── */
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;

  /* ── Haori Component Overrides ── */
  --haori-topbar-bg: var(--brand-charcoal);
  --haori-topbar-height: 52px;
  --haori-sidebar-bg: var(--brand-surface);
  --haori-sidebar-active-bg: #E8F0F7;
  --haori-sidebar-active-border: var(--brand-primary);
  --haori-sidebar-hover-bg: var(--brand-bg);
  --haori-sidebar-group-text: var(--brand-warm);
  --haori-commandbar-bg: var(--brand-surface);
  --haori-commandbar-border: var(--brand-border);
  --haori-grid-header-bg: #FAF8F5;
  --haori-grid-header-border: var(--brand-primary);
  --haori-grid-row-hover: var(--brand-bg);
  --haori-grid-link-color: var(--brand-primary);
  --haori-workspace-banner-start: var(--brand-charcoal);
  --haori-workspace-banner-end: var(--brand-primary);
  --haori-stage-completed: #107C10;
  --haori-stage-active: var(--brand-primary);
  --haori-pivot-active: var(--brand-primary);

  /* ── Chart Colors (warmer palette) ── */
  --chart-1: var(--brand-primary);
  --chart-2: #989285;
  --chart-3: #2d9b83;
  --chart-4: #c4873b;
  --chart-5: #6b8e5e;
  --chart-6: var(--brand-danger);
  --chart-7: #7a6b8a;
  --chart-8: #3a7ca5;
}

/* ── Dark Mode Brand Overrides ── */
[data-theme="dark"] {
  --brand-bg: #1a1917;
  --brand-bg-alt: #242320;
  --brand-surface: #1a1917;
  --brand-border: #3a3832;
  --brand-border-light: #2e2d28;
  --color-background: var(--brand-bg);
  --color-surface: var(--brand-surface);
  --color-border: var(--brand-border);
  --color-border-light: var(--brand-border-light);
  --haori-topbar-bg: #131210;
  --haori-sidebar-bg: var(--brand-surface);
  --haori-sidebar-active-bg: #1a2a3c;
  --haori-sidebar-hover-bg: #242320;
  --haori-grid-header-bg: #242320;
  --haori-grid-row-hover: #2e2d28;
  --haori-workspace-banner-start: #131210;
  --haori-workspace-banner-end: #04567e;
}

/* ══════════════════════════════════════════════════════════
   § TYPOGRAPHY
   ══════════════════════════════════════════════════════════ */

body {
  font-family: var(--font-family-sans);
  letter-spacing: -0.01em;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4 {
  font-family: var(--font-family-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--brand-text);
}

h1, .h1 { font-weight: 700; }

/* ══════════════════════════════════════════════════════════
   § TOPBAR
   ══════════════════════════════════════════════════════════ */

.app-header {
  background: var(--brand-charcoal) !important;
  border-bottom: 2px solid var(--brand-primary);
}

.app-header .top-bar-brand {
  background: var(--brand-charcoal) !important;
}

/* Brand mark in topbar */
.top-bar-brand img,
.top-bar-brand .brand-text {
  filter: brightness(1.1);
}

/* Brand logo in topbar */
.top-bar-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
  padding: 2px;
}

.top-bar-brand-text {
  color: #fff;
  font-family: var(--font-family-heading);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Login page brand elements */
.login-logo-icon {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px;
}

.login-brand-text {
  display: block;
  color: #fff;
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 1.25rem;
  margin-top: 0.5rem;
}

/* ══════════════════════════════════════════════════════════
   § SIDEBAR
   ══════════════════════════════════════════════════════════ */

.app-aside {
  border-right: 1px solid var(--brand-border);
}

.stacked-menu > .menu > .menu-item.has-active > .menu-link,
.stacked-menu > .menu > .menu-item.has-active > .menu-link .menu-icon {
  color: var(--brand-primary);
}

/* ══════════════════════════════════════════════════════════
   § BUTTONS
   ══════════════════════════════════════════════════════════ */

.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.btn-primary:active,
.btn-primary.active {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline-primary:hover {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   § CARDS
   ══════════════════════════════════════════════════════════ */

.card {
  border-color: var(--brand-border);
  border-radius: var(--radius-lg);
}

.card-header {
  border-bottom-color: var(--brand-border);
  background: var(--brand-surface);
}

/* ══════════════════════════════════════════════════════════
   § LOGIN PAGE
   ══════════════════════════════════════════════════════════ */

.auth {
  background: var(--brand-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-header {
  background: var(--brand-charcoal) !important;
  background-image: none !important;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 420px;
}

.auth-header h1 {
  margin: 0;
  color: #fff;
}

.auth-form {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(50, 52, 59, 0.08);
}

.auth-form .btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.auth-form .btn-primary:hover {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.auth-form .form-control {
  border-color: var(--brand-border);
  border-radius: var(--radius-md);
}

.auth-form .form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(6, 106, 171, 0.12);
}

.auth-form .link {
  color: var(--brand-primary);
}

/* ══════════════════════════════════════════════════════════
   § DASHBOARD — WORKSPACE BANNER
   ══════════════════════════════════════════════════════════ */

.haori-workspace-banner {
  background: linear-gradient(135deg, var(--brand-charcoal) 0%, var(--brand-primary) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.haori-workspace-banner::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40%;
  background: linear-gradient(135deg, transparent 30%, rgba(152, 146, 133, 0.15) 100%);
  pointer-events: none;
}

.haori-workspace-banner h1 {
  color: #fff;
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.haori-workspace-banner h2 {
  color: #fff;
}

.haori-workspace-banner p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* ══════════════════════════════════════════════════════════
   § DASHBOARD — TILES
   ══════════════════════════════════════════════════════════ */

.haori-tile {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.haori-tile:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 2px 12px rgba(6, 106, 171, 0.1);
  text-decoration: none;
}

.haori-tile-icon {
  color: var(--brand-primary);
}

.haori-tile-label {
  font-family: var(--font-family-heading);
  font-weight: 600;
  color: var(--brand-text);
}

.haori-workspace-section-title {
  font-family: var(--font-family-heading);
  font-weight: 600;
  color: var(--brand-warm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

/* ══════════════════════════════════════════════════════════
   § DATA TABLES
   ══════════════════════════════════════════════════════════ */

table.dataTable thead th,
table.dataTable thead td {
  border-bottom-color: var(--brand-border);
  font-family: var(--font-family-heading);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--brand-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table.dataTable tbody tr:hover {
  background: var(--brand-bg) !important;
}

/* Pagination */
.page-item.active .page-link {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.page-link {
  color: var(--brand-primary);
}

.page-link:hover {
  color: var(--brand-primary-dark);
}

/* ══════════════════════════════════════════════════════════
   § FORMS
   ══════════════════════════════════════════════════════════ */

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(6, 106, 171, 0.12);
}

/* ══════════════════════════════════════════════════════════
   § BADGES (brand-warm accents)
   ══════════════════════════════════════════════════════════ */

.badge.bg-primary {
  background-color: var(--brand-primary) !important;
}

/* ══════════════════════════════════════════════════════════
   § LINKS & FOCUS STATES
   ══════════════════════════════════════════════════════════ */

a {
  color: var(--brand-primary);
}

a:hover {
  color: var(--brand-primary-dark);
}

/* ══════════════════════════════════════════════════════════
   § NAV TABS / PIVOT
   ══════════════════════════════════════════════════════════ */

.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* ══════════════════════════════════════════════════════════
   § FOOTER
   ══════════════════════════════════════════════════════════ */

.app-footer {
  background: var(--brand-surface);
  border-top: 1px solid var(--brand-border);
  color: var(--brand-text-muted);
  font-size: 0.8125rem;
}

/* ══════════════════════════════════════════════════════════
   § SCROLLBAR (warm tints)
   ══════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: var(--brand-warm-light);
  border-radius: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}
