/* ==========================================================================
   Wisdom Mining Private Limited - Admin Panel Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --adm-primary: #059669;
  --adm-primary-dark: #047857;
  --adm-sidebar: #0f172a;
  --adm-sidebar-hover: #1e293b;
  --adm-bg: #f8fafc;
  --adm-card: #ffffff;
  --adm-border: #e2e8f0;
  --adm-text: #0f172a;
  --adm-muted: #64748b;
  --adm-danger: #ef4444;
  --adm-warning: #f59e0b;
  --adm-success: #10b981;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--adm-bg);
  color: var(--adm-text);
  line-height: 1.5;
}

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

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--adm-sidebar);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--adm-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}
.sidebar-brand-name {
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}
.sidebar-menu {
  list-style: none;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--adm-sidebar-hover);
  color: white;
}
.sidebar-link.active {
  background: var(--adm-primary);
  color: white;
}
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
}

/* Main Area */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--adm-border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-content {
  padding: 2rem;
  flex-grow: 1;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.kpi-card {
  background: white;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--adm-muted);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--adm-text);
}

/* Cards & Tables */
.card {
  background: white;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 1.5rem;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--adm-border);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table th {
  background: #f8fafc;
  color: var(--adm-muted);
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1.5px solid var(--adm-border);
}
.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--adm-border);
  vertical-align: middle;
}
.admin-table tr:hover {
  background: #f1f5f9;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #eff6ff; color: #1e40af; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--adm-primary);
}
input:checked + .slider:before {
  transform: translateX(24px);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--adm-text);
  margin-bottom: 0.35rem;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.2);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal.open {
  display: flex;
}
.modal-dialog {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
  }
  .admin-content {
    padding: 1rem;
  }
}
