/**
 * Supansha Admin Panel — Modern Custom Design System
 * Theme: Dark Mode with Supansha Orange (#f05a28) Accents
 */

:root {
  --bg-main: #0c0e12;
  --bg-surface: #14171d;
  --bg-card: #1a1e26;
  --bg-card-hover: #212630;
  --bg-input: #12151b;
  --border-color: #262c38;
  --border-focus: #f05a28;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #f05a28;
  --accent-hover: #d94819;
  --accent-light: rgba(240, 90, 40, 0.12);
  --accent-glow: rgba(240, 90, 40, 0.25);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);

  --sidebar-width: 270px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--accent-hover);
}

/* ════════════════════════════════════════════════
   SIDEBAR STYLES
════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}
.sidebar-brand-text strong {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.1;
}
.sidebar-brand-text small {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-nav {
  padding: 1.25rem 1rem;
  flex: 1;
}

.nav-list {
  list-style: none;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 1rem 0.75rem 0.4rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}

.nav-link i {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
}

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

.has-submenu .submenu-arrow {
  font-size: 0.75rem;
  transition: transform 0.25s ease;
}
.has-submenu.open .submenu-arrow {
  transform: rotate(90deg);
}

.submenu-list {
  list-style: none;
  padding-left: 1.8rem;
  margin-top: 2px;
  display: none;
}
.has-submenu.open .submenu-list {
  display: block;
}
.submenu-list .nav-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

/* ════════════════════════════════════════════════
   MAIN WRAPPER & TOP NAVBAR
════════════════════════════════════════════════ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

.top-navbar {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.navbar-left, .navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sidebar-toggle:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.breadcrumb-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-search input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.45rem 1rem 0.45rem 2.2rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 220px;
  transition: var(--transition);
}
.nav-search input:focus {
  outline: none;
  border-color: var(--accent);
  width: 280px;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.nav-search i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.nav-icon-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.nav-icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}
.user-info-text {
  text-align: left;
  display: flex;
  flex-direction: column;
}
.user-info-text strong {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.2;
}
.user-info-text small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════
   CONTENT & CARDS
════════════════════════════════════════════════ */
.content-wrapper {
  padding: 2rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header-title h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.page-header-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h5 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header h5 i {
  color: var(--accent);
}

.card-body {
  padding: 1.5rem;
}

/* ════════════════════════════════════════════════
   METRICS & STATS
════════════════════════════════════════════════ */
.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition);
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 25px rgba(240, 90, 40, 0.15);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.stat-icon.orange { background: var(--accent-light); color: var(--accent); }
.stat-icon.green  { background: var(--success-bg); color: var(--success); }
.stat-icon.blue   { background: var(--info-bg); color: var(--info); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red    { background: var(--danger-bg); color: var(--danger); }

.stat-info h3 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  line-height: 1;
}
.stat-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
  font-weight: 500;
}

/* ════════════════════════════════════════════════
   FORMS & INPUTS
════════════════════════════════════════════════ */
.form-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}

.form-control, .form-select {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  background-color: var(--bg-input);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════
   BUTTONS & BADGES
════════════════════════════════════════════════ */
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem;
  transition: var(--transition);
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-secondary {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem;
  transition: var(--transition);
}
.btn-secondary:hover {
  background-color: var(--border-color);
  color: #fff;
}

.badge {
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
}
.badge-active, .badge-published, .badge-completed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-inactive, .badge-draft, .badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-new {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ════════════════════════════════════════════════
   TABLES
════════════════════════════════════════════════ */
.table {
  color: var(--text-secondary);
  margin-bottom: 0;
  vertical-align: middle;
}
.table thead th {
  background-color: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
}
.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}
.table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

.table-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.action-btns {
  display: flex;
  gap: 6px;
}

.btn-action {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: var(--transition);
}
.btn-action:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}
.btn-action.btn-delete:hover {
  border-color: var(--danger);
  background: var(--danger);
}

/* ════════════════════════════════════════════════
   MEDIA PREVIEWS
════════════════════════════════════════════════ */
.img-preview-box {
  width: 100%;
  max-width: 240px;
  height: 140px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-input);
  margin-top: 0.5rem;
}
.img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
}
