/* ============================================================
   FOTOS VON DANIEL — PREMIUM DASHBOARD 2026
   Inspired by modern dark UI with orange/gold accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ──────────────────────────────────────── */
:root {
  --bg:           #0d0d0f;
  --bg-card:      #161618;
  --bg-card-2:    #1e1e22;
  --bg-hover:     rgba(255,255,255,0.04);
  --accent:       #e07b39;
  --accent-light: rgba(224,123,57,0.12);
  --accent-hover: #f08c4a;
  --accent-glow:  rgba(224,123,57,0.25);
  --success:      #22c55e;
  --success-light:rgba(34,197,94,0.12);
  --danger:       #ef4444;
  --danger-light: rgba(239,68,68,0.12);
  --warning:      #f59e0b;
  --warning-light:rgba(245,158,11,0.12);
  --info:         #3b82f6;
  --text:         #f0f0f3;
  --text-muted:   #71717a;
  --text-subtle:  #3f3f46;
  --border:       rgba(255,255,255,0.07);
  --border-strong:rgba(255,255,255,0.14);
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --radius:       12px;
  --radius-lg:    18px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --transition:   all 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar brand area */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 140px;
  height: auto;
  flex-shrink: 0;
}

/* Sidebar section label */
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 20px 20px 8px;
}

/* Nav links */
nav {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 2px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

nav a i { width: 18px; height: 18px; flex-shrink: 0; }

nav a:hover {
  color: var(--text);
  background: var(--bg-hover);
}

nav a.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

nav a.active i { color: var(--accent); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--transition);
}

.sidebar-footer a:hover { color: var(--danger); background: var(--danger-light); }

/* ── Sidebar Overlay (mobile) ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
}

/* ── Main area ───────────────────────────────────────────── */
main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.topbar-hamburger:hover { background: var(--bg-hover); color: var(--text); }

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

.topbar-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

/* ── Page content ────────────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header, .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1, .header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(224,123,57,0.08); }

.stat-card-text {}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

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

/* ── Generic Card ────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.card-header h2 { font-size: 1rem; font-weight: 700; }

.card-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.card-body { padding: 24px; }

/* ── Table ───────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

thead tr { background: var(--bg-card-2); }

th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

td { padding: 13px 16px; border-top: 1px solid var(--border); vertical-align: middle; }

tr:hover td { background: var(--bg-hover); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.badge-success  { background: var(--success-light);  color: var(--success); }
.badge-warning  { background: var(--warning-light);  color: var(--warning); }
.badge-danger   { background: var(--danger-light);   color: var(--danger); }
.badge-info     { background: rgba(59,130,246,0.12); color: var(--info); }
.badge-neutral  { background: var(--bg-card-2); color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.btn-danger { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-ghost { background: none; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 8px;
  background: var(--bg-card-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-icon:hover { color: var(--text); border-color: var(--border-strong); }
.btn-icon.danger:hover { color: var(--danger); border-color: rgba(239,68,68,0.3); background: var(--danger-light); }
.btn-icon i { width: 16px; height: 16px; }

/* Action buttons in tables */
.actions { display: flex; gap: 8px; }
.action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.action-btn:hover { color: var(--text); background: var(--bg-hover); }
.action-delete:hover { color: var(--danger) !important; background: var(--danger-light) !important; }

/* ── Form Elements ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

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

input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}

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

input::placeholder { color: var(--text-muted); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal {
  background: var(--bg-card);
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  padding: 28px;
  box-shadow: var(--shadow);
}

.modal h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 20px; }

/* ── Status select ───────────────────────────────────────── */
.status-select {
  background: var(--bg-card-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ── Watermark overlay (photos page) ────────────────────── */
.wm-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  z-index: 10;
}
.wm-corner { cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s; border: 1px dashed transparent; }
.wm-corner:hover { background-color: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }
.wm-corner.active { background-color: rgba(224,123,57,0.35); border-color: var(--accent); }
.wm-corner > svg { opacity: 0; width: 24px; height: 24px; color: #fff; transition: opacity 0.2s; }
.wm-corner:hover > svg { opacity: 0.5; }
.wm-corner.active > svg { opacity: 1; color: #fff; }
.wm-corner.active[data-wm-type="black"] > svg { fill: #000; color: #000; }
/* ── M3 (Material 3) form elements (photos page) ─────────── */
.m3-label { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: 0.35rem; }
.m3-input { background: transparent; border: 1px solid var(--border); padding: 0.75rem 1rem; border-radius: 8px; color: var(--text); font-size: 0.875rem; transition: var(--transition); width: 100%; }
select.m3-input { appearance: none; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%239ca3af%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
select.m3-input option { color: #000; }
.m3-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); outline: none; }

/* ── M3 Switch ───────────────────────────────────────────── */
.m3-switch { position: relative; display: inline-flex; align-items: center; gap: 0.75rem; cursor: pointer; user-select: none; }
.m3-switch-track { width: 52px; height: 32px; flex-shrink: 0; background: var(--bg); border: 2px solid var(--border); border-radius: 16px; position: relative; transition: all 0.2s; }
.m3-switch-thumb { width: 16px; height: 16px; background: var(--text-muted); border-radius: 50%; position: absolute; top: 6px; left: 6px; transition: all 0.2s cubic-bezier(0.4,0,0.2,1); }
.m3-switch input:checked + .m3-switch-track { background: var(--accent); border-color: var(--accent); }
.m3-switch input:checked + .m3-switch-track .m3-switch-thumb { background: #fff; left: 24px; width: 20px; height: 20px; top: 4px; }

/* ── Public / Login page ─────────────────────────────────── */
.public-page main { margin-left: 0; }

/* ── Sidebar Logo area (customer portal) ─────────────────── */
.sidebar-brand-customer { padding: 20px; border-bottom: 1px solid var(--border); }
.sidebar-brand-customer img { width: 150px; height: auto; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content { animation: fadeInUp 0.4s ease-out both; }

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(224,123,57,0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(224,123,57,0); }
  100% { box-shadow: 0 0 0 0 rgba(224,123,57,0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }
.success-btn { background: var(--success) !important; }

/* GitLab indicator */
@keyframes pulse {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(251,191,36,0.7); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 6px rgba(251,191,36,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(251,191,36,0); }
}

/* ── Avatar initials ─────────────────────────────────────── */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Sidebar becomes an off-canvas drawer */
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.6);
  }

  .sidebar-overlay.open { display: block; }

  main { margin-left: 0; }

  .topbar-hamburger { display: flex; }

  .page-content { padding: 16px; }

  .topbar { padding: 0 16px; }

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

  table { font-size: 0.8rem; }
  th, td { padding: 10px 12px; }

  /* Table horizontal scroll */
  .card { overflow-x: auto; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-value { font-size: 1.5rem; }
}

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