/* ============================================================
   KivoTime Admin Panel — Premium Dark CSS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-deep: #07070e;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-sidebar: #0d0d1a;
  --accent: #6c63ff;
  --accent2: #00d4ff;
  --danger: #ff4d6d;
  --warning: #ffb830;
  --success: #00e676;
  --info: #29b6f6;
  --text-primary: #f0f0ff;
  --text-muted: #8888aa;
  --border: rgba(255, 255, 255, 0.07);
  --sidebar-w: 260px;
  --topbar-h: 65px;
  --radius: 14px;
  --glass: blur(16px);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background Orbs ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 10% 20%, rgba(108, 99, 255, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 500px 350px at 90% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
  }

  50% {
    box-shadow: 0 4px 30px rgba(108, 99, 255, 0.7);
  }
}

.brand-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transition: transform var(--transition);
}

.nav-item:hover,
.nav-item.active {
  color: var(--text-primary);
  background: rgba(108, 99, 255, 0.12);
}

.nav-item.active::before,
.nav-item:hover::before {
  transform: scaleY(1);
}

.nav-item.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-item-danger:hover {
  background: rgba(255, 77, 109, 0.12) !important;
  color: var(--danger) !important;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.admin-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}

.admin-info {
  display: flex;
  flex-direction: column;
}

.admin-name {
  font-size: 13px;
  font-weight: 600;
}

.admin-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Main Wrapper ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
  z-index: 1;
  transition: margin-left var(--transition);
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: rgba(13, 13, 26, 0.85);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
  display: none;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.topbar-time {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.topbar-admin {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
}

.topbar-admin i {
  color: var(--accent);
}

/* ── Content Area ── */
.content-area {
  padding: 28px 28px;
}

/* ── Cards ── */
.card-glass {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-glass:nth-child(1) {
  animation-delay: 0.05s;
}

.card-glass:nth-child(2) {
  animation-delay: 0.10s;
}

.card-glass:nth-child(3) {
  animation-delay: 0.15s;
}

.card-glass:nth-child(4) {
  animation-delay: 0.20s;
}

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

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s ease both;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c, var(--accent)) 0%, transparent 70%);
  opacity: 0.15;
}

.stat-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-body {
  flex: 1;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ── Buttons ── */
.btn-primary-glow {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 9px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
  text-decoration: none;
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 99, 255, 0.5);
  color: #fff;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  text-decoration: none;
}

.btn-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
}

.btn-icon.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(255, 77, 109, 0.1);
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
}

.section-title span {
  color: var(--accent);
}

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

.badge-packing {
  background: rgba(255, 184, 48, 0.15);
  color: var(--warning);
  border: 1px solid rgba(255, 184, 48, 0.3);
}

.badge-in-transit {
  background: rgba(41, 182, 246, 0.15);
  color: var(--info);
  border: 1px solid rgba(41, 182, 246, 0.3);
}

.badge-delivered {
  background: rgba(0, 230, 118, 0.15);
  color: var(--success);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.badge-returned {
  background: rgba(255, 77, 109, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 109, 0.3);
}

/* ── DataTable overrides ── */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: #e9ecef !important;
  color: #845ef8 !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-family: 'Outfit', sans-serif !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text-muted) !important;
  font-family: 'Outfit', sans-serif !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  border-radius: 6px !important;
}

table.dataTable thead th {
  background: rgba(108, 99, 255, 0.1) !important;
  color: var(--text-muted) !important;
  font-size: 11px !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
}

table.dataTable tbody td {
  background: transparent !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 14px !important;
  vertical-align: middle !important;
}

table.dataTable tbody tr:hover td {
  background: rgba(108, 99, 255, 0.05) !important;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.form-control-dark {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  padding: 11px 16px;
  transition: all var(--transition);
  outline: none;
}

.form-control-dark:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
  background: rgba(108, 99, 255, 0.06);
}

.form-control-dark option {
  background: #1a1a2e;
}

select.form-control-dark {
  appearance: none;
  cursor: pointer;
}

/* ── Modal ── */
.modal-dark .modal-content {
  background: #12122a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal-dark .modal-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.modal-dark .modal-title {
  font-size: 17px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}

.modal-dark .modal-body {
  padding: 24px;
}

.modal-dark .modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}

.modal-dark .btn-close {
  filter: invert(1) opacity(0.5);
}

.modal-backdrop.show {
  opacity: 0.7;
}

/* ── Overlay (mobile sidebar) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* ── Alert / Toast ── */
.alert-glass {
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
  animation: fadeUp 0.3s ease;
}

.alert-glass.success {
  background: rgba(0, 230, 118, 0.1);
  color: var(--success);
  border-color: rgba(0, 230, 118, 0.3);
}

.alert-glass.danger {
  background: rgba(255, 77, 109, 0.1);
  color: var(--danger);
  border-color: rgba(255, 77, 109, 0.3);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(108, 99, 255, 0.4);
  border-radius: 3px;
}

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.6s ease;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .brand-icon {
  margin: 0 auto 14px;
  width: 56px;
  height: 56px;
  font-size: 24px;
}

.login-brand h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-brand h1 span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand p {
  color: var(--text-muted);
  font-size: 14px;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.input-icon-wrap .form-control-dark {
  padding-left: 42px;
}

.pw-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  z-index: 2;
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.35);
  margin-top: 8px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(108, 99, 255, 0.5);
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

.shake {
  animation: shake 0.4s ease;
}

/* ── Page Header Breadcrumb ── */
.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 800;
}

.page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex !important;
  }

  .topbar-time {
    display: none;
  }
}

@media (max-width: 640px) {
  .content-area {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-card {
    padding: 28px 22px;
  }
}

@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

tbody,
td,
tfoot,
th,
thead,
tr {
  border-color: inherit;
  border-style: solid;
  border-width: 0;
  padding: 10px 5px !important;
}