/* =====================================
   PROFESSIONAL ADMIN DASHBOARD STYLING
   ===================================== */

:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --accent: #f39c12;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  --light: #f5f7fa;
  --lighter: #ecf0f1;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  --border: #d5dce0;
  --white: #ffffff;
}

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

html, body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  background: var(--light);
  line-height: 1.6;
}

/* ===== ADMIN WRAPPER ===== */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--light);
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
  width: 270px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  min-height: 100vh;
  color: white;
  padding: 25px 0;
  position: fixed;
  left: 0;
  top: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-toggle {
  display: none;
}

.sidebar .logo {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.sidebar .logo i {
  margin-right: 8px;
  color: #ffd700;
}

.sidebar ul {
  list-style: none;
  padding: 15px 0;
}

.sidebar ul li {
  margin: 0;
  padding: 0;
}

.sidebar ul li a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  font-weight: 500;
  font-size: 14px;
}

.sidebar ul li a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border-left-color: #ffd700;
  padding-left: 22px;
}

.sidebar ul li a.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  border-left-color: #ffd700;
  font-weight: 700;
}

.sidebar ul li a i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar .logout {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
}

.sidebar .logout a {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-left: none;
  color: rgba(255, 255, 255, 0.8);
}

.sidebar .logout a:hover {
  background: rgba(255, 0, 0, 0.15);
  border-left-color: #e74c3c;
  color: #fff;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 270px;
  flex: 1;
  padding: 30px;
  background: var(--light);
}

/* ===== PAGE TITLE ===== */
.page-title {
  margin-bottom: 30px;
  color: var(--text-dark);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-title:before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 35px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 2px;
  margin-right: 12px;
  vertical-align: middle;
}

/* ===== TABLES ===== */
.table {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
}

.table thead {
  background: linear-gradient(135deg, var(--light) 0%, #f0f2f5 100%);
  border-bottom: 2px solid var(--border);
}

.table th {
  font-weight: 700;
  color: var(--primary);
  padding: 16px 15px;
  border: none;
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  padding: 14px 15px;
  vertical-align: middle;
  border-bottom: 1px solid var(--lighter);
  color: var(--text-dark);
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background: rgba(102, 126, 234, 0.04);
  box-shadow: inset 0 0 10px rgba(102, 126, 234, 0.05);
}

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

/* ===== BUTTONS ===== */
.btn {
  border-radius: 6px;
  font-weight: 600;
  padding: 10px 18px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #4a5bc7 100%);
}

.btn-dark {
  background: var(--text-dark);
  color: white;
}

.btn-dark:hover {
  background: #1a252f;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #c0392b 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #229954 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

.btn-secondary {
  background: var(--lighter);
  color: var(--text-dark);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  border-color: var(--text-light);
}

.btn-info {
  background: linear-gradient(135deg, var(--info) 0%, #2980b9 100%);
  color: white;
}

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

.btn-sm i {
  margin-right: 4px;
}

/* ===== FORMS ===== */
.form-control {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: white;
  color: var(--text-dark);
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

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

.form-label {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group {
  margin-bottom: 20px;
}

/* ===== CARDS ===== */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  background: white;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.card-header {
  background: linear-gradient(135deg, var(--light) 0%, #f0f2f5 100%);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-dark);
  padding: 18px 20px;
}

.card-body {
  padding: 20px;
}

/* ===== STAT CARDS ===== */
.stat-card {
  background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.stat-card h4 {
  color: var(--text-light);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.stat-card p {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
}

.stat-card i {
  font-size: 40px;
  opacity: 0.1;
  float: right;
  margin-top: -10px;
}

.stat-card.primary {
  border-left: 4px solid var(--primary);
}

.stat-card.success {
  border-left: 4px solid var(--success);
}

.stat-card.danger {
  border-left: 4px solid var(--danger);
}

.stat-card.warning {
  border-left: 4px solid var(--warning);
}

/* ===== BADGES ===== */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.bg-success {
  background: #d4edda;
  color: #155724;
}

.badge.bg-danger {
  background: #f8d7da;
  color: #721c24;
}

.badge.bg-warning {
  background: #fff3cd;
  color: #856404;
}

.badge.bg-info {
  background: #d1ecf1;
  color: #0c5460;
}

/* ===== UTILITIES ===== */
.text-muted {
  color: var(--text-light) !important;
}

.text-center {
  text-align: center;
}

.mt-3 {
  margin-top: 20px;
}

.mb-3 {
  margin-bottom: 20px;
}

.mb-4 {
  margin-bottom: 30px;
}

.p-4 {
  padding: 20px;
}

.rounded {
  border-radius: 6px;
}

.bg-white {
  background: white;
}

.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.gap-2 {
  gap: 10px;
}

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border-color: #27ae60;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border-color: #e74c3c;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border-color: #f39c12;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border-color: #3498db;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state i {
  font-size: 64px;
  opacity: 0.3;
  margin-bottom: 20px;
  display: block;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 30px;
}

/* ===== RESPONSIVE ===== */

/* TABLET (1024px and below) */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }

  .main-content {
    margin-left: 240px;
    padding: 20px;
  }

  .page-title {
    font-size: 26px;
  }

  .table th, .table td {
    padding: 12px 10px;
    font-size: 12px;
  }

  .stat-card {
    padding: 20px;
  }

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

/* TABLET - MEDIUM (768px and below) */
@media (max-width: 768px) {
  .admin-wrapper {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  }

  .sidebar ul li {
    padding: 0;
  }

  .sidebar ul li a {
    padding: 12px 15px;
  }

  .sidebar-toggle {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 10px 12px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    z-index: 1001;
  }

  .sidebar-toggle:hover {
    transform: scale(1.05);
  }

  .main-content {
    margin-left: 0;
    padding: 50px 15px 15px 15px;
  }

  .page-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-top: 10px;
  }

  .page-title:before {
    display: none;
  }

  .table {
    font-size: 12px;
    overflow-x: auto;
    display: block;
  }

  .table thead {
    display: none;
  }

  .table tbody {
    display: block;
  }

  .table tbody tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
  }

  .table td {
    display: block;
    padding: 10px;
    border: none;
    text-align: right;
    padding-left: 50%;
    position: relative;
  }

  .table td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    font-weight: 600;
    color: #667eea;
  }

  .btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .btn-sm {
    padding: 5px 10px;
    font-size: 10px;
  }

  .row {
    flex-direction: column;
  }

  .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
    width: 100% !important;
    margin-bottom: 10px;
  }

  .stat-card {
    margin-bottom: 15px;
    padding: 18px;
  }

  .stat-card h6 {
    font-size: 12px;
  }

  .stat-card h3 {
    font-size: 24px;
  }

  .card {
    margin-bottom: 15px;
  }

  .quick-card {
    padding: 18px;
  }

  .page-header {
    flex-direction: column;
    gap: 10px;
  }

  .page-header .btn {
    width: 100%;
  }

  .form-container {
    max-width: 100%;
  }

  .form-card {
    padding: 20px;
  }

  .form-label {
    font-size: 13px;
  }

  .form-control {
    font-size: 14px;
  }
}

/* MOBILE (480px and below) */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .admin-wrapper {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 999;
  }

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

  .sidebar .logo {
    padding: 15px;
    font-size: 18px;
  }

  .sidebar ul li a {
    padding: 12px 15px;
    font-size: 13px;
  }

  .sidebar ul li a i {
    width: 18px;
  }

  .sidebar-toggle {
    display: block;
    position: fixed;
    top: 8px;
    left: 8px;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    border-radius: 6px;
  }

  .main-content {
    margin-left: 0;
    padding: 60px 10px 10px 10px;
  }

  .page-title {
    font-size: 16px;
    margin-bottom: 15px;
    padding-top: 5px;
  }

  h2.page-title {
    font-size: 16px;
  }

  .table {
    font-size: 11px;
    overflow-x: auto;
    display: block;
  }

  .table thead {
    display: none;
  }

  .table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0;
  }

  .table td {
    display: block;
    padding: 8px 5px;
    border: none;
    text-align: left;
    padding-left: 45%;
    position: relative;
    font-size: 11px;
  }

  .table td:first-child {
    display: none;
  }

  .table td::before {
    content: attr(data-label);
    position: absolute;
    left: 5px;
    font-weight: 600;
    color: #667eea;
    font-size: 10px;
  }

  .btn {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px;
    font-size: 12px;
  }

  .btn-sm {
    width: auto;
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 6px 10px;
  }

  .card {
    margin-bottom: 12px;
    padding: 12px;
  }

  .stat-card {
    margin-bottom: 10px;
    padding: 15px;
  }

  .stat-card h6 {
    font-size: 11px;
    margin-bottom: 5px;
  }

  .stat-card h3 {
    font-size: 20px;
  }

  .quick-card {
    padding: 15px;
  }

  .quick-card h5 {
    font-size: 14px;
  }

  .badge {
    padding: 4px 8px;
    font-size: 10px;
  }

  .form-container {
    max-width: 100%;
    margin: 0;
  }

  .form-card {
    padding: 15px;
    margin: 0;
  }

  .form-header {
    flex-direction: column;
    gap: 10px;
  }

  .form-header .btn-cancel {
    width: 100%;
  }

  .page-title {
    margin: 0 0 15px 0;
  }

  .form-label {
    font-size: 12px;
  }

  .form-control {
    padding: 10px 8px;
    font-size: 14px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  .btn-group {
    flex-direction: column;
    gap: 8px;
  }

  .btn-submit, .btn-cancel {
    width: 100%;
  }

  .d-flex {
    flex-direction: column;
  }

  .d-flex > * {
    margin-bottom: 10px;
  }

  .text-center {
    text-align: center;
  }

  /* Fix table-responsive behavior */
  .table-wrapper {
    overflow-x: auto;
  }

  /* Improve icon display on mobile */
  .icon-circle {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
  }

  /* Responsive grid */
  .row {
    flex-direction: column;
    gap: 10px;
  }

  .col-12 {
    width: 100%;
  }
}

.sidebar ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar ul li a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: white;
}

.sidebar ul li a.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
}

.sidebar ul li a i {
    width: 20px;
}

.sidebar .logout {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: 0;
}

.sidebar .logout a {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
}

/* MAIN CONTENT */
.main-content {
    margin-left: 260px;
    flex: 1;
