/* ═══════════════════════════════════════════════════════════════
   SMARTPM — DESIGN SYSTEM
   Dark premium theme matching SmartPlans/3D Dispatch ecosystem
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Background layers */
  --bg-deepest: #0a0e14;
  --bg-base: #0f1419;
  --bg-raised: #151b23;
  --bg-surface: #1a2130;
  --bg-overlay: #1e2736;
  --bg-hover: #242d3a;

  /* Text */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-faint: #484f58;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Accents */
  --accent-sky: #38bdf8;
  --accent-sky-dim: rgba(56, 189, 248, 0.15);
  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.15);
  --accent-rose: #f43f5e;
  --accent-rose-dim: rgba(244, 63, 94, 0.15);
  --accent-indigo: #818cf8;
  --accent-indigo-dim: rgba(129, 140, 248, 0.15);
  --accent-violet: #a78bfa;
  --accent-violet-dim: rgba(167, 139, 250, 0.15);

  /* Sizing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --sidebar-width: 240px;
  --header-height: 56px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deepest);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN GATE
   ═══════════════════════════════════════════════════════════════ */

.login-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(ellipse at 30% 20%, rgba(56, 189, 248, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(129, 140, 248, 0.04) 0%, transparent 50%),
    var(--bg-deepest);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--bg-raised);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-medium);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 3px var(--accent-sky-dim);
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent-sky), #2563eb);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
  margin-top: 8px;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.25);
}

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

.login-error {
  background: var(--accent-rose-dim);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.login-error.visible {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════
   APP SHELL — HEADER
   ═══════════════════════════════════════════════════════════════ */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  height: var(--header-height);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.app-header-brand span {
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 32px;
}

.header-nav-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}

.header-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-nav-btn.active {
  background: var(--accent-sky-dim);
  color: var(--accent-sky);
  font-weight: 600;
}

.app-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
}

.header-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.header-logout {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}

.header-logout:hover {
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

/* ═══════════════════════════════════════════════════════════════
   APP BODY — SIDEBAR + CONTENT
   ═══════════════════════════════════════════════════════════════ */

.app-body {
  display: flex;
  flex: 1;
}

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-base);
  border-right: 1px solid var(--border-light);
  padding: 16px 10px;
  overflow-y: auto;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  flex-shrink: 0;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  padding: 0 10px;
  margin-bottom: 6px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  text-align: left;
  font-family: inherit;
}

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

.sidebar-btn.active {
  background: var(--accent-sky-dim);
  color: var(--accent-sky);
  font-weight: 600;
}

.sidebar-btn-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--accent-rose);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.app-content {
  flex: 1;
  padding: 28px 32px;
  max-width: 1200px;
  min-height: calc(100vh - var(--header-height));
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════ */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 10px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-sky), #2563eb);
  color: white;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  border-color: var(--accent-sky);
  color: var(--accent-sky);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: white;
  border: none;
}

.btn-success:hover {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.1);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  padding: 6px 8px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.1s;
  line-height: 1;
}

.btn-icon:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

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

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--border-medium);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Metric Cards ─── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}

.metric-card--sky::before {
  background: var(--accent-sky);
}

.metric-card--emerald::before {
  background: var(--accent-emerald);
}

.metric-card--amber::before {
  background: var(--accent-amber);
}

.metric-card--rose::before {
  background: var(--accent-rose);
}

.metric-card--indigo::before {
  background: var(--accent-indigo);
}

.metric-card--violet::before {
  background: var(--accent-violet);
}

.metric-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  background: var(--bg-surface);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-medium);
  position: sticky;
  top: 0;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.08s;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .col-money {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  text-align: right;
}

.data-table .col-actions {
  text-align: right;
  white-space: nowrap;
}

.data-table .row-link {
  cursor: pointer;
}

.data-table .row-link:hover td:first-child {
  color: var(--accent-sky);
}

/* ═══════════════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--draft {
  background: rgba(110, 118, 129, 0.15);
  color: var(--text-muted);
}

.badge--active {
  background: var(--accent-sky-dim);
  color: var(--accent-sky);
}

.badge--bidding {
  background: var(--accent-violet-dim);
  color: var(--accent-violet);
}

.badge--awarded {
  background: var(--accent-indigo-dim);
  color: var(--accent-indigo);
}

.badge--on-hold {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
}

.badge--submitted {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
}

.badge--approved {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.badge--complete {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.badge--rejected {
  background: var(--accent-rose-dim);
  color: var(--accent-rose);
}

.badge--overdue {
  background: var(--accent-rose-dim);
  color: var(--accent-rose);
}

.badge--pending {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
}

.badge--paid {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.badge--open {
  background: var(--accent-sky-dim);
  color: var(--accent-sky);
}

.badge--closed {
  background: rgba(110, 118, 129, 0.15);
  color: var(--text-muted);
}

.badge--critical {
  background: var(--accent-rose-dim);
  color: var(--accent-rose);
}

.badge--high {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
}

.badge--normal {
  background: var(--accent-sky-dim);
  color: var(--accent-sky);
}

.badge--low {
  background: rgba(110, 118, 129, 0.15);
  color: var(--text-muted);
}

.badge--punch-list {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
}

.badge--closeout {
  background: var(--accent-violet-dim);
  color: var(--accent-violet);
}

.badge--cancelled {
  background: rgba(110, 118, 129, 0.15);
  color: var(--text-muted);
  text-decoration: line-through;
}

.badge--responded {
  background: var(--accent-indigo-dim);
  color: var(--accent-indigo);
}

.badge--in_progress {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
}

.badge--in_preparation {
  background: rgba(110, 118, 129, 0.15);
  color: var(--text-muted);
}

.badge--void {
  background: rgba(110, 118, 129, 0.15);
  color: var(--text-muted);
  text-decoration: line-through;
}

.badge--addition {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.badge--deduction {
  background: var(--accent-rose-dim);
  color: var(--accent-rose);
}

.badge--no_cost {
  background: rgba(110, 118, 129, 0.15);
  color: var(--text-muted);
}

.badge--verified {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.badge--sky {
  background: var(--accent-sky-dim);
  color: var(--accent-sky);
}

.badge--emerald {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.badge--amber {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
}

.badge--rose {
  background: var(--accent-rose-dim);
  color: var(--accent-rose);
}

.badge--indigo {
  background: var(--accent-indigo-dim);
  color: var(--accent-indigo);
}

/* ─── Role Badges ─── */
.role-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 16px;
}

.role-badge--admin {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
}

.role-badge--ops_mgr {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
}

.role-badge--pm {
  background: var(--accent-sky-dim);
  color: var(--accent-sky);
}

.role-badge--viewer {
  background: var(--accent-violet-dim);
  color: var(--accent-violet);
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-full {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-input,
.form-select,
.form-textarea {
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 3px var(--accent-sky-dim);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e7681' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-divider {
  grid-column: 1 / -1;
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 8px 0;
}

.form-section-title {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   PROJECT CARDS (Dashboard)
   ═══════════════════════════════════════════════════════════════ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  border-color: var(--accent-sky);
  box-shadow: 0 4px 24px rgba(56, 189, 248, 0.08);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.project-card-number {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.project-card-client {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.project-card-finance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.project-card-stat {
  font-size: 11px;
  color: var(--text-muted);
}

.project-card-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.project-card-disciplines {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.discipline-tag {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent-sky-dim);
  color: var(--accent-sky);
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 13px;
  max-width: 400px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL / DIALOG
   ═══════════════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.15s;
}

.modal {
  background: var(--bg-raised);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.2s;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  padding: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.1s;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: var(--header-height);
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
}

.toast--success {
  background: var(--accent-emerald);
  color: white;
}

.toast--error {
  background: var(--accent-rose);
  color: white;
}

.toast--info {
  background: var(--accent-sky);
  color: white;
}

.toast--warning {
  background: var(--accent-amber);
  color: #1a1a1a;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-sky);
  border-bottom-color: var(--accent-sky);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════ */

.progress-bar {
  height: 6px;
  background: var(--bg-surface);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
  background: linear-gradient(90deg, var(--accent-sky), var(--accent-emerald));
}

/* ═══════════════════════════════════════════════════════════════
   ACTIVITY FEED
   ═══════════════════════════════════════════════════════════════ */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-text strong {
  color: var(--text-primary);
}

.activity-time {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .app-sidebar {
    display: none;
  }

  .app-content {
    padding: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
  }

  .app-header-nav {
    display: none;
  }
}