/* ==========================================================================
   COMPTECH CREATIVE STUDIO HUB - CORE DESIGN SYSTEM
   Official Comptech Brand Guidelines V1.0 (2026)
   Aesthetic: Aggressive Precision | SaaS Glassmorphism | 45° Chamfer Cut
   ========================================================================== */

:root {
  /* Official Brand Palette (Guidelines Page 4 & Page 8) */
  --ct-black: #111111;      /* Night Black: primary dark base / ink */
  --ct-graphite: #23262B;   /* Graphite: dark frosted surfaces & glass panels */
  --ct-grey: #ECECEC;       /* Cool Grey: neutral surface & high contrast dividers */
  --ct-orange: #FF5A1F;     /* Energy Orange: ACCENT ONLY (the scalpel) */
  --ct-red: #FF5A1F;        /* Canonical reference */
  --ct-white: #FFFFFF;      /* Pure White: text & white logo lockups */

  /* Semantic Glassmorphic UI Surfaces */
  --bg-canvas: #111111;
  --bg-surface: rgba(35, 38, 43, 0.78);
  --bg-surface-solid: #23262B;
  --bg-card: rgba(35, 38, 43, 0.65);
  --bg-card-hover: rgba(45, 49, 58, 0.85);
  --bg-card-active: rgba(55, 60, 70, 0.95);
  --bg-input: rgba(17, 17, 17, 0.75);

  /* Glass Borders & Specular Highlights */
  --glass-border: rgba(236, 236, 236, 0.12);
  --glass-border-subtle: rgba(236, 236, 236, 0.06);
  --glass-border-specular: rgba(255, 255, 255, 0.18);
  --glass-border-focus: var(--ct-orange);
  --glass-blur: blur(20px) saturate(180%);
  --glass-specular: inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);

  /* Typography (Guidelines Page 5 & Page 8) */
  --font-heading: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Signature 45° Chamfer Cut (Guidelines Page 6 & Page 8) */
  --chamfer: 18px;
  --chamfer-sm: 10px;
  --rule-accent-width: 44px;
  --rule-accent-height: 3px;

  /* Radius: Strict Zero (No rounded corners per brand guidelines) */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
  --radius-full: 9999px; /* Reserved exclusively for user avatars */

  /* Text Hierarchy */
  --text-primary: #FFFFFF;
  --text-secondary: #ECECEC;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--ct-black);
  background-image: 
    radial-gradient(1200px 700px at 50% -80px, rgba(35, 38, 43, 0.95) 0%, rgba(17, 17, 17, 0.98) 70%),
    linear-gradient(180deg, #111111 0%, #181A1F 100%);
  background-attachment: fixed;
  color: var(--text-secondary);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.modal-open,
body.auth-active {
  overflow: hidden;
}

h1, h2, h3, h4,
.brand-logo-text,
.vault-brand-title,
.drawer-title,
.auth-title {
  font-family: var(--font-heading);
  font-stretch: 115%;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  font-weight: 700;
}

code, pre,
.mono-spec,
.mono-kicker,
.kpi-value,
.badge-code,
.task-id-tag,
.swatch-hex,
.preset-specs code {
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

/* Signature Brand Accent Rule (3px × 44px) */
.kicker-rule {
  display: inline-block;
  width: var(--rule-accent-width);
  height: var(--rule-accent-height);
  background-color: var(--ct-orange);
  margin-top: 6px;
  margin-bottom: 12px;
}

/* ==========================================================================
   APP HEADER & NAVIGATION BAR
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular), 0 10px 30px rgba(0, 0, 0, 0.4);
  padding: 0.75rem 2rem;
  transition: var(--transition);
}

.header-container {
  max-width: 1760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.header-brand-logo {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.header-studio-kicker {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ct-orange);
  padding: 2px 8px;
  background: rgba(255, 90, 31, 0.12);
  border: 1px solid rgba(255, 90, 31, 0.3);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}

/* Top Bar Brand Selector */
.brand-switcher-nav {
  display: flex;
  background: var(--bg-card);
  padding: 3px;
  border: 1px solid var(--glass-border);
}

.brand-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.brand-nav-btn.active {
  background: var(--ct-graphite);
  color: var(--text-primary);
  border: 1px solid var(--glass-border-specular);
  box-shadow: var(--glass-specular);
  position: relative;
}

.brand-nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ct-orange);
}

/* Header Middle - View Modes */
.header-middle {
  display: flex;
  align-items: center;
}

.view-mode-tabs {
  display: flex;
  gap: 2px;
  background: rgba(17, 17, 17, 0.6);
  padding: 3px;
  border: 1px solid var(--glass-border);
}

.view-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.view-tab-btn.active {
  background: var(--ct-graphite);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--glass-specular);
  position: relative;
}

.view-tab-btn.active::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ct-orange);
}

/* Header Right - Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.excel-action-group {
  display: flex;
  gap: 0.4rem;
}

/* ==========================================================================
   SECONDARY FILTER BAR (GLASSMORPHIC)
   ========================================================================== */
.filter-bar {
  background: rgba(28, 31, 36, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.65rem 2rem;
  transition: var(--transition);
}

.filter-container {
  max-width: 1760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.filter-group-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 280px;
}

.search-input-wrap {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 0.5rem 0.85rem 0.5rem 2.4rem;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.search-input:focus {
  border-color: var(--ct-orange);
  background: rgba(23, 25, 29, 0.95);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--ct-orange);
}

.filter-selects-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  padding: 0.5rem 0.85rem;
  font-size: 0.775rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus {
  border-color: var(--ct-orange);
}

.filter-group-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   BUTTONS & CONTROLS (Brand Guidelines: Precision Chamfers & Energy Orange)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-stretch: 110%;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.55rem 1.15rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
}

/* Primary Button: Energy Orange Scalpel */
.btn-primary {
  background: var(--ct-orange);
  color: #FFFFFF;
  border-color: var(--ct-orange);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  position: relative;
}

.btn-primary:hover {
  background: #E04810;
  border-color: #E04810;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Outline Button: Glassmorphic Graphite */
.btn-outline {
  background: rgba(35, 38, 43, 0.5);
  border-color: var(--glass-border);
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(45, 49, 57, 0.85);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-outline-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #EF4444;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #EF4444;
}

.btn-whatsapp {
  background: #25D366;
  color: #FFFFFF;
  border: none;
  font-weight: 700;
}

.btn-whatsapp:hover {
  background: #20BA5A;
  transform: translateY(-1px);
}

.btn-whatsapp-send {
  background: #25D366;
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.4rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.btn-whatsapp-send:hover {
  background: #20BA5A;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.775rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   APP MAIN CONTENT WRAPPER
   ========================================================================== */
.app-main {
  max-width: 1760px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem 2rem;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--ct-graphite);
  border: 1px solid var(--glass-border-specular);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), var(--glass-specular);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 420px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.toast-success {
  border-left: 3px solid #22c55e;
}

.toast-error {
  border-left: 3px solid #ef4444;
}

.toast-warning {
  border-left: 3px solid var(--ct-orange);
}

.toast-info {
  border-left: 3px solid #38bdf8;
}

.animate-slide-in {
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-out {
  animation: fadeOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(20px);
    opacity: 0;
  }
}
