/* Admin v2 - Main Stylesheet
   Modern, clean, and responsive admin interface
   NewTech Institute, 2024
*/

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #64748b;
  --success: #10b981;
  --info: #06b6d4;
  --warning: #f59e0b;
  --danger: #ef4444;
  --light: #f8fafc;
  --dark: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --border-radius: 0.375rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --transition: all 0.2s ease;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-700);
  background-color: var(--gray-100);
  min-height: 100vh;
  transition: opacity 0.15s ease-in-out;
}

body.page-transition {
  opacity: 0 !important;
}

/* ========== LAYOUT ========== */
.admin-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  will-change: opacity;
  backface-visibility: hidden;
  width: 100%;
  overflow-x: hidden;
}

.admin-layout.loaded {
  opacity: 1;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 260px;
  background-color: var(--primary);
  color: white;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  transition: var(--transition);
  z-index: 100;
}

.sidebar-collapsed .sidebar {
  width: 70px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.sidebar-brand img {
  width: 35px;
  height: 35px;
  margin-right: 10px;
}

.sidebar-brand h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-collapsed .sidebar-brand h1 {
  display: none;
}

.nav-menu {
  list-style: none;
  padding: 0 1rem;
  margin: 0;
}

.nav-menu li {
  margin-bottom: 0.25rem;
}

.nav-menu a {
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  color: white;
  font-weight: 500;
}

.nav-menu a:hover, 
.nav-menu a:focus {
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.nav-menu a.active {
  background-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  left: 0;
  width: 0;
  height: 100%;
  background-color: transparent;
  transition: width 0.2s ease;
}

.nav-menu a.active::after {
  width: 4px;
  background-color: #ffffff;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.nav-menu i, .nav-menu svg {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
  font-size: 1.125rem;
}

.sidebar-collapsed .nav-menu span {
  display: none;
}

.sidebar-collapsed .nav-menu i, .sidebar-collapsed .nav-menu svg {
  margin-right: 0;
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  padding: 1rem;
  background-color: var(--primary-dark);
  margin-top: 2rem;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  grid-column: 2;
  padding: 1rem;
  margin-left: 260px;
  transition: var(--transition);
  width: calc(100vw - 260px);
  max-width: 100%;
  overflow-x: hidden;
}

.sidebar-collapsed .main-content {
  margin-left: 70px;
  width: calc(100vw - 70px);
}

/* ========== HEADER ========== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: white;
  box-shadow: var(--shadow-sm);
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 10px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-title h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.toggle-sidebar {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.25rem;
  transition: var(--transition);
}

.toggle-sidebar:hover {
  color: var(--primary);
}

/* ========== CARDS ========== */
.card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stats-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stats-card-icon {
  width: 48px;
  height: 48px;
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stats-card-info {
  flex-grow: 1;
  min-width: 0;
}

.stats-card-info h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  margin: 0 0 0.5rem 0;
}

.stats-card-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-card-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.stats-trend {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-500);
}

/* Quick Actions */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 10px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 15px;
  background-color: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--gray-700);
  text-align: center;
}

.quick-action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-light);
  background-color: #f0f7ff;
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.quick-action-btn:hover .quick-action-icon {
  background-color: var(--primary);
  color: white;
}

.quick-action-btn span {
  font-weight: 500;
  font-size: 14px;
}

/* ========== TABLES ========== */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  background-color: var(--gray-100);
  border-bottom: 2px solid var(--gray-200);
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
}

tbody tr:hover {
  background-color: var(--gray-50);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.status-active {
  background-color: rgba(16, 185, 129, 0.1);
  color: rgb(16, 185, 129);
}

.status-pending {
  background-color: rgba(245, 158, 11, 0.1);
  color: rgb(245, 158, 11);
}

.status-inactive {
  background-color: rgba(239, 68, 68, 0.1);
  color: rgb(239, 68, 68);
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 1rem;
  color: var(--gray-700);
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--gray-600);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #0ca16b;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  background-color: var(--gray-100);
}

.btn i, .btn svg {
  margin-right: 0.5rem;
}

/* ========== MODALS ========== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 5vh;
  z-index: 1000;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transition: var(--transition);
}

.modal-backdrop.show {
  visibility: visible;
  opacity: 1;
}

.modal-container {
  background-color: white;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: var(--transition);
}

.modal-backdrop.show .modal-container {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--gray-200);
}

/* ========== ALERTS ========== */
.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success);
  color: rgb(6, 95, 70);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--warning);
  color: rgb(146, 64, 14);
}

.alert-danger, 
.offline-warning,
.error-message {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--danger);
  color: rgb(153, 27, 27);
  opacity: 0;
  animation: fadeInMessage 0.4s ease forwards;
  animation-delay: 0.5s; /* Delay showing errors */
}

.alert-info {
  background-color: rgba(6, 182, 212, 0.1);
  border-left: 4px solid var(--info);
  color: rgb(14, 116, 144);
}

/* ========== LOGIN PAGE ========== */
.login-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--gray-100);
  padding: 1rem;
}

.login-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.login-header {
  background-color: var(--primary);
  color: white;
  padding: 2rem;
  text-align: center;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.login-logo img {
  height: 50px;
  width: auto;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.login-body {
  padding: 2rem;
}

.login-credentials {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.login-credentials p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
}

.login-credentials strong {
  color: var(--primary);
}

.login-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
}

/* ========== RESPONSIVE DESIGN ========== */
/* Large screens */
@media (min-width: 1200px) {
  .main-content {
    padding: 1.5rem;
  }
}

/* Medium screens */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    transform: translateX(-100%);
    width: 260px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: transform 0.3s ease;
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 0.75rem;
  }
  
  .sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    transition: opacity 0.3s ease;
    opacity: 0;
  }
  
  .sidebar.active + .sidebar-backdrop {
    display: block;
    opacity: 1;
  }
  
  .header {
    padding: 0.75rem;
  }
  
  .mobile-menu-btn {
    display: block;
    margin-right: 0.75rem;
  }
  
  .header-title h1 {
    font-size: 1.25rem;
  }
  
  .header-profile span {
    display: none;
  }
  
  /* Adjust card grids for better mobile display */
  .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
  }
  
  .quick-actions-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .quick-action-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* Small screens */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .header-search {
    width: 100%;
    max-width: 100%;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .card-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    width: calc(100% + 1.5rem);
  }
  
  table {
    min-width: 650px;
  }
  
  .d-none-sm {
    display: none !important;
  }
  
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  /* Improve form layouts on mobile */
  .form-row {
    flex-direction: column;
  }
  
  .form-group {
    width: 100% !important;
    margin-right: 0;
  }
  
  /* Modal improvements for small screens */
  .modal-content {
    width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Extra small screens */
@media (max-width: 576px) {
  .main-content {
    padding: 0.5rem;
  }
  
  .header {
    padding: 0.75rem 0.5rem;
  }
  
  .card {
    padding: 0.75rem;
  }
  
  .card-header h2 {
    font-size: 1rem;
  }
  
  .monthly-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .activity-list .activity-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0;
  }
  
  .activity-icon {
    margin-bottom: 0.5rem;
  }
  
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .quick-action-btn {
    padding: 10px;
  }
  
  .quick-action-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .quick-action-btn span {
    font-size: 12px;
  }
  
  /* Adjusted button sizing for mobile */
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
  
  .btn-sm {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }
  
  /* Fix spacing issues in mobile tables */
  .table-actions .btn-sm {
    padding: 0.25rem 0.375rem;
  }
  
  /* Fix chart display on mobile */
  .chart-container {
    height: 200px;
  }
}

/* Define visibility classes for responsive design */
.d-lg-none {
  display: none;
}

.d-none {
  display: none;
}

@media (max-width: 992px) {
  .d-lg-none {
    display: block;
  }
  
  .d-none-lg {
    display: none !important;
  }
  
  .d-lg-block {
    display: block;
  }
}

@media (max-width: 576px) {
  .d-sm-none {
    display: none !important;
  }
}

/* Toggle Switch */
.toggle-switch {
  display: inline-flex;
  align-items: center;
}

.toggle-switch input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.toggle-switch label {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  background-color: var(--gray-300);
  border-radius: 12px;
  margin: 0 10px 0 0;
  cursor: pointer;
  transition: background-color 0.3s;
}

.toggle-switch label::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: white;
  transition: transform 0.3s;
}

.toggle-switch input:checked + label {
  background-color: var(--primary);
}

.toggle-switch input:checked + label::after {
  transform: translateX(26px);
}

/* Checkbox styles */
.checkbox-item {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
}

.checkbox-item input[type="checkbox"] {
  margin-right: 5px;
}

/* Modal Styles */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.show {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-500);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form styles enhancements */
.form-select {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray-700);
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray-700);
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

textarea.form-control {
  min-height: 60px;
  resize: vertical;
}

.form-control:focus, 
.form-select:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--gray-100);
  opacity: 1;
}

/* Recent payments table */
.recent-payments-table {
  width: 100%;
  border-collapse: collapse;
}

.recent-payments-table th,
.recent-payments-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.recent-payments-table th {
  font-weight: 600;
  color: var(--gray-600);
  background-color: var(--gray-50);
}

.recent-payments-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.badge {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Payment method icons */
.payment-method-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 0.5rem;
  background-color: var(--gray-100);
}

/* Dashboard enhancements */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-card {
  background-color: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
}

.stats-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
  font-size: 1.5rem;
}

.stats-content {
  flex-grow: 1;
}

.stats-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stats-label {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.stats-trend {
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.stats-trend.up {
  color: var(--success);
}

.stats-trend.down {
  color: var(--danger);
}

/* Offline Warning Banner */
.offline-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-left: 4px solid #f59e0b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    border-radius: 4px;
    animation: fadeIn 0.5s ease-in-out;
}

.offline-warning .message {
    display: flex;
    align-items: center;
}

.offline-warning i {
    margin-right: 10px;
    font-size: 1.1em;
}

.offline-warning .dismiss {
    background: none;
    border: none;
    color: #856404;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
}

.offline-warning .dismiss:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Add or update preloader styles to ensure smooth transitions */
#dashboard-preloader,
#preloader,
#page-loader,
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2563eb;
    z-index: 9999 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    will-change: opacity;
    backface-visibility: hidden;
}

.preloader-spinner,
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    transform: translateZ(0);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Page loader styles */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary, #2563eb);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
    will-change: opacity;
    backface-visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    transform: translateZ(0);
}

/* Login preloader styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2563eb;
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    will-change: opacity;
    backface-visibility: hidden;
    opacity: 1;
}

/* Transitions and loading states */
.page-transition {
    opacity: 0 !important;
    transition: none !important;
}

/* Initial content hiding to prevent flicker */
.admin-layout {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    will-change: opacity;
    min-height: 100vh;
}

.admin-layout.loaded {
    opacity: 1;
}

/* Only show errors when transition is complete */
body[data-transition="active"] .alert-danger,
body[data-transition="active"] .offline-warning,
body[data-transition="active"] .error-message {
    display: none !important;
}

@keyframes fadeInMessage {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile menu button - always visible on mobile */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--gray-700);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Mobile Navigation Menu */
.mobile-nav-container {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: white;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 99;
  padding: 8px 0;
}

.mobile-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--gray-600);
  font-size: 0.75rem;
  padding: 8px 5px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.mobile-nav-item.active {
  color: var(--primary);
  background-color: rgba(37, 99, 235, 0.1);
}

.mobile-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 5px;
}

@media (max-width: 992px) {
  .mobile-nav-container {
    display: block;
  }
  
  /* Add padding to main content to prevent overlap with mobile nav */
  .main-content {
    padding-bottom: 70px;
  }
}

/* Mobile fixes for payments page */
@media (max-width: 767px) {
  /* Fix content overflow */
  body, html {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  /* Fix summary cards */
  .payment-summary {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 15px;
  }
  
  .summary-card {
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Fix tables on mobile */
  .table-responsive {
    margin: 0 -10px;
    width: calc(100% + 20px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 10px;
  }
  
  /* Add horizontal scroll indicator */
  .table-responsive:before {
    content: "← Swipe →";
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-500);
    padding: 5px 0;
  }
} 