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

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

body {
  font-family: 'Inter', sans-serif;
  background: #f4f6f9;
  color: #495057;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background: #343a40;
  color: #c2c7d0;
  z-index: 1000;
  overflow-y: auto;
  transition: width 0.3s;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar .brand {
  padding: 16px 20px;
  background: #1e3a5f;
  color: white;
  font-weight: 700;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .company {
  padding: 12px 20px;
  color: #17a2b8;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: #c2c7d0;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.sidebar .nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-left-color: #17a2b8;
}

.sidebar .nav-item i,
.sidebar .nav-icon {
  width: 24px;
  margin-right: 10px;
  text-align: center;
  font-size: 15px;
}

.sidebar.collapsed .nav-text {
  display: none;
}

.sidebar.collapsed .brand-text {
  display: none;
}

/* ===== NAVBAR ===== */
.navbar {
  margin-left: 250px;
  height: 50px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: margin-left 0.3s;
  position: fixed;
  top: 0;
  right: 0;
  left: 250px;
  z-index: 999;
}

.sidebar.collapsed ~ .navbar {
  margin-left: 60px;
  left: 60px;
}

.navbar .hamburger {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #495057;
  padding: 0;
  transition: color 0.2s;
}

.navbar .hamburger:hover {
  color: #1e3a5f;
}

.navbar .breadcrumb {
  font-size: 13px;
  color: #6c757d;
}

.navbar .breadcrumb a {
  color: #17a2b8;
  text-decoration: none;
}

.navbar .breadcrumb a:hover {
  text-decoration: underline;
}

/* ===== CONTENT WRAPPER ===== */
.content-wrapper {
  margin-left: 250px;
  margin-top: 50px;
  padding: 20px;
  min-height: calc(100vh - 50px);
  transition: margin-left 0.3s;
}

.sidebar.collapsed ~ .content-wrapper {
  margin-left: 60px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1e3a5f;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
}

.card-body {
  padding: 20px;
}

/* ===== TABLES ===== */
.data-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  background: #f8f9fa;
  color: #495057;
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #dee2e6;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background 0.15s;
}

.data-table thead th:hover {
  background: #e9ecef;
}

.data-table thead th .sort-icon {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.4;
}

.data-table thead th.sort-asc .sort-icon,
.data-table thead th.sort-desc .sort-icon {
  opacity: 1;
  color: #17a2b8;
}

.data-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: #f8f9fa;
}

.data-table tbody td {
  padding: 10px 12px;
  color: #495057;
  vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 13px;
  color: #6c757d;
}

.pagination {
  display: flex;
  gap: 4px;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.pagination button.active {
  background: #17a2b8;
  color: white;
  border-color: #17a2b8;
}

.pagination button:hover:not(.active) {
  background: #e9ecef;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: #1e3a5f;
  color: white;
}

.btn-primary:hover {
  background: #2d5a8e;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover {
  background: #138496;
}

.btn-warning {
  background: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background: #e0a800;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-outline {
  background: white;
  color: #495057;
  border-color: #ced4da;
}

.btn-outline:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

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

.btn-csv {
  background: #6c757d;
  color: white;
}

.btn-csv:hover {
  background: #5a6268;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: #17a2b8;
  box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.15);
}

select.form-control {
  appearance: auto;
}

.form-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

input[type="date"].form-control {
  max-width: 160px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ===== SEARCH BOX ===== */
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-box label {
  font-size: 13px;
  color: #495057;
  font-weight: 500;
}

.search-box input {
  padding: 6px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
  width: 200px;
  transition: border-color 0.15s;
}

.search-box input:focus {
  outline: none;
  border-color: #17a2b8;
}

/* ===== STATUS BADGES ===== */
.badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

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

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

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

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

/* ===== ACTION DROPDOWN ===== */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-btn {
  padding: 4px 12px;
  background: #495057;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.action-btn:hover {
  background: #343a40;
}

.action-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 120px;
  margin-top: 4px;
}

.action-menu.show {
  display: block;
}

.action-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: #495057;
  text-decoration: none;
  transition: background 0.15s;
}

.action-menu a:hover {
  background: #f8f9fa;
}

/* ===== DASHBOARD SUMMARY CARDS ===== */
.summary-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.summary-card {
  border-radius: 8px;
  padding: 20px;
  color: white;
  position: relative;
  overflow: hidden;
}

.summary-card.green {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.summary-card.red {
  background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.summary-card.yellow {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: #212529;
}

.summary-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.summary-card p {
  font-size: 14px;
  opacity: 0.9;
}

.summary-card .card-link {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.summary-card .card-link:hover {
  color: white;
}

.summary-card .card-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 48px;
  opacity: 0.2;
}

.small-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ===== FILE UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed #ced4da;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #fafbfc;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.upload-zone.dragover {
  border-color: #17a2b8;
  background: #e8f8fa;
}

.file-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.download-sample {
  color: #dc3545;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.download-sample:hover {
  text-decoration: underline;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: white;
  border-radius: 8px;
  width: 500px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6c757d;
  padding: 0;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #212529;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e9ecef;
  text-align: right;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: #f8f9fa;
}

/* ===== TOAST NOTIFICATION ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
}

.toast {
  background: #28a745;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease-out;
}

.toast.error {
  background: #dc3545;
}

.toast.warning {
  background: #ffc107;
  color: #212529;
}

.toast.info {
  background: #17a2b8;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== FOOTER ===== */
.main-footer {
  background: white;
  padding: 12px 20px;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6c757d;
  margin-left: 250px;
  transition: margin-left 0.3s;
}

.sidebar.collapsed ~ .main-footer {
  margin-left: 60px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar .nav-text,
  .sidebar .brand-text,
  .sidebar .company {
    display: none;
  }

  .navbar,
  .content-wrapper,
  .main-footer {
    margin-left: 60px;
  }

  .small-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .modal {
    width: 95%;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header h1 {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .table-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box input {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .small-cards {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 12px;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 8px;
  }

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