/* ============================================================
   SignFlow AI — Design System
   styles/main.css
   Dark industrial internal tool for a Dutch signing company.
   All other CSS files and pages depend on variables defined here.
   ============================================================ */

/* 1. Google Fonts Import
   ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');


/* 2. CSS Custom Properties (Design Tokens)
   ------------------------------------------------------------ */
:root {
  /* Background layers */
  --bg-base:     #0a0a0b;
  --bg-surface:  #111113;
  --bg-elevated: #18181c;
  --bg-overlay:  #1f1f25;
  --bg-hover:    #26262e;

  /* Borders */
  --border:       #2a2a35;
  --border-light: #1e1e28;
  --border-focus: #f59e0b;

  /* Accent — warm amber */
  --accent:       #f59e0b;
  --accent-dim:   #b45309;
  --accent-glow:  rgba(245, 158, 11, 0.12);
  --accent-muted: rgba(245, 158, 11, 0.08);

  /* Text */
  --text-primary:   #f0f0f2;
  --text-secondary: #8b8b9a;
  --text-muted:     #52525e;
  --text-accent:    #f59e0b;
  --text-on-accent: #000000;

  /* Status colors */
  --green:  #22c55e;
  --red:    #ef4444;
  --yellow: #eab308;
  --blue:   #3b82f6;
  --purple: #a855f7;

  /* Status background variants (0.1 opacity) */
  --green-bg:  rgba(34, 197, 94, 0.1);
  --red-bg:    rgba(239, 68, 68, 0.1);
  --yellow-bg: rgba(234, 179, 8, 0.1);
  --blue-bg:   rgba(59, 130, 246, 0.1);
  --purple-bg: rgba(168, 85, 247, 0.1);

  /* Border rgba values */
  --border-amber:  rgba(245, 158, 11, 0.2);
  --border-amber-strong: rgba(245, 158, 11, 0.3);
  --border-green:  rgba(34, 197, 94, 0.2);
  --border-green-dim: rgba(34, 197, 94, 0.25);
  --border-red:    rgba(239, 68, 68, 0.2);
  --border-red-dim: rgba(239, 68, 68, 0.18);
  --border-blue:   rgba(59, 130, 246, 0.2);
  --border-yellow: rgba(234, 179, 8, 0.2);
  --border-purple: rgba(168, 85, 247, 0.2);

  /* Fonts */
  --font-mono: 'Inter', system-ui, sans-serif;
  --font-sans: 'Inter', system-ui, sans-serif;

  /* Layout */
  --sidebar-w: 220px;
  --header-h:  52px;

  /* Border radius */
  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 5px;
  --r-lg: 8px;
}


/* 3. Universal Reset + Base
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* 4. Scrollbar Styling
   ------------------------------------------------------------ */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--r-xs);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-focus);
}


/* 5. App Shell
   ------------------------------------------------------------ */
.app-shell {
  display: flex;
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
}


/* Sidebar container (JS injection wrapper) — must be transparent to flex layout */
#sidebar-container {
  display: contents;
}


/* 6. Sidebar
   ------------------------------------------------------------ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

/* Sidebar logo area */
.sidebar-logo {
  height: var(--header-h);
  min-height: var(--header-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  background-color: var(--accent);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-logo-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
}

.sidebar-logo-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Sidebar navigation */
.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 12px 16px 4px;
  display: block;
}

.sidebar-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.sidebar-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background-color: var(--accent-muted);
}

.sidebar-item svg {
  width: 15px;
  height: 15px;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-item.active svg {
  opacity: 1;
}

.sidebar-badge {
  margin-left: auto;
  background-color: var(--accent);
  color: var(--text-on-accent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: var(--r-xs);
  line-height: 1.4;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
}

.sidebar-user {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.sidebar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--bg-overlay);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.sidebar-user-role {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}


/* 7. Main Content
   ------------------------------------------------------------ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.page-header {
  height: var(--header-h);
  min-height: var(--header-h);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  background-color: var(--bg-surface);
}

.page-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.page-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.header-spacer {
  flex: 1;
}

.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background-color: var(--bg-base);
}
