:root {
  /* Tailwind CSS color palatte overrides or definitions for global usage */
  --color-primary: #2563eb; /* blue-600 */
  --color-primary-hover: #1d4ed8; /* blue-700 */
  --color-secondary: #475569; /* slate-600 */
  --color-bg: #f8fafc; /* slate-50 */
  --color-surface: #ffffff;
  --color-success: #16a34a; /* green-600 */
  --color-warning: #ea580c; /* orange-600 */
  --color-danger: #dc2626; /* red-600 */
  --color-text-main: #0f172a; /* slate-900 */
  --color-text-muted: #64748b; /* slate-500 */
  --sidebar-width: 250px;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-surface);
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  transition: transform 0.3s ease-in-out;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-primary);
}

.sidebar-nav {
  padding: 1.5rem 0;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  color: var(--color-secondary);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  font-weight: 500;
  gap: 0.75rem;
}

.nav-item:hover {
  background-color: #f1f5f9;
  color: var(--color-primary);
}

.nav-item.active {
  background-color: #eff6ff;
  color: var(--color-primary);
  border-left-color: var(--color-primary);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Topbar Styling */
.topbar {
  height: 4rem;
  background-color: var(--color-surface);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
}

/* Page Content */
.page-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--color-surface);
  border-radius: 0.75rem;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 500px;
  transform: scale(0.95);
  transition: transform 0.3s;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Table Enhancements */
.table-container {
  overflow-x: auto;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background-color: var(--color-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background-color: #f8fafc;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  color: var(--color-text-main);
  font-size: 0.875rem;
}

tbody tr {
  transition: background-color 0.2s;
}

tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.badge-blue {
  background-color: #dbeafe;
  color: #1e40af;
}
.badge-green {
  background-color: #dcfce7;
  color: #166534;
}
.badge-red {
  background-color: #fee2e2;
  color: #991b1b;
}
.badge-orange {
  background-color: #ffedd5;
  color: #9a3412;
}
.badge-slate {
  background-color: #f1f5f9;
  color: #475569;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    height: 100%;
    transform: translateX(-100%);
  }

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