/* EM Fotosprint — Design System CSS */

:root {
  --color-primary: #800500;
  --color-primary-hover: #a00600;
  --color-primary-dark: #5c0400;

  --color-bg: #f7f7f7;
  --color-surface: #ffffff;
  --color-surface-alt: #f8f8f8;
  --color-border: #e0e0e0;
  --color-border-light: #eeeeee;

  --color-text: #313131;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-text-inverse: #ffffff;

  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-warning: #f59e0b;
  --color-info: #3498db;

  --color-nav-bg: #1a1a1a;
  --color-nav-text: #e0e0e0;
  --color-nav-active: #800500;
  --color-nav-hover: #2a2a2a;

  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

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

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 260px;
  background: var(--color-nav-bg);
  color: var(--color-nav-text);
  padding: var(--space-5) 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 var(--space-5);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-brand h1 {
  font-size: 1.1rem; font-weight: 700; color: #fff; line-height: 1.2;
}
.sidebar-brand h1 span {
  display: block; font-size: 0.7rem; font-weight: 400; color: var(--color-text-muted);
  letter-spacing: 0.5px; text-transform: uppercase;
}

/* Sidebar toggle button */
.sidebar-toggle {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 4px 0;
  margin: 0 auto var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.sidebar-toggle:hover { background: var(--color-nav-hover); color: #fff; }
.sidebar .toggle-closed { display: none; }
.sidebar .toggle-open { display: block; width: 18px; height: 18px; }
.sidebar.collapsed .toggle-closed { display: block; width: 18px; height: 18px; }
.sidebar.collapsed .toggle-open { display: none; }

/* Sidebar collapsed state */
.sidebar { transition: width 0.2s ease; }
.main { transition: margin-left 0.2s ease; }

.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .sidebar-brand h1 { display: none; }
.sidebar.collapsed .sidebar-section { display: none; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  border-left: 3px solid transparent;
}
.sidebar.collapsed .nav-item i { margin: 0; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-footer { flex-direction: column; gap: 8px; padding: var(--space-3) 4px; align-items: center; }
.sidebar.collapsed .sidebar-footer .user-info { display: none; }
.sidebar.collapsed ~ .main { margin-left: 68px; }

.sidebar-nav { flex: 1; }

.sidebar-section {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px;
  color: #666; padding: var(--space-4) var(--space-5) var(--space-2); font-weight: 600;
}

.nav-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  color: var(--color-nav-text); text-decoration: none;
  font-size: 0.9rem; cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--color-nav-hover); color: #fff; }
.nav-item.active {
  background: rgba(128, 5, 0, 0.15); color: #fff;
  border-left-color: var(--color-primary); font-weight: 600;
}
.nav-item i { width: 20px; height: 20px; opacity: 0.7; }
.nav-item.active i { opacity: 1; }

.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid #333;
  display: flex; align-items: center; gap: var(--space-3);
  font-size: 0.85rem;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}

.sidebar-footer .user-info { flex: 1; }
.sidebar-footer .user-name { font-weight: 600; color: #fff; font-size: 0.85rem; }
.sidebar-footer .user-role { font-size: 0.7rem; color: var(--color-text-muted); }

/* ========== MAIN ========== */
.main {
  flex: 1;
  margin-left: 260px;
  padding: var(--space-6);
  max-width: 1200px;
}

/* ========== PAGE HEADER ========== */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-6); flex-wrap: wrap; gap: var(--space-3);
}
.page-header h2 { font-size: 1.6rem; font-weight: 700; }
.page-header p { color: var(--color-text-secondary); font-size: 0.9rem; margin-top: var(--space-1); }

/* ========== CARDS ========== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.card-title { font-size: 1rem; font-weight: 700; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }

/* ========== STAT CARDS ========== */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  display: flex; align-items: flex-start; gap: var(--space-4);
}
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon.primary { background: rgba(128,5,0,0.1); color: var(--color-primary); }
.stat-icon.success { background: #dcfce7; color: var(--color-success); }
.stat-icon.info { background: #dbeafe; color: var(--color-info); }
.stat-icon.warning { background: #fef3c7; color: var(--color-warning); }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--color-text-secondary); margin-top: var(--space-1); }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-family); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease; text-decoration: none;
}
.btn i { width: 16px; height: 16px; }
.btn-primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary); color: #fff; }
.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-surface-alt); border-color: var(--color-text-muted); }
.btn-success { background: var(--color-success); color: #fff; }
.btn:disabled { background: #ccc; color: #888; cursor: not-allowed; opacity: 0.6; }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: 0.8rem; }
.btn-lg { padding: var(--space-3) var(--space-5); font-size: 1rem; }
.btn-row { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

/* ========== FORMS ========== */
.form-group { margin-bottom: var(--space-4); }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--color-text-secondary); margin-bottom: var(--space-1); }
.input {
  width: 100%; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-size: 0.95rem; font-family: var(--font-family);
  color: var(--color-text); background: var(--color-surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus { border-color: var(--color-primary); outline: none; box-shadow: 0 0 0 3px rgba(128, 5, 0, 0.1); }
.input::placeholder { color: var(--color-text-muted); }
select.input { appearance: auto; }

/* ========== TABLE ========== */
.table-wrapper {
  overflow-x: auto; border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: white;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.table th {
  background: var(--color-surface-alt); font-weight: 600; text-align: left;
  padding: var(--space-3) var(--space-4); border-bottom: 2px solid var(--color-border);
  white-space: nowrap; color: var(--color-text-secondary);
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-light); vertical-align: middle; }
.table tr:hover td { background: #fafafa; }
.table tr:last-child td { border-bottom: none; }
.mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--color-text-secondary); }

/* ========== BADGES ========== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; padding: 2px 10px;
  border-radius: var(--radius-full); font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f3f4f6; color: #374151; }

/* ========== ALERTS ========== */
.alert {
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  font-size: 0.9rem; display: flex; align-items: center;
  gap: var(--space-3); margin-bottom: var(--space-3);
}
.alert i { width: 20px; height: 20px; flex-shrink: 0; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ========== LOGIN ========== */
.login-wrapper {
  display: flex; justify-content: center; align-items: center;
  min-height: 100vh; width: 100%; background: var(--color-bg);
}
.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-8);
  width: 100%; max-width: 420px;
}
.login-brand {
  text-align: center; margin-bottom: var(--space-6);
}
.login-brand .logo-icon { margin: 0 auto var(--space-3); }
.login-brand h1 { font-size: 1.5rem; font-weight: 700; }
.login-brand p { font-size: 0.85rem; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 1px; }

/* ========== PROGRESS ========== */
.progress {
  width: 100%;
  height: 8px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-lg { height: 12px; }
.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}
.progress-bar.primary { background: var(--color-primary); }
.progress-bar.success { background: var(--color-success); }
.progress-bar.info { background: var(--color-info); }
.progress-bar.warning { background: var(--color-warning); }
.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

/* ========== PIPELINE STEPS ========== */
.pipeline-step {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: all 0.3s ease;
}
.pipeline-step.locked {
  opacity: 0.4;
  pointer-events: none;
  border-left-color: #d0d0d0;
  box-shadow: none;
}
.pipeline-step.locked .step-body { display: none; }
.pipeline-step.done { border-left-color: var(--color-success); }
.pipeline-step.collapsed .step-body { display: none; }
.pipeline-step.collapsed .step-header { border-bottom: none; }
.step-chevron {
  width: 20px; height: 20px; color: var(--color-text-muted);
  transition: transform 0.2s ease; flex-shrink: 0;
}
.pipeline-step.collapsed .step-chevron { transform: rotate(-90deg); }

.pipeline-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pipeline-disabled .pipeline-step { border-left-color: #d0d0d0; }
.pipeline-disabled .step-number { background: #ccc; box-shadow: none; }

.step-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
}
.pipeline-step:not(.locked) .step-header {
  border-bottom: 1px solid var(--color-border-light);
}

.step-number {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(128, 5, 0, 0.25);
}
.pipeline-step.locked .step-number {
  background: #ccc;
  box-shadow: none;
}
.pipeline-step.done .step-number {
  background: var(--color-success);
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
}

.step-title {
  font-weight: 700;
  font-size: 1.05rem;
  flex: 1;
  color: var(--color-text);
}
.pipeline-step.locked .step-title { color: var(--color-text-muted); }

.step-status { flex-shrink: 0; }

.step-body {
  padding: var(--space-5);
  padding-top: var(--space-4);
}
.step-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

/* ========== DROP ZONE ========== */
.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-5);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface-alt);
}
.drop-zone p { color: var(--color-text-secondary); font-size: 0.9rem; margin: 0; }
.drop-zone:hover, .drop-zone.drop-hover {
  border-color: var(--color-primary);
  background: rgba(128, 5, 0, 0.03);
}

/* ========== MINI STATS ========== */
.stat-row {
  display: flex; gap: var(--space-6); flex-wrap: wrap;
}
.mini-stat {
  text-align: center;
  background: var(--color-surface-alt);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  min-width: 120px;
}
.mini-stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; color: var(--color-text); }
.mini-stat-label { font-size: 0.75rem; color: var(--color-text-secondary); margin-top: var(--space-2); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* ========== BESTOF THUMBS ========== */
.bestof-thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: grab;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.bestof-thumb:hover { border-color: var(--color-primary); transform: scale(1.03); }
.bestof-thumb img { width: 100%; height: 90px; object-fit: cover; display: block; }
.bestof-num {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,0.7); color: #fff;
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 0.7rem; font-weight: 700;
}

/* ========== REVIEW CARDS ========== */
.review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.15s;
}
.review-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.review-card img {
  width: 100%; height: 130px; object-fit: cover; cursor: pointer; display: block;
}
.review-input {
  border: none; border-top: 1px solid var(--color-border-light);
  border-radius: 0; text-align: center; font-weight: 700; font-size: 0.95rem;
  padding: var(--space-2) var(--space-1);
  width: 100%;
  background: var(--color-surface);
}
.review-input:focus {
  outline: none;
  background: #fff8f0;
}

/* ========== POPUP OVERLAY ========== */
.popup-overlay {
  display: none;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  justify-content: center; align-items: center;
}
.popup-overlay.visible { display: flex; }
.popup-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 900px; width: 95%;
  max-height: 90vh; overflow: auto;
  padding: var(--space-6);
  position: relative;
  box-shadow: var(--shadow-lg);
}
.popup-close {
  position: absolute; top: var(--space-3); right: var(--space-4);
  background: none; border: none; cursor: pointer;
  font-size: 1.8rem; color: var(--color-text-muted);
  line-height: 1; padding: 4px;
  transition: color 0.15s;
}
.popup-close:hover { color: var(--color-text); }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .sidebar, .sidebar.collapsed { width: 100%; position: relative; height: auto; flex-direction: row; padding: var(--space-3); overflow-x: auto; }
  .sidebar-brand h1 span { display: none; }
  .sidebar-toggle { display: none; }
  .sidebar-nav { display: flex; flex: 1; overflow-x: auto; }
  .sidebar-section { display: none; }
  .sidebar.collapsed .nav-label { display: inline; }
  .nav-item { padding: var(--space-2) var(--space-3); border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .nav-item.active { border-left: none; border-bottom-color: var(--color-primary); }
  .sidebar-footer { display: none; }
  .main, .sidebar.collapsed ~ .main { margin-left: 0; padding: var(--space-4); }
  body { flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
}
