/* ==========================================================================
   main.css - Ultra-Minimalist & Elegant Layout with Persistent Sidebar
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-app: #fbfbfb;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f8f9fa;
  --bg-sidebar: #f8f9fa;

  /* Typography */
  --text-main: #0f172a;       /* Slate 900 */
  --text-muted: #64748b;      /* Slate 500 */
  --text-light: #94a3b8;      /* Slate 400 */

  /* Borders */
  --border-subtle: #eaeaea;
  --border-strong: #cbd5e1;

  /* Brand Colors */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-subtle: #f0f9ff;
  --primary-border: #bae6fd;

  --success: #10b981;
  --success-subtle: #f0fdf4;
  --success-border: #bbf7d0;

  --warning: #f59e0b;
  --warning-subtle: #fffbeb;
  --warning-border: #fef3c7;

  --danger: #ef4444;
  --danger-subtle: #fef2f2;

  /* Typography & Sizing */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radii & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.05);

  --transition: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-width: 220px;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app-root {
  min-height: 100vh;
  display: flex;
}

/* ==========================================================================
   Persistent Minimalist Sidebar
   ========================================================================== */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: width var(--transition);
}

.sidebar-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.brand-monogram {
  width: 26px;
  height: 26px;
  background-color: var(--text-main);
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.sidebar-group-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 10px;
  margin-bottom: 4px;
}

.sidebar-links-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.sidebar-item:hover {
  color: var(--text-main);
  background-color: rgba(0, 0, 0, 0.03);
}

.sidebar-item.active {
  color: var(--primary);
  background-color: var(--primary-subtle);
  font-weight: 600;
}

.sidebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Sidebar Footer (User Info) */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.user-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta-sm {
  display: flex;
  flex-direction: column;
}

.user-name-sm {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.user-role-sm {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.1;
}

/* ==========================================================================
   Main Content Layout (Offset for Sidebar)
   ========================================================================== */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar Header */
.topbar-header {
  height: 56px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Regional Pill */
.office-pill {
  display: flex;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
}

.office-btn {
  background: none;
  border: none;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}

.office-btn.active {
  background-color: #ffffff;
  color: var(--text-main);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Viewport Container */
.main-viewport {
  flex: 1;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 60px;
}
