@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-color: #f4f6f8;
  --glass-bg: #ffffff;
  --glass-border: #dce1e6;
  --primary-color: #0059b2;
  --primary-hover: #004080;
  --text-primary: #333333;
  --text-secondary: #5c6c7c;
  --accent-color: #007bff;
  --danger-color: #d9534f;
  --success-color: #5cb85c;
  --sidebar-bg: #ffffff;
  --sidebar-text: #444444;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: #35445a;
  /* Dark grayish blue */
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  color: white;
  transition: width 0.3s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: 68px;
}

.sidebar.collapsed .sidebar-title span,
.sidebar.collapsed .nav-category,
.sidebar.collapsed .nav-link span {
  display: none;
}

.sidebar.collapsed .sidebar-title {
  padding: 0 1.5rem 1.5rem 1.6rem;
  justify-content: center;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 1.5rem 1.5rem 1.5rem;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1rem;
}

.nav-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #8f9db1;
  /* Muted gray */
  padding: 1rem 1.5rem 0.5rem 1.5rem;
  font-weight: 600;
}

.nav-link {
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  color: #e2e8f0;
  font-weight: 400;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
  border-left: 3px solid transparent;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: #283345;
  /* Darker blue */
  color: white;
  border-left: 3px solid #60a5fa;
  /* bright blue indicator */
}

.main-content {
  flex: 1;
  padding: 2.5rem 3rem;
  overflow-y: auto;
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #ffffff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 89, 178, 0.1);
}

select[multiple] {
  padding: 0.5rem;
}

.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

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

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

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.stats-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.stats-card h3 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

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

th,
td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

th {
  background: #f8f9fa;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  border-bottom: 2px solid #dee2e6;
}

tbody tr:hover {
  background: rgba(0, 89, 178, 0.03);
}

.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: none;
  font-weight: 500;
}

.alert.show {
  display: block;
}

.alert-success {
  background: rgba(92, 184, 92, 0.1);
  border: 1px solid var(--success-color);
  color: #3c763d;
}

.alert-error {
  background: rgba(217, 83, 79, 0.1);
  border: 1px solid var(--danger-color);
  color: #a94442;
}

.loader {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-container {
  width: 100%;
  background-color: var(--glass-border);
  border-radius: 8px;
  margin-top: 1.5rem;
  height: 8px;
  overflow: hidden;
  display: none;
}

.progress-bar {
  height: 100%;
  background-color: var(--success-color);
  width: 0%;
  transition: width 0.3s ease;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.chart-card {
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.chart-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
}
.chart-card canvas {
    max-height: 280px;
    width: 100% !important;
}

.filters-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}
.filters-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}