/* =====================================================
   DigitalHands.in — Admin Panel Stylesheet
   ===================================================== */

:root {
  --navy:       #0f1628;
  --navy-mid:   #1a2340;
  --navy-light: #243060;
  --blue:       #4a6cf7;
  --blue-light: #6b87ff;
  --cyan:       #22d3ee;
  --green-ok:   #22c55e;
  --yellow:     #eab308;
  --red:        #ef4444;
  --text:       #e2e8f0;
  --text-mid:   #94a3b8;
  --text-dim:   #64748b;
  --border:     rgba(255,255,255,.08);
  --card-bg:    rgba(255,255,255,.04);
  --card-hover: rgba(255,255,255,.07);
  --white:      #ffffff;
  --radius:     8px;
  --radius-lg:  14px;
  --shadow:     0 4px 24px rgba(0,0,0,.3);
  --transition: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--navy);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--blue-light); text-decoration: none; }
a:hover { color: var(--cyan); }
input, select, textarea, button { font-family: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 3px; }

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #070d1f 0%, #0f1628 50%, #0d2014 100%);
  padding: 24px;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(74,108,247,.18), transparent),
              radial-gradient(ellipse 50% 40% at 90% 100%, rgba(34,211,238,.1), transparent);
  pointer-events: none;
}
.login-card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 52px 44px;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 72px rgba(0,0,0,.5);
  position: relative; z-index: 1;
}
.login-brand {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 2.4rem;
}
.login-brand-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin-bottom: .8rem;
  box-shadow: 0 8px 24px rgba(74,108,247,.35);
}
.login-brand-name {
  font-size: 1.3rem; font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-brand-tag {
  font-size: .72rem; color: var(--text-mid);
  letter-spacing: .12em; text-transform: uppercase;
  margin-top: 3px;
}
.login-title {
  font-size: 1.1rem; font-weight: 600; color: var(--text);
  margin-bottom: .3rem; text-align: center;
}
.login-sub {
  font-size: .83rem; color: var(--text-mid);
  text-align: center; margin-bottom: 2rem;
}
.form-field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px;
}
.form-field label {
  font-size: .77rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-mid);
}
.form-field input {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text); font-size: .93rem;
  outline: none; transition: border-color var(--transition);
}
.form-field input:focus {
  border-color: var(--blue);
  background: rgba(74,108,247,.06);
}
.form-field input::placeholder { color: var(--text-dim); }
.login-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--blue), #6b47ff);
  color: var(--white); border: none;
  border-radius: var(--radius); font-size: .93rem; font-weight: 600;
  cursor: pointer; margin-top: 8px;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(74,108,247,.3);
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(74,108,247,.45);
}
.login-hint {
  font-size: .78rem; color: var(--text-dim);
  text-align: center; margin-top: 1.2rem;
}
.login-hint span {
  background: rgba(255,255,255,.07);
  padding: 4px 10px; border-radius: 4px;
  font-family: 'SF Mono', 'Courier New', monospace;
  color: var(--cyan);
}
.login-error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
  border-radius: var(--radius);
  padding: 10px 14px; font-size: .85rem;
  margin-bottom: 16px; display: none;
}
.login-error.show { display: block; }
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-dim); font-size: .8rem;
}
.login-divider::before,
.login-divider::after { content:''; flex:1; height:1px; background:var(--border); }

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

/* ── Sidebar ── */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--navy-mid);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 100; overflow-y: auto;
}
.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-name {
  font-weight: 700; font-size: .95rem;
  background: linear-gradient(90deg, #fff, var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-brand-tag {
  font-size: .62rem; color: var(--text-dim);
  letter-spacing: .12em; text-transform: uppercase;
}
.sidebar-section {
  padding: 20px 12px 8px;
}
.sidebar-section-label {
  font-size: .64rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-dim);
  padding: 0 10px; margin-bottom: 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  color: var(--text-mid); font-size: .87rem;
  transition: all var(--transition); cursor: pointer;
  text-decoration: none;
}
.sidebar-link:hover {
  background: var(--card-bg); color: var(--text);
}
.sidebar-link.active {
  background: rgba(74,108,247,.15);
  color: var(--blue-light);
}
.sidebar-link-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-link-badge {
  margin-left: auto;
  background: var(--blue);
  color: var(--white);
  font-size: .64rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}
.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer; transition: background var(--transition);
}
.sidebar-user:hover { background: var(--card-bg); }
.sidebar-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: var(--white);
  flex-shrink: 0;
}
.sidebar-user-info { line-height: 1.2; }
.sidebar-user-name { font-size: .85rem; font-weight: 600; }
.sidebar-user-role { font-size: .72rem; color: var(--text-dim); }

/* ── Main content ── */
.main-content {
  flex: 1; margin-left: 240px;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: 64px;
  background: rgba(15,22,40,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title {
  font-size: 1.05rem; font-weight: 600; color: var(--text);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  background: var(--card-bg); border: 1px solid var(--border);
  color: var(--text-mid); padding: 7px 14px;
  border-radius: var(--radius); font-size: .82rem; cursor: pointer;
  transition: all var(--transition);
}
.topbar-btn:hover { background: var(--card-hover); color: var(--text); }
.topbar-btn-primary {
  background: var(--blue); border-color: var(--blue);
  color: var(--white);
}
.topbar-btn-primary:hover { background: var(--blue-light); }
.page-content { padding: 28px; flex: 1; }

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: .93rem; font-weight: 600; }
.card-body { padding: 22px; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.stat-card.blue::before  { background: var(--blue); }
.stat-card.cyan::before  { background: var(--cyan); }
.stat-card.green::before { background: var(--green-ok); }
.stat-card.gold::before  { background: #c9a96e; }
.stat-icon {
  font-size: 1.6rem; margin-bottom: .8rem;
}
.stat-value {
  font-size: 1.8rem; font-weight: 700; color: var(--text);
  line-height: 1; margin-bottom: .3rem;
}
.stat-label {
  font-size: .78rem; color: var(--text-mid);
  letter-spacing: .06em;
}
.stat-change {
  font-size: .75rem; margin-top: .5rem;
}
.stat-change.up   { color: var(--green-ok); }
.stat-change.down { color: var(--red); }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); text-align: left;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: .87rem; color: var(--text-mid);
  vertical-align: middle;
}
.data-table tr:last-child td { border: none; }
.data-table tr:hover td { background: var(--card-hover); }
.data-table .cell-name { color: var(--text); font-weight: 500; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: .72rem; font-weight: 600;
  letter-spacing: .04em;
}
.badge-green  { background: rgba(34,197,94,.15);  color: #4ade80; }
.badge-blue   { background: rgba(74,108,247,.15);  color: #818cf8; }
.badge-yellow { background: rgba(234,179,8,.15);   color: #fbbf24; }
.badge-red    { background: rgba(239,68,68,.15);   color: #f87171; }
.badge-gray   { background: rgba(255,255,255,.08); color: var(--text-mid); }

/* ── Grid layouts ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }

/* ── Editor canvas ── */
.editor-layout {
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  gap: 0; height: calc(100vh - 64px);
}
.editor-panel {
  background: var(--navy-mid); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 16px;
}
.editor-canvas {
  background: #1a1a2e; overflow: auto;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px;
}
.editor-canvas iframe {
  width: 100%; max-width: 1100px; height: 900px;
  border: none; border-radius: var(--radius-lg);
  box-shadow: 0 16px 64px rgba(0,0,0,.5);
}
.editor-props { border-left: 1px solid var(--border); overflow-y: auto; }

.panel-section { margin-bottom: 20px; }
.panel-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 10px; display: block;
}
.panel-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 12px; border-radius: var(--radius);
  background: var(--card-bg); border: 1px solid var(--border);
  color: var(--text-mid); font-size: .85rem; cursor: pointer;
  margin-bottom: 4px; transition: all var(--transition);
  text-align: left;
}
.panel-btn:hover { background: var(--card-hover); color: var(--text); }
.panel-btn.active { border-color: var(--blue); color: var(--blue-light); background: rgba(74,108,247,.1); }

.color-picker-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 6px;
  border: 2px solid rgba(255,255,255,.15); cursor: pointer; flex-shrink: 0;
}
.color-label { font-size: .82rem; color: var(--text-mid); flex: 1; }
.color-input {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); padding: 4px 8px;
  font-size: .78rem; width: 90px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
}
