* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f5f7fa;
  color: #333;
}

.main-container {
  display: flex;
  min-height: calc(100vh - 71px);
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid #e0e0e0;
  padding: 20px 0;
  height: calc(100vh - 71px);
  position: sticky;
  top: 71px;
  overflow-y: auto;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 5px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: #666;
  text-decoration: none;
  transition: all 0.2s;
}

.sidebar-nav a:hover {
  background: #f5f7fa;
  color: #00aa4e;
}

.sidebar-nav a.active {
  background: #00aa4e;
  color: white;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.page-header {
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #1a1a1a;
}

.page-header p {
  color: #666;
  font-size: 14px;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

/* File Upload Zone */
.file-upload {
  border: 2px dashed #e0e0e0;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #fafbfc;
}

.file-upload:hover {
  border-color: #00aa4e;
  background: #f5f7ff;
}

.file-upload.dragover {
  border-color: #00aa4e;
  background: #eef2ff;
}

.file-upload-icon {
  font-size: 48px;
  color: #00aa4e;
  margin-bottom: 10px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 600;
  font-size: 14px;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: #00aa4e;
}

.help-text {
  font-size: 12px;
  color: #999;
  margin-top: 5px;
}

/* File List */
.file-list {
  margin-top: 15px;
}

.file-item {
  background: #f8f9fa;
  padding: 12px;
  margin: 8px 0;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, #00aa4e 0%, #00cc5e 100%);
  color: white;
  width: 100%;
  padding: 15px;
  font-size: 16px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #f5f7fa;
  color: #666;
}

.btn-secondary:hover {
  background: #e8eaed;
}

/* Alerts */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border-left: 4px solid #4caf50;
}

.alert-error {
  background: #ffebee;
  color: #c62828;
  border-left: 4px solid #f44336;
}

.alert-info {
  background: #e6f7ed;
  color: #1565c0;
  border-left: 4px solid #2196f3;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

/* Tables */
.table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f5f7fa;
}

th,
td {
  padding: 16px 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
}

th {
  font-weight: 600;
  font-size: 13px;
  color: #666;
  text-transform: uppercase;
}

tbody tr {
  background: white;
}

tbody tr:hover {
  background: #f9fafb !important;
}

.dossier-main-row {
  font-weight: 500;
  font-size: 14px;
}

.dossier-main-row:hover {
  background: #e6f7ed !important;
}

.expand-icon {
  display: inline-block;
  font-size: 10px;
  color: #00aa4e;
  transition: transform 0.2s;
}

.hs-code-row {
  background: #f8f9fa !important;
  font-size: 13px;
}

.hs-code-row td {
  padding: 12px !important;
  border-bottom: 1px solid #e9ecef !important;
}

.total-row {
  background: #e6f7ed !important;
  font-weight: 600;
  border-top: 2px solid #00aa4e !important;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 15px;
}

.pagination-btn {
  background: #00aa4e;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
  background: #009944;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.pagination-btn:disabled {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pagination-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.time-badge {
  background: #e6f7ed;
  color: #00aa4e;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.hs-code-badge {
  background: #eef2ff;
  color: #00aa4e;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: bold;
  font-size: 12px;
}

.country-badge {
  background: #fff3cd;
  color: #856404;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* Download Button */
.btn-download {
  background: #00aa4e;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  font-weight: 600;
}

.btn-download:hover {
  background: #009944;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Date Section */
.date-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 25px;
  margin-bottom: 25px;
}

.date-header {
  font-size: 20px;
  font-weight: 700;
  color: #00aa4e;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: white;
  margin: 15% auto;
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  color: #d32f2f;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  color: #333;
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-info {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 6px;
  margin: 15px 0;
  font-size: 14px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn-confirm {
  background: #d32f2f;
  color: white;
}

.modal-btn-confirm:hover {
  background: #b71c1c;
}

.modal-btn-cancel {
  background: #f0f0f0;
  color: #333;
}

.modal-btn-cancel:hover {
  background: #e0e0e0;
}

.dossier-warning {
  display: none;
  padding: 12px;
  background: #fff3cd;
  border-left: 4px solid #ff9800;
  border-radius: 4px;
  color: #856404;
  font-size: 14px;
  margin-top: 8px;
}

/* Container Cards for Batch Upload */
.container-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
  border-left: 4px solid #00aa4e;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.container-header {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.container-number {
  background: #00aa4e;
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 15px;
}

.file-pair {
  display: flex;
  gap: 10px;
  margin-bottom: 0;
  font-size: 12px;
}

.file-badge {
  background: #f8f9fa;
  padding: 8px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.dossier-input-group {
  margin-top: 15px;
}

.dossier-input-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.dossier-input-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.dossier-input-group input:focus {
  outline: none;
  border-color: #00aa4e;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .sidebar {
    width: 280px;
  }

  .main-content {
    padding: 15px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .page-header p {
    font-size: 13px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card-body {
    padding: 15px;
  }

  .file-upload {
    padding: 30px 15px;
  }

  .file-upload-icon {
    font-size: 36px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .btn-primary {
    padding: 14px;
    font-size: 15px;
  }

  /* Table Responsive */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  th,
  td {
    padding: 12px 8px;
    font-size: 13px;
  }

  th {
    font-size: 11px;
  }

  .date-header {
    font-size: 18px;
  }

  .date-section {
    padding: 15px;
  }

  /* Modal adjustments */
  .modal-content {
    margin: 20% auto;
    padding: 20px;
    max-width: 90%;
  }

  .modal-header {
    font-size: 18px;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .modal-btn {
    width: 100%;
  }

  /* Container cards for batch */
  .container-card {
    padding: 12px;
  }

  .container-header {
    font-size: 14px;
  }

  .file-pair {
    flex-direction: column;
    gap: 8px;
  }

  /* Form adjustments */
  input[type="text"],
  input[type="number"] {
    padding: 10px 14px;
    font-size: 14px;
  }

  .form-group label {
    font-size: 13px;
  }

  /* Pagination */
  .pagination-container {
    flex-wrap: wrap;
    gap: 8px;
  }

  .pagination-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 12px;
  }

  .page-header {
    margin-bottom: 20px;
  }

  .page-header h1 {
    font-size: 20px;
  }

  .card-body {
    padding: 12px;
  }

  .file-upload {
    padding: 20px 12px;
  }

  .file-upload p:first-of-type {
    font-size: 16px !important;
  }

  .file-upload p:last-of-type {
    font-size: 12px !important;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-label {
    font-size: 12px;
  }

  .stat-value {
    font-size: 18px;
  }

  .date-section {
    padding: 12px;
  }

  .date-header {
    font-size: 16px;
    padding-bottom: 10px;
  }

  table {
    min-width: 500px;
  }

  th,
  td {
    padding: 10px 6px;
    font-size: 12px;
  }

  .btn-download {
    padding: 6px 12px;
    font-size: 12px;
  }

  .hs-code-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  .time-badge,
  .country-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  .container-card {
    padding: 10px;
  }

  .container-number {
    font-size: 13px;
    padding: 2px 8px;
  }

  .file-badge {
    padding: 6px 8px;
    font-size: 11px;
  }

  .modal-content {
    margin: 10% auto;
    padding: 15px;
  }

  .alert {
    padding: 12px 15px;
    font-size: 13px;
  }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {

  .btn,
  .sidebar-nav a,
  .accordion-header {
    min-height: 44px;
  }

  .header-logout {
    min-height: 40px;
  }

  input[type="text"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px;
    /* Prevents zoom on iOS */
  }
}