/* HR Admin Portal — Minimal clean UI */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success: #16a34a;
  --warning: #d97706;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Layout */
.app-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header h1 {
  font-size: 18px;
  font-weight: 600;
  margin-right: 32px;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-tabs li a {
  display: block;
  padding: 16px 16px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.nav-tabs li a:hover {
  color: var(--text);
}
.nav-tabs li a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Page sections */
.page {
  display: none;
}
.page.active {
  display: block;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}

.upload-zone .icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.upload-zone p {
  color: var(--text-secondary);
  font-size: 14px;
}
.upload-zone .formats {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Forms */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

.form-row label {
  min-width: 80px;
  font-size: 14px;
  font-weight: 500;
}

.form-row input,
.form-row select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.form-row input:focus,
.form-row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--bg);
}

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

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

tr:hover td {
  background: var(--bg);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-upload {
  background: #dcfce7;
  color: #166534;
}
.badge-delete {
  background: #fee2e2;
  color: #991b1b;
}
.badge-update {
  background: #fef3c7;
  color: #92400e;
}
.badge-category {
  background: #e0e7ff;
  color: #3730a3;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar input,
.filter-bar select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

/* Upload progress */
.upload-progress {
  display: none;
  margin: 16px 0;
}

.upload-progress.active {
  display: block;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

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

/* Upload result */
.upload-result {
  display: none;
  padding: 16px;
  border-radius: var(--radius);
  margin: 16px 0;
  font-size: 14px;
}

.upload-result.success {
  display: block;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.upload-result.error {
  display: block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  width: 90%;
}

.modal h3 {
  margin-bottom: 12px;
}
.modal p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* File preview */
.file-preview {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 16px;
}

.file-preview.active {
  display: flex;
}
.file-preview .file-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.file-preview .file-size {
  font-size: 12px;
  color: var(--text-secondary);
}
.file-preview .remove-file {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
}
.file-preview .remove-file:hover {
  color: var(--danger);
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }
  .form-row label {
    min-width: auto;
  }
  .filter-bar {
    flex-direction: column;
  }
}
