/* PROSPEKT Portal — portal.css */
/* B2B client workspace: minimal, professional, mobile-responsive */

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

:root {
  --brand:      rgb(17, 17, 17);
  --accent:     rgb(184, 115, 51);
  --accent-dk:  rgb(156, 98, 43);
  --success:    #1a8a3e;
  --danger:     #c0392b;
  --warn:       #e67e22;
  --bg:         rgb(245, 238, 228);
  --surface:    #ffffff;
  --border:     rgb(224, 221, 213);
  --text:       rgb(17, 17, 17);
  --text-muted: rgb(129, 133, 139);
  --radius:     4px;
  --shadow:     0 2px 4px rgba(0,0,0,.06);
  /* Brand palette */
  --copper:         rgb(184, 115, 51);
  --copper-dark:    rgb(156, 98, 43);
  --copper-40:      rgb(227, 199, 173);
  --copper-20:      rgb(241, 227, 214);
  --soft-copper:    rgb(202, 150, 102);
  --canvas:         rgb(245, 238, 228);
  --rich-black:     rgb(17, 17, 17);
  --charcoal:       rgb(129, 133, 139);
  --border-subtle:  rgb(224, 221, 213);
}

html { font-size: 16px; }

body {
  font-family: 'acumin-pro', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--copper); text-decoration: none; }
a:hover { color: var(--copper-dark); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Layout ───────────────────────────────────────────────────── */
.page-wrap {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
}

/* ── Header / Nav ─────────────────────────────────────────────── */
.site-header {
  background: var(--canvas);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  text-decoration: none;
  display: block;
}

.site-logo__img {
  height: 40px;
  width: auto;
  display: block;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  font-size: .875rem;
  color: var(--text-muted);
}

.header-nav a:hover { color: var(--text); text-decoration: none; }

.btn-logout {
  font-size: .875rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 14px;
  cursor: pointer;
  color: var(--text-muted);
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ── Admin navigation ─────────────────────────────────────────── */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin-left: 28px;
}
.admin-nav-link {
  font-size: .875rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}
.admin-nav-link:hover {
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
}
.admin-nav-active {
  color: var(--rich-black);
  font-weight: 600;
  background: var(--copper-40);
}

/* ── Flash messages ───────────────────────────────────────────── */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .875rem;
}
.flash-success { background: #d1f5e0; color: #155724; border: 1px solid #aad4bc; }
.flash-error   { background: #fde8e8; color: #7b1c1c; border: 1px solid #f5b8b8; }

/* ── Page heading ─────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header p  { color: var(--text-muted); margin-top: 4px; font-size: .9rem; }

/* ── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--copper); text-decoration: none; }
.breadcrumb .sep { color: var(--border); }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color .15s, box-shadow .15s;
}
.project-card:hover {
  border-color: var(--copper);
  box-shadow: 0 2px 8px rgba(184,115,51,.12);
  text-decoration: none;
}

.project-card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.project-card .meta { font-size: .8rem; color: var(--text-muted); }
.project-card .pending-badge {
  display: inline-block;
  background: #fef3cd;
  color: #856404;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: .75rem;
  font-weight: 600;
  margin-top: 8px;
}

/* ── Status chips ─────────────────────────────────────────────── */
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.chip-pending      { background: #e5e7eb; color: #374151; }
.chip-approved     { background: #d1f5e0; color: #155724; }
.chip-rejected     { background: #fde8e8; color: #7b1c1c; }
.chip-needs_work   { background: #fdf3e8; color: #7a4410; }
.chip-in-review    { background: var(--copper-20); color: var(--rich-black); }
.chip-delivered    { background: var(--border-subtle); color: var(--rich-black); }
.chip-overdue      { background: #fde8e8; color: #7b1c1c; }

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  font-weight: 600;
}
tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafafa; }
tr.overdue td { background: #fef5f5; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(184,115,51,.1);
}
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.btn-primary   { background: var(--copper); color: var(--rich-black); border-color: var(--copper); }
.btn-primary:hover { background: var(--soft-copper); border-color: var(--soft-copper); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--rich-black); border: 1.5px solid var(--rich-black); }
.btn-secondary:hover { background: var(--copper-40); border-color: var(--rich-black); text-decoration: none; }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #146230; text-decoration: none; }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #96271e; text-decoration: none; }
.btn-needs-work { background: #fff; color: #B87333; border: 1px solid #B87333; }
.btn-needs-work:hover, .btn-needs-work.btn-active { background: #B87333; color: #fff; text-decoration: none; }
.btn-sm        { padding: 5px 12px; font-size: .8rem; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ── Progress bar ─────────────────────────────────────────────── */
.progress-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin: 8px 0 2px;
}
.progress-bar {
  height: 100%;
  background: var(--copper);
  border-radius: 99px;
  transition: width .3s;
}
.progress-label { font-size: .75rem; color: var(--text-muted); }

/* ── Gallery image grid ───────────────────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.image-card {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color .15s, transform .1s;
  aspect-ratio: 4/3;
  background: #e5e7eb;
}
.image-card:hover { transform: scale(1.02); border-color: var(--copper); }
.image-card.status-approved { border-color: var(--success); }
.image-card.status-rejected { border-color: var(--danger); opacity: .7; }
.image-card.status-needs_work { border-color: #B87333; opacity: .85; }
.image-card.status-pending  { border-color: transparent; }

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-status-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.8);
}
.status-dot-pending  { background: #9ca3af; }
.status-dot-approved { background: var(--success); }
.status-dot-rejected { background: var(--danger); }
.status-dot-needs_work { background: #B87333; }

/* ── Gallery header stats ─────────────────────────────────────── */
.gallery-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.gallery-stats strong { color: var(--text); }

/* ── Comments ─────────────────────────────────────────────────── */
.comment-thread { margin-top: 24px; }
.comment-thread h3 { font-size: .9rem; font-weight: 600; margin-bottom: 12px; }
.comment-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.comment-item {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .875rem;
}
.comment-meta { font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
}
.comment-form textarea:focus { outline: none; border-color: var(--copper); }

/* ── Lightbox ─────────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox-overlay.hidden { display: none; }

.lightbox-container {
  display: flex;
  gap: 0;
  max-width: 1100px;
  width: 100%;
  max-height: calc(100vh - 32px);
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
}

.lightbox-img-pane {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.lightbox-img-pane img {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  padding: 12px 8px;
  cursor: pointer;
  border-radius: 4px;
}
.lightbox-nav:hover { background: rgba(255,255,255,.24); }
.lightbox-nav.prev { left: 8px; }
.lightbox-nav.next { right: 8px; }

.lightbox-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--surface);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 316px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

.lightbox-filename {
  font-size: .8rem;
  color: var(--text-muted);
  word-break: break-all;
}

.lightbox-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lightbox-actions .btn { width: 100%; justify-content: center; }

.lightbox-collab-note {
  background: var(--copper-20);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: .8rem;
  color: var(--rich-black);
}


/* ── Admin lightbox comments ──────────────────────────────────── */
.alb-comment-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  overflow-y: auto;
}

.alb-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alb-comment-item {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.alb-comment-meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.alb-comment-body {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

/* ── Login page ───────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.auth-card h1 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.auth-card .auth-subtitle { font-size: .875rem; color: var(--text-muted); margin-bottom: 24px; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: 8px;
  padding: 28px 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.modal-box h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.modal-box p  { font-size: .9rem; color: var(--text-muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Toggle switch ────────────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 22px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--copper); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .page-wrap    { padding: 16px 16px 40px; }
  .card         { padding: 16px; }
  .auth-card    { padding: 28px 24px; }
  .image-grid   { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .card-grid    { grid-template-columns: 1fr; }

  .lightbox-container { flex-direction: column; }
  .lightbox-sidebar   { width: 100%; max-height: 240px; }
  .lightbox-close     { right: 12px; }

  table { font-size: .8rem; }
  thead th, tbody td { padding: 8px; }
}

@media (max-width: 480px) {
  .image-grid { grid-template-columns: repeat(2, 1fr); }
  .header-nav .nav-label { display: none; }
}

/* ── Loupe magnifier ─────────────────────────────────────────────────────── */
.loupe {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid #B87333;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  pointer-events: none;
  display: none;
  background-repeat: no-repeat;
  background-color: #111111;
  z-index: 1000;
  transform: translate(-50%, -50%);
}
.loupe-active .loupe         { display: block; }
.loupe-active #lb-img-pane   { cursor: crosshair; }
#loupe-toggle.loupe-on {
  background: #B87333;
  color: #ffffff;
  border-color: #B87333;
}
@media (hover: none) {
  #loupe-toggle       { display: none !important; }
  .loupe-mobile-note  { display: block !important; }
}
.loupe-mobile-note {
  display: none;
  font-size: 12px;
  color: var(--text-muted, #81858B);
  margin-top: 8px;
}

/* ── Header user info (client welcome + date) ────────────────────────────── */
.header-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.header-welcome {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #111111);
}
.header-datetime {
  font-size: 0.75rem;
  color: var(--text-secondary, #81858B);
}

