/* =========================================================
   Kreator Konnect - Admin Panel Stylesheet
   Modern, Sleek, Category-wise Enterprise Dashboard
========================================================= */

:root {
  --bg-body: #faf8ff;
  --bg-sidebar: #12092a;
  --bg-sidebar-hover: #1e0e47;
  --bg-sidebar-active: #5a22e8;
  --text-main: #110d2e;
  --text-muted: #625e82;
  --border-color: #eae3fc;
  --primary: #5a22e8;
  --primary-light: #6c28f5;
  --accent: #5a22e8;
  --accent-light: #f3eeff;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --info: #0284c7;
  --info-bg: #e0f2fe;
  --purple: #7c3aed;
  --purple-bg: #f3e8ff;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(90, 34, 232, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(90, 34, 232, 0.08), 0 2px 4px -2px rgba(90, 34, 232, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(90, 34, 232, 0.1), 0 4px 6px -4px rgba(90, 34, 232, 0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  line-height: 1.5;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand a {
  text-decoration: none;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand .brandmark {
  background: #2563eb;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  padding: 10px 12px 4px;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
}

.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.db-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #a7f3d0;
}

.db-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Main Layout */
.admin-main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.admin-header {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-search {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 8px 14px;
  width: 380px;
  gap: 8px;
}

.header-search input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  outline: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #1d4ed8;
}

.btn-outline {
  background: #fff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* Content Area */
.admin-content {
  padding: 32px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Category Filter Pills */
.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  border-color: #94a3b8;
  color: var(--text-main);
}

.cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cat-pill .badge {
  background: rgba(0, 0, 0, 0.08);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 12px;
}

.cat-pill.active .badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Filter controls bar */
.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.status-tabs {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.status-tab {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-tab.active {
  background: #f1f5f9;
  color: var(--text-main);
  font-weight: 600;
}

/* Data Table */
.card-table-wrap {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  padding: 14px 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #fbfcfe;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-New { background: var(--info-bg); color: var(--info); }
.badge-Contacted { background: var(--warning-bg); color: var(--warning); }
.badge-Quotation-shared { background: var(--purple-bg); color: var(--purple); }
.badge-Approved { background: var(--success-bg); color: var(--success); }
.badge-In-Production { background: #e0e7ff; color: #4338ca; }
.badge-Completed { background: #f1f5f9; color: #334155; }
.badge-Closed { background: #f1f5f9; color: #64748b; }

.badge-category {
  display: inline-block;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Creators Grid */
.creators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  margin-top: 20px;
}

.creator-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.creator-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.creator-top {
  display: flex;
  gap: 14px;
  align-items: center;
}

.creator-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}

.creator-meta h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.creator-meta span {
  font-size: 13px;
  color: var(--text-muted);
}

.creator-stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
}

.creator-stats-bar b {
  display: block;
  font-size: 14px;
  color: var(--text-main);
}

.creator-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.creator-tag {
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.category-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-card h3 {
  font-size: 17px;
  font-weight: 700;
}

.category-card p {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.cat-stats-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  font-size: 13px;
}

/* Modals & Drawers */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1000;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background: #fff;
  border-radius: 14px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

/* Detail Drawer (Right side) */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.drawer-overlay.active {
  display: block;
}

.drawer-window {
  position: fixed;
  top: 0;
  right: -550px;
  bottom: 0;
  width: 520px;
  max-width: 90vw;
  background: #fff;
  z-index: 1001;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transition: right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-window.active {
  right: 0;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-section {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 18px;
}

.drawer-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Empty State */
.empty-box {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-box h3 {
  margin: 12px 0 6px;
  color: var(--text-main);
  font-size: 18px;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    width: 70px;
  }
  .sidebar-brand span.text,
  .nav-link span,
  .nav-label,
  .sidebar-footer {
    display: none;
  }
  .sidebar-brand {
    justify-content: center;
    padding: 20px 0;
  }
  .nav-link {
    justify-content: center;
    padding: 12px;
  }
  .admin-main {
    margin-left: 70px;
  }
  .header-search {
    width: 220px;
  }
}

/* =========================================================
   Admin Login Screen
========================================================= */
.login-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #172b4d 0%, #090e17 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(37, 99, 235, 0.15);
  color: #fff;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.login-brand .brandmark {
  background: #2563eb;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.login-brand h2 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.login-header {
  margin-bottom: 24px;
}

.login-header h3 {
  font-size: 19px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
}

.login-header p {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.4;
}

.login-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 12px;
  color: #64748b;
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 11px 40px 11px 38px;
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.15s ease;
}

.input-with-icon input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-card .form-group label {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.pwd-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
}

.pwd-toggle-btn:hover {
  opacity: 1;
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  border: none;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  justify-content: center;
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-btn:hover {
  background: #1d4ed8;
}

.demo-credentials-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 22px;
  font-size: 12px;
}

.credential-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  color: #94a3b8;
}

.credential-row code {
  background: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

