* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Times New Roman", Times, serif;
}

body {
  background-color: #f4f6f9;
  color: #222;
  font-size: 15px;
  line-height: 1.5;
}

/* Header Hành chính */
.app-header {
  background-color: #003366; /* Xanh đậm hành chính */
  color: #ffffff;
  padding: 12px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #cc0000; /* Viền đỏ cờ */
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.red-flag, .national-emblem {
  background-color: #cc0000;
  color: #ffde00;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.app-header h1 {
  font-size: 19px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.app-header p {
  font-size: 13px;
  color: #dbe4ef;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 14px;
}

.btn-logout {
  background: #cc0000;
  color: white;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 3px;
  font-weight: bold;
}

/* Container */
.container {
  max-width: 1440px;
  margin: 20px auto;
  padding: 0 20px;
}

/* Alert panel nhắc việc */
.alert-box {
  background: #fff8e1;
  border-left: 5px solid #ff9800;
  padding: 12px 18px;
  margin-bottom: 20px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Nút tải và kéo thả */
.upload-section {
  background: #ffffff;
  border: 1px solid #dcdcdc;
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 4px;
  text-align: center;
}

.btn-large-green {
  background-color: #00802b;
  color: #ffffff;
  border: none;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-large-green:hover {
  background-color: #006622;
}

.drag-drop-zone {
  border: 2px dashed #003366;
  background: #f7faff;
  padding: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.drag-drop-zone.dragover {
  background: #e3effd;
  border-color: #cc0000;
}

.drop-text {
  font-size: 17px;
  font-weight: bold;
  color: #003366;
  margin-top: 8px;
}

.file-note {
  font-size: 13px;
  color: #666;
  display: block;
  margin-top: 4px;
}

/* Bộ lọc */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  background: white;
  padding: 12px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.filter-bar input, .filter-bar select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
}

#search-input {
  flex: 2;
}

.btn-primary {
  background-color: #003366;
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}

.btn-secondary {
  background-color: #555;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 3px;
  cursor: pointer;
}

/* Bảng công văn */
.table-container {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow-x: auto;
}

.gov-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.gov-table th {
  background-color: #f1f4f8;
  color: #003366;
  border: 1px solid #d0d7de;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: bold;
}

.gov-table td {
  border: 1px solid #d0d7de;
  padding: 10px 8px;
  font-size: 14px;
  vertical-align: top;
}

.gov-table tr:hover {
  background-color: #fafbfc;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 3px;
}
.badge-assigned { background: #e3f2fd; color: #0d47a1; }
.badge-unassigned { background: #ffebee; color: #b71c1c; }
.badge-attended { background: #e8f5e9; color: #1b5e20; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: white;
  width: 420px;
  padding: 30px;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.login-card h2 {
  font-size: 18px;
  color: #003366;
  margin: 12px 0 4px;
}

.login-card .sub-header {
  font-size: 13px;
  color: #cc0000;
  margin-bottom: 20px;
  font-weight: bold;
}

.modal-dialog {
  background: white;
  width: 92%;
  max-width: 1280px;
  max-height: 90vh;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  background: #003366;
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.modal-body-split {
  display: flex;
  padding: 20px;
  gap: 20px;
  overflow-y: auto;
}

.raw-text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid #ddd;
  padding-right: 15px;
}

.raw-text-col textarea {
  flex: 1;
  min-height: 350px;
  background: #f8f9fa;
  border: 1px solid #ccc;
  padding: 10px;
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
}

.form-col {
  flex: 1.3;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 13px;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.req { color: #cc0000; }

.warning-box {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 3px;
}

.confidence-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
}
.confidence-high { background: #c8e6c9; color: #2e7d32; }
.confidence-check { background: #ffcdd2; color: #c62828; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

/* In ấn chuẩn A4 nằm ngang */
@media print {
  .app-header, .upload-section, .filter-bar, .modal-backdrop, th:last-child, td:last-child {
    display: none !important;
  }
  body, .container {
    margin: 0;
    padding: 0;
    background: white;
  }
  .gov-table th {
    background: #eee !important;
    color: black !important;
  }
}