/* =============================================
   ARCHITECT PORTFOLIO — Admin Stylesheet
   ============================================= */

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

:root {
  --bg:        #0f1117;
  --surface:   #161b27;
  --surface-2: #1e2536;
  --border:    #2a3147;
  --text:      #e2e8f0;
  --text-muted:#8892a4;
  --accent:    #b8975a;
  --green:     #22c55e;
  --red:       #ef4444;
  --blue:      #3b82f6;
  --sidebar-w: 240px;
  --font: 'Inter', system-ui, sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; border: none; background: none; }

/* ─── LOGIN ──────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-container { width: 100%; max-width: 420px; padding: 2rem; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem;
  text-align: center;
}
.login-logo {
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.login-title { font-size: 1.2rem; font-weight: 500; margin-bottom: 0.3rem; }
.login-sub { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; }
.login-form { text-align: left; }
.login-form .form-group { margin-bottom: 1.2rem; }
.login-form label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.login-form input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.login-form input:focus { outline: none; border-color: var(--accent); }
.login-back {
  display: block;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.login-back:hover { color: var(--text); }

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

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform 0.3s ease;
}
.sidebar__logo {
  padding: 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.sidebar__logo span { color: var(--text-muted); font-weight: 300; font-size: 0.75rem; }
.sidebar__nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all 0.2s;
}
.sidebar__link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar__link:hover { color: var(--text); background: var(--surface-2); }
.sidebar__link.active { color: var(--accent); background: rgba(184,151,90,0.08); border-left: 2px solid var(--accent); }

.sidebar__view {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  transition: color 0.2s;
}
.sidebar__view svg { width: 14px; height: 14px; }
.sidebar__view:hover { color: var(--accent); }
.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: color 0.2s;
}
.sidebar__logout svg { width: 14px; height: 14px; }
.sidebar__logout:hover { color: var(--red); }

/* Main */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__toggle { color: var(--text-muted); display: none; }
.topbar__toggle svg { width: 20px; height: 20px; }
.topbar__right { display: flex; align-items: center; gap: 1rem; }
.topbar__user { font-size: 0.8rem; color: var(--text-muted); }

/* Content */
.admin-content { padding: 2rem; flex: 1; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.3rem; font-weight: 500; }

/* ─── CARDS ──────────────────────────────────── */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
}
.admin-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.admin-card__header h2 { font-size: 1rem; font-weight: 500; }
.card-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

/* ─── STATS ──────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}
.stat-card--green { border-color: rgba(34,197,94,0.3); }
.stat-card--gray  { border-color: var(--border); }
.stat-card__num {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.stat-card--green .stat-card__num { color: var(--green); }
.stat-card__label { font-size: 0.75rem; color: var(--text-muted); }

/* ─── TABLE ──────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 0.8rem;
  border-bottom: 1px solid rgba(42,49,71,0.5);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.table-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
}
.table-actions { display: flex; gap: 0.75rem; }
.action-link { font-size: 0.8rem; color: var(--accent); transition: opacity 0.2s; }
.action-link:hover { opacity: 0.7; }
.action-link--danger { color: var(--red); }
.empty { text-align: center; color: var(--text-muted); padding: 2rem !important; }

/* ─── BADGES ─────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  border-radius: 2px;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.badge--green { background: rgba(34,197,94,0.1); color: var(--green); }
.badge--gray  { background: rgba(139,148,158,0.1); color: var(--text-muted); }

/* ─── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.btn--primary { background: var(--accent); color: #0a0a0a; }
.btn--primary:hover { opacity: 0.85; }
.btn--secondary { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn--secondary:hover { border-color: var(--text-muted); }
.btn--full { width: 100%; justify-content: center; }
.btn--lg { padding: 0.75rem 1.8rem; font-size: 0.9rem; }

/* ─── FORMS ──────────────────────────────────── */
.admin-form { }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
  transition: border-color 0.2s;
  resize: vertical;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control option { background: var(--surface-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 1rem; align-items: center; padding-top: 1rem; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.4rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.85rem; }
.checkbox-label input { cursor: pointer; }

/* ─── IMAGES ─────────────────────────────────── */
.preview-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}
.img-placeholder {
  width: 100%;
  height: 160px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.gallery-item { position: relative; }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery-item__del {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  background: rgba(239,68,68,0.9);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 2px;
}

/* ─── ALERTS ─────────────────────────────────── */
.alert {
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  border-left: 3px solid;
}
.alert--success { background: rgba(34,197,94,0.08); border-color: var(--green); color: var(--green); }
.alert--error   { background: rgba(239,68,68,0.08); border-color: var(--red);   color: var(--red); }

/* ─── UTILS ──────────────────────────────────── */
.link { font-size: 0.8rem; color: var(--accent); }
.link:hover { opacity: 0.7; }
.mt { margin-top: 1rem; }

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .topbar__toggle { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .admin-content { padding: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
