/* ============================================================
   MHUB FORGE — ADMIN
   ============================================================ */

/* ===== LAYOUT BARE (login) ===== */
.page-bare {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ===== LOGIN ===== */
.login-shell {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 2;
}

.login-card {
  padding: 48px 40px 32px;
  background: color-mix(in srgb, var(--surface-solid) 60%, transparent);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--accent) 60deg, transparent 120deg);
  opacity: 0.06;
  animation: rotate 20s linear infinite;
  pointer-events: none;
}

@keyframes rotate { to { transform: rotate(360deg); } }

.login-card > * { position: relative; z-index: 1; }

.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 0 24px var(--glow));
}

.login-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.login-brand h1 span { color: var(--accent); }

.login-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: color-mix(in srgb, #ef4444 12%, transparent);
  border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
  border-radius: 12px;
  color: #ef4444;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 14px 16px 14px 42px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.3s var(--ease);
}

.input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  box-shadow: 0 0 0 4px var(--glow-soft);
}

.login-form .btn {
  margin-top: 8px;
}

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.login-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: 'SF Mono', Monaco, monospace;
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.page-admin {
  min-height: 100vh;
  background: var(--bg);
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ===== SIDEBAR ===== */
.admin-sidebar {
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 40%, transparent);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 32px;
  font-weight: 600;
  font-size: 0.95rem;
}

.admin-logo-img { width: 26px; height: 26px; }
.admin-logo strong { color: var(--accent); }

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  position: relative;
}

.admin-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.admin-nav a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.admin-nav a.active {
  color: var(--accent);
  background: var(--glow-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.admin-sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
}

.admin-avatar {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glow-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 10px;
  color: var(--accent);
  flex-shrink: 0;
}

.admin-avatar svg { width: 18px; height: 18px; }

.admin-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-role {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.admin-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.admin-logout svg { width: 16px; height: 16px; }

.admin-logout:hover {
  color: #ef4444;
  border-color: color-mix(in srgb, #ef4444 40%, transparent);
  background: color-mix(in srgb, #ef4444 8%, transparent);
}

/* ===== MAIN ===== */
.admin-main {
  padding: 40px 48px;
  max-width: 1400px;
  width: 100%;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.admin-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }

/* ===== STATS ===== */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  transition: all 0.3s var(--ease);
}

.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface-hover);
  color: var(--text-muted);
  flex-shrink: 0;
}

.stat-icon svg { width: 20px; height: 20px; }

.stat-icon.accent {
  background: var(--glow-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== CARDS ===== */
.admin-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  margin-bottom: 20px;
}

.admin-card-highlight {
  background:
    radial-gradient(ellipse at top right, var(--glow-soft) 0%, transparent 60%),
    var(--surface);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

.card-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.card-big {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 6px;
}

.card-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.card-help {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.card-help.small { font-size: 0.78rem; margin-bottom: 0; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  transition: all 0.2s;
}

.card-link:hover { gap: 10px; }

.card-counter {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ===== PROGRESS ===== */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface-hover);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 0.6s var(--ease);
  box-shadow: 0 0 12px var(--glow);
}

/* ===== CLIENT LIST (dashboard) ===== */
.client-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.client-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  transition: all 0.2s var(--ease);
}

.client-row:hover {
  background: var(--surface-hover);
}

.client-avatar {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.client-avatar.small {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.client-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.client-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.client-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--surface-hover);
  border-radius: 100px;
  white-space: nowrap;
}

.client-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.status-active {
  color: #10b981;
  background: color-mix(in srgb, #10b981 12%, transparent);
  border: 1px solid color-mix(in srgb, #10b981 25%, transparent);
}

.status-paused {
  color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 25%, transparent);
}

.status-archived {
  color: var(--text-dim);
  background: var(--surface-hover);
  border: 1px solid var(--border);
}

.client-arrow {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.client-row:hover .client-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ===== TABLE ===== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-hover); }

.cell-client {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cell-name {
  font-weight: 500;
  font-size: 0.88rem;
}

.cell-email {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.badge-sub {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--glow-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 100px;
}

/* ===== EMPTY ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg { opacity: 0.3; }

.empty-state p {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.empty-state.small { padding: 32px 20px; }

/* ===== ALERTS ===== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 0.88rem;
}

.alert svg { flex-shrink: 0; margin-top: 2px; }

.alert-error {
  background: color-mix(in srgb, #ef4444 10%, transparent);
  border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
  color: #ef4444;
}

.alert-success {
  background: color-mix(in srgb, #10b981 10%, transparent);
  border: 1px solid color-mix(in srgb, #10b981 30%, transparent);
  color: #10b981;
}

.alert strong {
  display: block;
  margin-bottom: 4px;
}

.alert p {
  margin: 0;
  color: inherit;
  opacity: 0.9;
}

.pw-code {
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface-hover);
  border-radius: 6px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.85em;
  color: var(--text);
  user-select: all;
}

/* ===== FORM ===== */
.form-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.form-main { display: flex; flex-direction: column; }
.form-sidebar { position: sticky; top: 24px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.client-form .form-group,
.client-form .form-main .form-group {
  margin-bottom: 18px;
}

.client-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.client-form input[type="text"],
.client-form input[type="email"],
.client-form input[type="date"],
.client-form input[type="password"],
.client-form textarea {
  width: 100%;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: all 0.3s var(--ease);
}

.client-form input:focus,
.client-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  box-shadow: 0 0 0 4px var(--glow-soft);
}

.client-form textarea {
  resize: vertical;
  min-height: 80px;
}

/* Checkbox custom */
.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: var(--text) !important;
}

.checkbox-line input { display: none; }

.checkbox-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.checkbox-line input:checked + .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-line input:checked + .checkbox-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-contrast);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ===== SUBSCRIPTION OPTIONS ===== */
.sub-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-option {
  cursor: pointer;
  display: block;
}

.sub-option input { display: none; }

.sub-card {
  padding: 16px;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s var(--ease);
  position: relative;
}

.sub-option:hover .sub-card {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}

.sub-option input:checked + .sub-card {
  border-color: var(--accent);
  background: var(--glow-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.sub-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.sub-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.sub-price {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.sub-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.sub-features li {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
}

.sub-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.sub-more {
  color: var(--text-dim) !important;
  font-style: italic;
}

.sub-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 100px;
}

.type-one-time {
  color: var(--text-muted);
  background: var(--surface-hover);
}

.type-subscription {
  color: var(--accent);
  background: var(--glow-soft);
}

/* ===== CLIENT DETAIL ===== */
.client-detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.client-detail-main { display: flex; flex-direction: column; }
.client-detail-side { position: sticky; top: 24px; }

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.detail-value {
  font-weight: 500;
  text-align: right;
}

.detail-value.mono {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.82rem;
}

.deliverables-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deliverables-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.deliverables-list svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===== TASK LIST ===== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  transition: background 0.2s var(--ease);
}

.task-row:hover { background: var(--surface-hover); }

.task-cat {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.cat-strategy { color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 12%, transparent); }
.cat-design { color: var(--accent); background: var(--glow-soft); }
.cat-dev { color: #3b82f6; background: color-mix(in srgb, #3b82f6 12%, transparent); }
.cat-copy { color: #ec4899; background: color-mix(in srgb, #ec4899 12%, transparent); }
.cat-content { color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, transparent); }
.cat-growth { color: #10b981; background: color-mix(in srgb, #10b981 12%, transparent); }
.cat-delivery { color: var(--text-muted); background: var(--surface-hover); }

.task-title {
  font-size: 0.88rem;
  transition: all 0.2s;
}

.task-title.done {
  color: var(--text-dim);
  text-decoration: line-through;
}

.task-status-select {
  padding: 5px 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.task-status-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .form-layout { grid-template-columns: 1fr; }
  .form-sidebar { position: static; }
  .client-detail-grid { grid-template-columns: 1fr; }
  .client-detail-side { position: static; }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    overflow-x: auto;
  }
  .admin-logo { margin-bottom: 0; padding: 0; }
  .admin-nav { flex-direction: row; flex: 0; gap: 2px; }
  .admin-nav a { padding: 8px 12px; }
  .admin-nav a span { display: none; }
  .admin-sidebar-footer {
    border-top: none;
    padding-top: 0;
    flex-direction: row;
    margin-left: auto;
  }
  .admin-user-info { display: none; }
  .admin-logout { padding: 8px; }
  .admin-logout span { display: none; }

  .admin-main { padding: 24px 20px; }
  .admin-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .admin-stats { grid-template-columns: 1fr; }
  .admin-card { padding: 20px; }
  .admin-table { font-size: 0.82rem; }
  .admin-table th,
  .admin-table td { padding: 10px 8px; }
}

/* ============================================================
   PORTOFOLIU ADMIN
   ============================================================ */

.portfolio-filters {
  padding: 20px 24px;
}

.portfolio-filters .form-row {
  grid-template-columns: 2fr 1fr 1fr 1fr;
  margin-bottom: 12px;
}

.portfolio-filters .form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.portfolio-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.portfolio-form .form-group {
  margin-bottom: 16px;
}

.portfolio-form input[type="file"] {
  padding: 10px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  width: 100%;
  cursor: pointer;
}

.portfolio-form input[type="file"]::file-selector-button {
  padding: 6px 12px;
  margin-right: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.img-preview {
  display: block;
  max-width: 180px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  background: var(--surface);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 1;
  background: var(--surface);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s;
}

.gallery-remove:hover {
  background: #ef4444;
}

@media (max-width: 900px) {
  .portfolio-filters .form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   PROJECT MANAGER
   ============================================================ */

.projects-filters { padding: 20px 24px; }
.projects-filters .form-row { grid-template-columns: 2fr 1fr 1fr 1fr; margin-bottom: 12px; }
.projects-filters .form-actions { display: flex; gap: 8px; margin-top: 4px; }

.projects-table-wrap { overflow-x: auto; }

.status-pill,
.priority-pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
  white-space: nowrap;
}

/* Status proiect */
.status-new             { color: var(--text-muted); background: var(--surface-hover); }
.status-analysis        { color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 12%, transparent); }
.status-planning        { color: #3b82f6; background: color-mix(in srgb, #3b82f6 12%, transparent); }
.status-in_progress     { color: var(--accent); background: var(--glow-soft); }
.status-waiting_client  { color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, transparent); }
.status-blocked         { color: #ef4444; background: color-mix(in srgb, #ef4444 12%, transparent); }
.status-review          { color: #06b6d4; background: color-mix(in srgb, #06b6d4 12%, transparent); }
.status-done            { color: #10b981; background: color-mix(in srgb, #10b981 12%, transparent); }
.status-archived        { color: var(--text-dim); background: var(--surface-hover); opacity: 0.6; }

/* Status task */
.status-todo            { color: var(--text-muted); background: var(--surface-hover); }
.status-in_progress.status-pill { color: #3b82f6; background: color-mix(in srgb, #3b82f6 12%, transparent); }
.status-review.status-pill      { color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, transparent); }
.status-blocked.status-pill     { color: #ef4444; background: color-mix(in srgb, #ef4444 12%, transparent); }
.status-done.status-pill        { color: #10b981; background: color-mix(in srgb, #10b981 12%, transparent); }

/* Prioritate */
.priority-low    { color: var(--text-dim); background: var(--surface-hover); }
.priority-normal { color: var(--text-muted); background: var(--surface-hover); }
.priority-high   { color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, transparent); }
.priority-urgent { color: #ef4444; background: color-mix(in srgb, #ef4444 12%, transparent); font-weight: 800; }

.text-danger { color: #ef4444; font-weight: 600; }

/* Progress mini */
.progress-mini {
  display: inline-block;
  width: 60px;
  height: 4px;
  background: var(--surface-hover);
  border-radius: 100px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 8px;
}
.progress-mini-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
}
.progress-mini-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Inline form */
.inline-form-toggle { margin: 12px 0 0; }
.inline-form-toggle summary { list-style: none; margin-bottom: 16px; }
.inline-form-toggle summary::-webkit-details-marker { display: none; }

.inline-form {
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
}

.inline-form .form-group { margin-bottom: 14px; }
.inline-form .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.inline-form label { display: block; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-bottom: 6px; }
.inline-form input,
.inline-form select,
.inline-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
.inline-form input:focus,
.inline-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow-soft); }

/* Task stats */
.task-stats-inline { display: flex; gap: 8px; flex-wrap: wrap; }

/* Time summary */
.time-summary {
  display: flex;
  gap: 24px;
  padding: 12px 16px;
  background: var(--surface-hover);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.time-summary strong { color: var(--text); }

/* Financial */
.financial-grid { display: flex; flex-direction: column; }
.financial-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.financial-row:last-child { border-bottom: none; }
.financial-label { color: var(--text-muted); }
.financial-value { font-weight: 600; }

/* Status distribution */
.status-dist { display: flex; gap: 12px; flex-wrap: wrap; }
.status-dist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface-hover);
  border-radius: 100px;
  font-size: 0.85rem;
}
.status-dist-count { font-weight: 700; color: var(--text); }

@media (max-width: 900px) {
  .projects-filters .form-row { grid-template-columns: 1fr; }
}

/* ============================================================
   OFFERS
   ============================================================ */

.offer-form .form-group { margin-bottom: 16px; }

/* Status oferte */
.status-draft            { color: var(--text-muted); background: var(--surface-hover); }
.status-internal_review  { color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 12%, transparent); }
.status-sent             { color: #3b82f6; background: color-mix(in srgb, #3b82f6 12%, transparent); }
.status-viewed           { color: #06b6d4; background: color-mix(in srgb, #06b6d4 12%, transparent); }
.status-accepted         { color: #10b981; background: color-mix(in srgb, #10b981 12%, transparent); }
.status-refused          { color: #ef4444; background: color-mix(in srgb, #ef4444 12%, transparent); }
.status-expired          { color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, transparent); }
.status-cancelled        { color: var(--text-dim); background: var(--surface-hover); opacity: 0.6; }

/* ============================================================
   KNOWLEDGE BASE
   ============================================================ */

.kb-form .kb-content-input {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  min-height: 400px;
}

.kb-preview {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text);
}

.kb-preview h1,
.kb-preview h2,
.kb-preview h3,
.kb-preview h4 {
  margin: 24px 0 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.kb-preview h1 { font-size: 1.8rem; margin-top: 0; }
.kb-preview h2 { font-size: 1.4rem; }
.kb-preview h3 { font-size: 1.15rem; }
.kb-preview h4 { font-size: 1rem; }

.kb-preview p { margin: 12px 0; }
.kb-preview a { color: var(--accent); text-decoration: underline; }

.kb-preview ul,
.kb-preview ol {
  margin: 12px 0;
  padding-left: 24px;
}

.kb-preview li { margin: 6px 0; }

.kb-preview code {
  background: var(--surface-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.88em;
}

.kb-preview pre {
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  overflow-x: auto;
  margin: 16px 0;
}

.kb-preview pre code {
  background: none;
  padding: 0;
}

.kb-preview blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-muted);
  font-style: italic;
}

.kb-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

.kb-preview th,
.kb-preview td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}

.kb-preview th {
  background: var(--surface-hover);
  font-weight: 600;
}

.kb-excerpt p {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
}

/* ============================================================
   ANALYTICS
   ============================================================ */

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.analytics-kpi {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.analytics-kpi-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.analytics-kpi-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.analytics-kpi-value.good { color: #10b981; }
.analytics-kpi-value.bad { color: #ef4444; }
.analytics-kpi-value.warn { color: #f59e0b; }