/* ============================================
   RapidDev Portal - Main Stylesheet
   Dark theme: #0a0a0a bg, #111 cards, #e87040 accent
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-secondary: #0f0f0f;
  --card: #111111;
  --card-hover: #161616;
  --border: #1e1e1e;
  --border-light: #252525;
  --accent: #e87040;
  --accent-hover: #f08050;
  --accent-muted: rgba(232, 112, 64, 0.15);
  --text: #f0f0f0;
  --text-muted: #888;
  --text-faint: #555;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --sidebar-width: 260px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.6);
  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ============ AUTH PAGES ============ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(232,112,64,0.08) 0%, transparent 60%);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo-lg {
  width: 60px;
  height: 60px;
  background: var(--accent);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  letter-spacing: -1px;
  box-shadow: 0 4px 20px rgba(232,112,64,0.4);
}

.brand-logo-lg.admin {
  background: #1a1a2e;
  border: 2px solid var(--accent);
}

.auth-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.auth-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-form { margin-bottom: 1rem; }

.auth-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 1.25rem 0;
  position: relative;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ============ FORMS ============ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.required { color: var(--accent); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.65rem 0.875rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

input::placeholder, textarea::placeholder { color: var(--text-faint); }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,112,64,0.12);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

select option {
  background: #1a1a1a;
  color: var(--text);
}

textarea { resize: vertical; }

.input-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-with-icon {
  position: relative;
}

.input-with-icon input { padding-right: 3rem; }

.toggle-password {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.toggle-password svg { width: 18px; height: 18px; }
.toggle-password:hover { color: var(--text); }

.form-footer-links {
  text-align: right;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.password-requirements {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.req {
  font-size: 0.8rem;
  color: var(--text-faint);
  transition: color var(--transition);
}

.req.valid { color: var(--success); }
.req.invalid { color: var(--error); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232,112,64,0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(232,112,64,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
}

.btn-danger:hover {
  background: rgba(239,68,68,0.25);
  color: #ef4444;
}

.btn-success {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.3);
}

.btn-success:hover {
  background: rgba(34,197,94,0.25);
  color: #22c55e;
}

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

.btn-full { width: 100%; justify-content: center; }

/* ============ ALERTS ============ */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}

.alert-success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
}

/* ============ APP LAYOUT ============ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 4rem;
  }
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--card);
  border-right: 1px solid var(--border);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.admin-sidebar { border-right-color: rgba(232,112,64,0.2); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(232,112,64,0.3);
}

.brand-logo.admin {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  list-style: none;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.sidebar-nav li { margin-bottom: 0.25rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--card-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-muted);
  color: var(--accent);
}

.nav-item .badge {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: auto;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
}

.user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  width: fit-content;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-initials {
  width: 32px;
  height: 32px;
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-initials.admin {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
}

.logout-btn {
  color: var(--text-faint);
  transition: color var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logout-btn svg { width: 18px; height: 18px; }
.logout-btn:hover { color: var(--error); }

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sidebar-toggle:active { background: var(--card-hover); }
.sidebar-toggle svg { width: 22px; height: 22px; display: block; pointer-events: none; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar-toggle {
    display: flex !important;
    transition: left 0.25s ease;
  }
  .sidebar-toggle.shifted {
    left: calc(var(--sidebar-width) + 0.75rem);
  }
  .sidebar-toggle.shifted .icon-menu { display: none !important; }
  .sidebar-toggle.shifted .icon-close { display: block !important; }
}

@media (min-width: 769px) {
  .sidebar {
    transform: translateX(0) !important;
  }
  .sidebar-toggle {
    display: none !important;
  }
}

/* ============ PAGE HEADER ============ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.page-actions { display: flex; gap: 0.75rem; align-items: center; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  transition: color var(--transition);
}

.back-link:hover { color: var(--text); }

/* ============ CARDS ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

.card-link {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-link:hover { color: var(--accent); }

/* ============ STATS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1000px) {
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .stats-grid, .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid, .stats-grid-4 { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ============ DASHBOARD GRID ============ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ============ PROJECT ITEMS ============ */
.project-list { display: flex; flex-direction: column; gap: 0.5rem; }

.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  color: var(--text);
}

.project-item:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  color: var(--text);
}

.project-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.project-updated {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* ============ PROJECT CARDS GRID ============ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition);
  color: var(--text);
}

.project-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(232,112,64,0.1);
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.project-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.project-date, .project-updated {
  font-size: 0.775rem;
  color: var(--text-faint);
}

.project-arrow {
  color: var(--accent);
  font-size: 1.1rem;
}

/* ============ STATUS BADGES ============ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.lg { padding: 0.35rem 1rem; font-size: 0.875rem; }

.status-new { background: rgba(99,102,241,0.15); color: #818cf8; }
.status-in_progress { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status-review { background: rgba(245,158,11,0.15); color: #fbbf24; }
.status-delivered { background: rgba(34,197,94,0.15); color: #4ade80; }

.invoice-status-open { background: rgba(245,158,11,0.15); color: #fbbf24; }
.invoice-status-paid { background: rgba(34,197,94,0.15); color: #4ade80; }
.invoice-status-overdue { background: rgba(239,68,68,0.15); color: #f87171; }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-dot.active { color: var(--success); }
.status-dot.active::before { background: var(--success); }
.status-dot.inactive { color: var(--error); }
.status-dot.inactive::before { background: var(--error); }

/* ============ INVOICE LIST ============ */
.invoice-list { display: flex; flex-direction: column; gap: 0.5rem; }

.invoice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.invoice-num { font-weight: 600; font-size: 0.9rem; display: block; }
.invoice-due { font-size: 0.775rem; color: var(--text-muted); }
.invoice-right { display: flex; align-items: center; gap: 0.75rem; }
.invoice-amount { font-weight: 700; color: var(--text); }
.invoice-num-cell { font-weight: 600; color: var(--accent); }
.amount-cell { font-weight: 700; }
.overdue-date { color: var(--error); font-weight: 600; }

/* ============ MESSAGES ============ */
.message-list { display: flex; flex-direction: column; gap: 0.5rem; }

.message-item {
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: block;
  color: var(--text);
  transition: all var(--transition);
}

.message-item:hover {
  background: var(--card-hover);
  border-color: var(--border-light);
  color: var(--text);
}

.message-item.unread { border-left: 3px solid var(--accent); }

.message-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.message-project { font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.message-time { font-size: 0.775rem; color: var(--text-faint); }
.message-preview { font-size: 0.875rem; color: var(--text-muted); }

/* Messages thread */
.messages-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.message-bubble {
  max-width: 75%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.message-bubble.own {
  align-self: flex-end;
  align-items: flex-end;
}

.message-bubble.other {
  align-self: flex-start;
  align-items: flex-start;
}

.message-sender {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sender-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.admin-tag {
  display: inline-flex;
  padding: 0.1rem 0.4rem;
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.message-bubble.own .message-content {
  background: var(--accent-muted);
  border: 1px solid rgba(232,112,64,0.25);
  border-bottom-right-radius: 4px;
}

.message-bubble.other .message-content {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message-form { margin-top: 1rem; }

.message-input-area {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.message-input-area:focus-within {
  border-color: var(--accent);
}

.message-input-area textarea {
  border: none;
  border-radius: 0;
  background: rgba(255,255,255,0.02);
  resize: none;
  padding: 0.875rem;
}

.message-input-area textarea:focus {
  box-shadow: none;
  border: none;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border);
}

.file-attach-btn {
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.file-attach-btn svg { width: 18px; height: 18px; }
.file-attach-btn:hover { color: var(--accent); }

.attached-file-name {
  font-size: 0.8rem;
  color: var(--accent);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Avatar elements */
.avatar-xs {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-xs-initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-xs-initial.admin {
  background: var(--accent-muted);
  color: var(--accent);
}

/* ============ TABLES ============ */
.table-wrapper {
  overflow-x: auto;
  margin: -0.25rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table tr:last-child td { border-bottom: none; }

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

.table-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

/* ============ DETAIL GRID ============ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* ============ TIMELINE ============ */
.timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0.5rem 0;
  overflow-x: auto;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 80px;
}

.timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 2px solid var(--border);
  background: var(--bg);
  position: relative;
  z-index: 2;
  transition: all var(--transition);
}

.timeline-step.completed .timeline-icon,
.timeline-step.current .timeline-icon {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.timeline-label {
  font-size: 0.75rem;
  color: var(--text-faint);
  text-align: center;
  margin-top: 0.5rem;
  font-weight: 500;
}

.timeline-step.completed .timeline-label,
.timeline-step.current .timeline-label {
  color: var(--text);
}

.timeline-step.current .timeline-label {
  color: var(--accent);
  font-weight: 600;
}

.timeline-connector {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 1;
}

.timeline-connector.done { background: var(--accent); }

/* ============ FILES ============ */
.file-list { display: flex; flex-direction: column; gap: 0.5rem; }

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.file-icon { font-size: 1.25rem; flex-shrink: 0; }

.file-info {
  flex: 1;
  overflow: hidden;
}

.file-name {
  font-size: 0.875rem;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.file-upload-area {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.file-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.file-upload-area svg { width: 32px; height: 32px; color: var(--text-faint); margin-bottom: 0.5rem; }
.file-upload-area p { font-size: 0.9rem; color: var(--text-muted); }
.file-upload-hint { font-size: 0.775rem; color: var(--text-faint); }

/* ============ INFO LIST ============ */
.info-list { display: flex; flex-direction: column; gap: 0.875rem; }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.info-row:last-child { border-bottom: none; padding-bottom: 0; }

.info-label { font-size: 0.85rem; color: var(--text-muted); }

/* ============ MINI LIST ============ */
.mini-list { display: flex; flex-direction: column; gap: 0.5rem; }

.mini-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  transition: all var(--transition);
}

.mini-list-item:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  color: var(--text);
}

/* ============ PROJECT META ============ */
.project-description {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.meta-item { display: flex; flex-direction: column; gap: 0.2rem; }
.meta-label { font-size: 0.775rem; color: var(--text-muted); }
.meta-value { font-size: 0.9rem; font-weight: 500; }

/* ============ PROFILE ============ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .profile-grid { grid-template-columns: 1fr; }
}

.avatar-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-light);
}

.profile-avatar-initial {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  border: 3px solid rgba(232,112,64,0.2);
}

.change-avatar-btn {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  padding: 0.4rem 0.875rem;
  border: 1px solid rgba(232,112,64,0.3);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.change-avatar-btn:hover { background: var(--accent-muted); }

/* ============ QUICK ACTIONS ============ */
.quick-actions-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(232,112,64,0.2);
}

.quick-action-btn svg { width: 16px; height: 16px; }

.quick-action-btn:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.quick-action-btn.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.quick-action-btn.secondary:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--accent);
}

/* ============ ACTIVITY ============ */
.activity-list { display: flex; flex-direction: column; gap: 0.5rem; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.activity-item:hover { background: rgba(255,255,255,0.02); }

.activity-icon {
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.activity-name { font-size: 0.9rem; font-weight: 500; }
.activity-type { font-size: 0.775rem; color: var(--text-muted); }

/* ============ EMPTY STATES ============ */
.empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-state.large {
  padding: 3rem 1rem;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-faint);
  margin: 0 auto 1rem;
  display: block;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ============ INITIALS SM ============ */
.user-initials.sm {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .stat-card, .project-card {
  animation: fadeIn 0.3s ease both;
}

/* ============ FAVICON SVG inline ============ */

/* ============ PAGINATION ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0 0.5rem;
}

.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============ COUNT BADGE ============ */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 10px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ============ BTN WARNING ============ */
.btn-warning {
  background: #f59e0b;
  color: #fff;
  border: none;
}
.btn-warning:hover {
  background: #d97706;
}

/* ============ ADMIN TAG ============ */
.admin-tag {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(232,112,64,0.15);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
