/* ===== IMDGFX ADMIN — REDESIGNED ===== */

:root {
  /* Core palette */
  --bg: #070707;
  --bg-grad: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(225,6,0,0.12), transparent 60%), #070707;
  --surface: #101010;
  --surface-2: #161616;
  --surface-3: #1c1c1c;
  --elevated: #1a1a1a;
  --border: #1e1e1e;
  --border-soft: #161616;
  --border-strong: #2a2a2a;

  --text: #f5f5f5;
  --text-2: #d4d4d4;
  --muted: #888;
  --dim: #555;

  --red: #e10600;
  --red-2: #ff1f1a;
  --red-soft: rgba(225,6,0,0.10);
  --red-glow: rgba(225,6,0,0.35);
  --red-deep: #8a0300;

  --green: #4ade80;
  --green-soft: rgba(74,222,128,0.12);
  --blue: #60a5fa;
  --blue-soft: rgba(96,165,250,0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245,158,11,0.12);
  --purple: #a78bfa;
  --purple-soft: rgba(167,139,250,0.12);

  /* Shape & motion */
  --r: 10px;
  --r-sm: 6px;
  --r-lg: 14px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 50px rgba(0,0,0,0.5), 0 0 0 1px var(--border-soft);
  --glow-red: 0 0 30px rgba(225,6,0,0.18);
  --t: 180ms cubic-bezier(0.4,0,0.2,1);

  /* Layout */
  --sidebar-w: 248px;
  --top-h: 64px;
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; transition: color var(--t); }
a:hover { color: var(--red-2); }

h1, h2, h3 { font-family: 'Anton', sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.1; }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
h3 { font-size: 1rem; }

.eyebrow { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--red); font-weight: 600; }
.muted { color: var(--muted); }

::selection { background: var(--red); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ===== Login (preserved) ===== */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse 60% 40% at 50% 30%, rgba(225,6,0,0.18), transparent 60%), var(--bg); padding: 2rem; }
.login-box { background: var(--surface); border: 1px solid var(--border); padding: 2.5rem 2rem; width: 100%; max-width: 400px; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.login-box h1 { margin-bottom: 0.4rem; font-size: 2rem; }
.login-box .eyebrow { margin-bottom: 1.75rem; }
.login-box input { display: block; width: 100%; padding: 0.85rem 1rem; margin-bottom: 0.85rem; background: var(--surface-3); border: 1px solid var(--border); color: var(--text); font-size: 0.95rem; font-family: inherit; border-radius: var(--r-sm); transition: border-color var(--t); }
.login-box input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.login-box button { width: 100%; padding: 0.95rem; background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff; border: 0; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; font-family: inherit; border-radius: var(--r-sm); transition: all var(--t); box-shadow: var(--glow-red); }
.login-box button:hover { transform: translateY(-1px); box-shadow: 0 0 40px rgba(225,6,0,0.35); }
.login-box .error { background: rgba(225,6,0,0.1); color: var(--red-2); padding: 0.75rem 1rem; margin-bottom: 1rem; border-left: 3px solid var(--red); border-radius: 4px; font-size: 0.88rem; }

/* ===== Sidebar ===== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, #0c0c0c 0%, #080808 100%);
  border-right: 1px solid var(--border-soft);
  padding: 1.25rem 0.85rem;
  display: flex; flex-direction: column;
  z-index: 50;
}
.sidebar .logo {
  font-family: 'Anton', sans-serif;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
  color: var(--text);
  display: block;
}
.sidebar .logo span { color: var(--red); }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a {
  position: relative;
  padding: 0.7rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: all var(--t);
}
.sidebar nav a::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0;
  background: var(--red);
  border-radius: 0 2px 2px 0;
  transition: height var(--t);
}
.sidebar nav a:hover { background: var(--surface); color: var(--text); }
.sidebar nav a.active {
  background: linear-gradient(90deg, var(--red-soft), transparent);
  color: var(--text);
}
.sidebar nav a.active::before { height: 60%; box-shadow: 0 0 8px var(--red-glow); }
.sidebar nav a.active .nav-icon { color: var(--red); }

/* SVG icons */
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); transition: color var(--t); }
.sidebar nav a:hover .nav-icon { color: var(--text); }

/* User card at bottom */
.sidebar-foot {
  border-top: 1px solid var(--border-soft);
  padding-top: 0.85rem;
  margin-top: 0.5rem;
}
.user-card {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--r-sm);
}
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-action { font-size: 0.7rem; color: var(--dim); transition: color var(--t); }
.user-action:hover { color: var(--red); }

/* ===== Main ===== */
.main {
  margin-left: var(--sidebar-w);
  padding: 2rem 2.5rem 4rem;
  max-width: 1400px;
  min-height: 100vh;
}

/* Page head */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 2rem; gap: 1.5rem; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 2rem; }
.page-head p { color: var(--muted); margin-top: 0.4rem; font-size: 0.92rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.74rem;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--r-sm);
  transition: all var(--t);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 4px 12px rgba(225,6,0,0.25);
}
.btn:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 8px 20px rgba(225,6,0,0.4);
}
.btn:active { transform: translateY(0); }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.68rem; }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
  transform: none;
}

/* ===== Stat cards ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  position: relative;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  padding: 1.4rem 1.25rem;
  border-radius: var(--r);
  overflow: hidden;
  transition: all var(--t);
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--red), transparent);
  opacity: 0.7;
}
.stat::after {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--red-soft) 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}
.stat:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat strong {
  display: block;
  font-family: 'Anton', sans-serif;
  font-size: 2.4rem;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.stat span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
}

/* ===== Panels (cards) ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}
.panel-head h2 { margin: 0; font-size: 1rem; }

/* ===== Tables ===== */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}
.table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.88rem;
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t); }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table td a { color: var(--text); font-weight: 500; }
.table td a:hover { color: var(--red-2); }

/* ===== Pills (status) ===== */
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  white-space: nowrap;
}
.pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.pill-brief    { color: var(--muted); }
.pill-design   { color: var(--amber); border-color: rgba(245,158,11,0.3); background: var(--amber-soft); }
.pill-revisions{ color: var(--blue);  border-color: rgba(96,165,250,0.3); background: var(--blue-soft); }
.pill-approved { color: var(--green); border-color: rgba(74,222,128,0.3); background: var(--green-soft); }
.pill-delivered{ color: var(--red-2); border-color: rgba(225,6,0,0.3);   background: var(--red-soft); }

/* ===== Progress bar ===== */
.progress {
  width: 100%; max-width: 140px; height: 6px;
  background: var(--surface-3);
  overflow: hidden;
  border-radius: 999px;
  position: relative;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--red-deep), var(--red), var(--red-2));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 10px var(--red-glow);
}

/* ===== Forms ===== */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form label {
  display: flex; flex-direction: column; gap: 0.4rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.form input, .form textarea, .form select {
  padding: 0.75rem 0.95rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
  border-radius: var(--r-sm);
  transition: all var(--t);
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form .check {
  flex-direction: row; align-items: center; gap: 0.5rem;
  text-transform: none; letter-spacing: 0;
  color: var(--text); font-size: 0.92rem; font-weight: 400;
}
.form button { align-self: flex-start; }

/* ===== Flash ===== */
.flash {
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  border-radius: var(--r-sm);
  border: 1px solid;
}
.flash.ok  { background: var(--green-soft); border-color: rgba(74,222,128,0.25); color: var(--green); }
.flash.err { background: var(--red-soft); border-color: rgba(225,6,0,0.3); color: var(--red-2); }

/* ===== Feed ===== */
.feed { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.feed li {
  padding: 1rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--red);
  border-radius: var(--r-sm);
  transition: all var(--t);
}
.feed li:hover { border-left-color: var(--red-2); background: var(--surface-3); }
.feed li p { margin: 0.4rem 0; color: var(--text-2); }
.feed li small { color: var(--dim); }

/* ===== Portal (preserved) ===== */
.portal-body { background: var(--bg-grad); min-height: 100vh; background-attachment: fixed; }
.portal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 3vw;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}
.portal-head nav { display: flex; gap: 1.25rem; align-items: center; font-size: 0.88rem; }
.portal-main { max-width: 1100px; margin: 0 auto; padding: 2.5rem 3vw; }
.portal-main h1 { margin-bottom: 1.75rem; }
.project-list { display: flex; flex-direction: column; gap: 0.6rem; }
.project-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  gap: 2rem; flex-wrap: wrap;
  border-radius: var(--r-sm);
  transition: all var(--t);
}
.project-row:hover { background: var(--surface-2); transform: translateX(2px); }
.project-row h3 { margin-bottom: 0.2rem; }
.project-status { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; min-width: 200px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar {
    position: static; width: 100%;
    flex-direction: row;
    border-right: 0; border-bottom: 1px solid var(--border-soft);
    padding: 0.75rem 1rem;
    align-items: center;
    gap: 0.5rem;
  }
  .sidebar .logo { margin-bottom: 0; padding: 0; border: 0; margin-right: auto; }
  .sidebar nav { flex-direction: row; flex: 0; gap: 0; overflow-x: auto; }
  .sidebar nav a { padding: 0.5rem 0.7rem; font-size: 0.78rem; gap: 0.4rem; }
  .sidebar nav a::before { display: none; }
  .sidebar nav a.active { background: var(--surface-2); }
  .sidebar nav a span:not(.user-name):not(.user-action) { display: none; }
  .sidebar-foot { display: none; }
  .main { margin-left: 0; padding: 1.5rem 1rem 3rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form .row-2 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.6rem; }
}