/* ── VARIABLES ── */
:root {
  --bg:      #080808;
  --s1:      #0f0f0f;
  --s2:      #161616;
  --s3:      #1e1e1e;
  --border:  rgba(255,255,255,0.07);
  --gold:    #c9a84c;
  --gold-l:  #dfc06e;
  --gold-d:  #a8892e;
  --white:   #f0f0f0;
  --gray:    #888;
  --gray-l:  #bbb;
  --font:    'Inter', sans-serif;
  --mono:    'JetBrains Mono', monospace;
  --sidebar: 240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--white); font-family: var(--font); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
.mono  { font-family: var(--mono); }
.dim   { color: var(--gray); }
.small { font-size: 12px; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 50%, rgba(201,168,76,.06) 0%, transparent 60%), var(--bg);
}
.login-box {
  background: var(--s1);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 8px;
  padding: 52px 44px;
  width: 100%; max-width: 400px;
}
.login-brand {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 6px;
}
.brand-et  { font-size: 24px; font-weight: 900; color: var(--gold); letter-spacing: 3px; }
.brand-dot { color: var(--gold-d); }
.brand-sub { font-size: 13px; font-weight: 700; letter-spacing: 4px; color: var(--gray-l); text-transform: uppercase; }
.login-desc { font-size: 13px; color: var(--gray); margin-bottom: 32px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }

/* ── FLASH MESSAGES ── */
.flash {
  padding: 12px 16px; border-radius: 4px; font-size: 14px; margin-bottom: 16px;
}
.flash-error   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #f87171; }
.flash-success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.25); color: #4ade80; }

/* ── FORM ELEMENTS ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--gray); }
.input {
  background: var(--s3);
  border: 1px solid var(--border);
  color: var(--white);
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font);
  border-radius: 4px;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.input:focus { border-color: var(--gold-d); }
.input option { background: var(--s3); }
.textarea { resize: vertical; min-height: 60px; }

/* ── BUTTONS ── */
.btn-login {
  background: var(--gold);
  color: #000;
  border: none;
  padding: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  transition: background .2s;
  margin-top: 6px;
}
.btn-login:hover { background: var(--gold-l); }
.btn-add {
  display: inline-flex; align-items: center;
  background: var(--gold);
  color: #000;
  border: none;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  transition: background .2s;
}
.btn-add:hover { background: var(--gold-l); }
.btn-open {
  display: inline-flex; align-items: center;
  background: var(--gold);
  color: #000;
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  margin-top: 32px;
  transition: background .2s;
}
.btn-open:hover { background: var(--gold-l); }
.btn-logout {
  font-size: 12px; color: var(--gray); cursor: pointer;
  background: none; border: none; font-family: var(--font);
  transition: color .2s;
}
.btn-logout:hover { color: var(--white); }
.btn-edit {
  background: rgba(201,168,76,.12); border: 1px solid rgba(201,168,76,.25);
  color: var(--gold); padding: 6px 12px; font-size: 12px; font-weight: 600;
  border-radius: 3px; cursor: pointer; font-family: var(--font);
}
.btn-edit:hover { background: rgba(201,168,76,.25); }
.btn-del {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2);
  color: #f87171; padding: 6px 10px; font-size: 12px; font-weight: 600;
  border-radius: 3px; cursor: pointer; font-family: var(--font);
}
.btn-del:hover { background: rgba(239,68,68,.2); }
.btn-gray {
  background: var(--s3); border: 1px solid var(--border); color: var(--gray-l);
  padding: 10px 20px; font-size: 13px; border-radius: 4px; cursor: pointer; font-family: var(--font);
}

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

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar);
  background: var(--s1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 28px 20px;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 10;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 40px;
}
.brand-et {
  width: 40px; height: 40px;
  background: var(--gold);
  color: #000;
  font-size: 14px; font-weight: 900; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; flex-shrink: 0;
}
.brand-name    { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: var(--white); }
.brand-tagline { font-size: 11px; color: var(--gray); letter-spacing: 1px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 4px;
  font-size: 13px; font-weight: 500; color: var(--gray-l);
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--s3); color: var(--white); }
.nav-item.active { background: rgba(201,168,76,.12); color: var(--gold); }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }

.sidebar-footer {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 20px; border-top: 1px solid var(--border);
}
.sidebar-user { font-size: 12px; color: var(--gray); font-family: var(--mono); }

/* ── MAIN ── */
.main {
  margin-left: var(--sidebar);
  flex: 1;
  padding: 40px 48px;
  max-width: calc(100vw - var(--sidebar));
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px;
}
.page-title { font-size: 28px; font-weight: 700; color: var(--white); }
.page-sub   { font-size: 14px; color: var(--gray); margin-top: 4px; }

/* ── STATS ROW ── */
.stats-row { display: flex; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.stat-chip {
  background: var(--s2); border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 22px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.stat-num { font-size: 28px; font-weight: 700; color: var(--gold); line-height: 1; }
.stat-lbl { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gray); }

/* ── TILES ── */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.tile {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
  transition: border-color .2s, transform .2s;
  cursor: pointer;
}
.tile:hover { border-color: rgba(201,168,76,.4); transform: translateY(-2px); }
.tile:hover .tile-glow { opacity: .06; }

.tile-glow {
  position: absolute; bottom: -40px; right: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  filter: blur(40px); opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.tile-top {
  display: flex; align-items: center; justify-content: space-between;
}
.tile-icon   { font-size: 28px; }
.tile-status {
  font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px; border: 1px solid;
}
.tile-name { font-size: 16px; font-weight: 700; color: var(--white); }
.tile-desc {
  font-size: 13px; color: var(--gray); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
}
.tile-tech  { font-size: 11px; color: var(--gray); font-family: var(--mono); }
.tile-arrow { color: var(--gold); font-size: 16px; transition: transform .2s; }
.tile:hover .tile-arrow { transform: translateX(3px); }

/* ── EMPTY STATE ── */
.empty-state {
  grid-column: 1/-1; text-align: center; padding: 80px;
  color: var(--gray); display: flex; flex-direction: column; align-items: center; gap: 20px;
}

/* ── DETAIL PAGE ── */
.detail-back { margin-bottom: 24px; }
.back-link { font-size: 13px; color: var(--gray); transition: color .2s; }
.back-link:hover { color: var(--gold); }

.detail-header {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 36px; flex-wrap: wrap;
}
.detail-icon  { font-size: 52px; }
.detail-title { font-size: 32px; font-weight: 700; color: var(--white); }
.detail-slug  { font-size: 13px; color: var(--gray); font-family: var(--mono); }
.detail-status {
  font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 16px; border-radius: 20px; border: 1px solid; margin-left: auto;
}

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.detail-card {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: 6px; padding: 24px;
}
.detail-card.full-width { grid-column: 1/-1; }
.card-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gray); margin-bottom: 10px; }
.card-text  { font-size: 14px; color: var(--gray-l); line-height: 1.7; }

.tech-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tech-tag {
  background: rgba(201,168,76,.1); border: 1px solid rgba(201,168,76,.25);
  color: var(--gold); font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 3px; font-family: var(--mono);
}
.detail-url { font-family: var(--mono); font-size: 13px; color: var(--gold); }
.detail-url:hover { text-decoration: underline; }

/* ── MANAGE PAGE ── */
.manage-card {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: 8px; padding: 28px; margin-bottom: 24px;
}
.manage-card-title {
  font-size: 15px; font-weight: 700; color: var(--white);
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.manage-form { display: flex; flex-direction: column; gap: 14px; }
.form-row-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.manage-table-wrap { overflow-x: auto; }
.manage-table { width: 100%; border-collapse: collapse; }
.manage-table th {
  background: rgba(255,255,255,.03); color: var(--gray);
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border);
}
.manage-table td {
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 13px; vertical-align: middle;
}
.manage-table tr:hover td { background: rgba(255,255,255,.02); }
.p-icon   { font-size: 18px; margin-right: 8px; }
.badge    { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 3px 9px; border-radius: 12px; border: 1px solid; }
.action-row { display: flex; gap: 6px; align-items: center; }

/* ── USERS ── */
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.users-list { display: flex; flex-direction: column; gap: 2px; }
.user-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-radius: 6px;
  transition: background .15s; flex-wrap: wrap; gap: 10px;
}
.user-row:hover { background: rgba(255,255,255,.03); }
.user-info { display: flex; align-items: center; gap: 14px; }
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(201,168,76,.15); border: 1px solid rgba(201,168,76,.3);
  color: var(--gold); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name  { font-size: 14px; font-weight: 600; color: var(--white); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-you   { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; background: rgba(201,168,76,.15); color: var(--gold); padding: 2px 7px; border-radius: 10px; }
.user-since { font-size: 12px; color: var(--gray); margin-top: 2px; font-family: var(--mono); }
.user-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Role badges */
.role-badge { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; }
.role-badge.admin  { background: rgba(201,168,76,.15); color: var(--gold); }
.role-badge.client { background: rgba(59,130,246,.12); color: #60a5fa; }

/* Sidebar user info */
.sidebar-user-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }

/* Project checkboxes in modal */
.proj-checkboxes { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.proj-check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 4px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.proj-check-row:hover { background: rgba(255,255,255,.04); }
.proj-check-row:has(input:checked) { background: rgba(201,168,76,.08); border-color: rgba(201,168,76,.25); }
.proj-checkbox { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; flex-shrink: 0; }
.proj-check-icon { font-size: 18px; }
.proj-check-name { font-size: 14px; color: var(--gray-l); }

/* Client card */
.client-card .client-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; color: var(--gray-l); }
.client-ico { font-size: 16px; width: 24px; text-align: center; }
.client-link { color: var(--gold); transition: opacity .2s; }
.client-link:hover { opacity: .8; text-decoration: underline; }

/* Tile client */
.tile-client { font-size: 12px; color: var(--gray); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--s1); border: 1px solid rgba(201,168,76,.2);
  border-radius: 8px; padding: 36px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal-title  { font-size: 18px; font-weight: 700; color: var(--white); margin-bottom: 24px; }
.modal-btns   { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
