/* ============================================
   IMPERIAL COMPASS COMPLIANCE MONITOR
   Stylesheet
   ============================================ */

:root {
  --ic-navy: #1a3a5c;
  --ic-blue: #2471a3;
  --ic-light-blue: #a8c8e8;
  --red: #c0392b;
  --red-bg: #fdf2f2;
  --amber: #d68910;
  --amber-bg: #fef9e7;
  --green: #27ae60;
  --green-bg: #eafaf1;
  --blue-alert: #2471a3;
  --blue-bg: #eaf4fb;
  --grey: #95a5a6;
  --grey-bg: #f4f6f7;
  --text: #1a1a1a;
  --text-muted: #7f8c8d;
  --border: #e0e0e0;
  --white: #ffffff;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: #f0f4f8;
  min-height: 100vh;
}

/* ---- NAVBAR ---- */
.navbar {
  background: var(--ic-navy);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-weight: 600;
  font-size: 16px;
}

.logo-mark-sm {
  background: var(--ic-blue);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.nav-actions { display: flex; gap: 8px; }

/* ---- LOGIN PAGE ---- */
.login-page {
  background: linear-gradient(135deg, #1a3a5c 0%, #2471a3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  background: white;
  border-radius: 16px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-mark {
  background: var(--ic-navy);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  margin: 0 auto 16px;
}

.login-logo h1 {
  font-size: 22px;
  color: var(--ic-navy);
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 13px;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 28px;
  color: var(--ic-navy);
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 15px;
}

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-top: 4px solid var(--border);
}

.stat-total { border-top-color: var(--ic-navy); }
.stat-red { border-top-color: var(--red); }
.stat-amber { border-top-color: var(--amber); }
.stat-green { border-top-color: var(--green); }
.stat-pending { border-top-color: var(--grey); }

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--ic-navy);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- COURSE SECTIONS ---- */
.course-section {
  background: white;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}

.course-header {
  padding: 16px 24px;
  background: var(--ic-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-header h2 {
  color: white;
  font-size: 17px;
}

.module-count {
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
}

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; }

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

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

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.module-row:hover td { background: #fafafa; }

.module-name { font-weight: 500; }

.version-badge {
  background: #e8f4f8;
  color: var(--ic-blue);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- BADGES ---- */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-grey { background: var(--grey-bg); color: var(--grey); }

.issue-count {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 4px;
}

.issue-count.red { background: var(--red-bg); color: var(--red); }
.issue-count.amber { background: var(--amber-bg); color: var(--amber); }
.issue-count.blue { background: var(--blue-bg); color: var(--blue-alert); }

.actions-cell { white-space: nowrap; }

/* ---- DETAIL PANEL ---- */
.detail-row { background: #f8f9fa; }
.detail-row.hidden { display: none; }

.detail-panel {
  padding: 20px 24px;
}

.summary-text {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.alert-section {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.alert-section.red { background: var(--red-bg); border-left: 4px solid var(--red); }
.alert-section.amber { background: var(--amber-bg); border-left: 4px solid var(--amber); }
.alert-section.blue { background: var(--blue-bg); border-left: 4px solid var(--blue-alert); }

.alert-section h4 {
  margin-bottom: 8px;
  font-size: 14px;
}

.alert-section.red h4 { color: var(--red); }
.alert-section.amber h4 { color: var(--amber); }
.alert-section.blue h4 { color: var(--blue-alert); }

.alert-section ul {
  padding-left: 20px;
}

.alert-section li {
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.5;
}

.alert-section.red li { color: var(--red); }
.alert-section.amber li { color: var(--amber); }
.alert-section.blue li { color: var(--blue-alert); }

.text-green { color: var(--green); font-size: 14px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

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

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

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.8);
}

.btn-ghost:hover { color: white; background: rgba(255,255,255,0.1); }

.btn-full { width: 100%; text-align: center; padding: 12px; }

.btn-sm {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-outline {
  background: white;
  color: var(--ic-blue);
  border: 1px solid var(--ic-blue);
}

.btn-outline:hover { background: var(--ic-blue); color: white; }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red);
}

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

/* ---- FORMS ---- */
.form-card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 640px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--ic-navy);
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--ic-blue);
  box-shadow: 0 0 0 3px rgba(36, 113, 163, 0.1);
}

.form-group small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.login-form .form-group input {
  padding: 12px 14px;
  font-size: 15px;
}

/* ---- FILE DROP ZONE ---- */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--ic-blue);
  background: #f0f7ff;
}

.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon { font-size: 40px; margin-bottom: 12px; }

.file-drop-zone p { color: var(--text-muted); font-size: 14px; margin-bottom: 4px; }

.file-name {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--green-bg);
  border-radius: 6px;
  font-size: 13px;
  color: var(--green);
}

.file-drop-zone-sm {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  position: relative;
  margin: 12px 0;
}

.file-drop-zone-sm input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}

/* ---- INFO BOX ---- */
.info-box {
  background: #f0f7ff;
  border: 1px solid #c8e0f4;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  font-size: 14px;
}

.info-box ul {
  padding-left: 20px;
  margin-top: 8px;
}

.info-box li { margin-bottom: 4px; color: var(--text-muted); }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-red { background: var(--red-bg); color: var(--red); border: 1px solid #f5c6cb; }
.alert-green { background: var(--green-bg); color: var(--green); border: 1px solid #c3e6cb; }

/* ---- VERSION CONFLICT ---- */
.conflict-warning {
  text-align: center;
  padding: 40px;
  margin-bottom: 32px;
}

.conflict-icon { font-size: 60px; margin-bottom: 16px; }
.conflict-warning h1 { color: var(--amber); font-size: 28px; margin-bottom: 8px; }

.version-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.version-box {
  background: white;
  border-radius: 12px;
  padding: 24px 32px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  flex: 1;
  max-width: 280px;
}

.version-box.current { border-top: 4px solid var(--green); }
.version-box.uploading { border-top: 4px solid var(--amber); }

.version-box h3 { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.version-number { font-size: 32px; font-weight: 700; color: var(--ic-navy); margin-bottom: 8px; }
.version-status { font-size: 13px; margin-top: 8px; }

.version-arrow { font-size: 32px; color: var(--text-muted); }

.conflict-actions {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 640px;
  margin: 0 auto;
}

.action-buttons { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.override-note { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

/* ---- CURRENT VERSION BOX ---- */
.current-version-box {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  max-width: 640px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid var(--ic-blue);
}

.current-version-box h3 {
  color: var(--ic-navy);
  margin-bottom: 12px;
  font-size: 15px;
}

.version-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 14px;
}

.version-info div { color: var(--text-muted); }
.version-info div strong { color: var(--text); }

/* ---- UPLOAD PROGRESS ---- */
.upload-progress {
  margin-top: 16px;
  padding: 16px;
  background: #f0f7ff;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  color: var(--ic-blue);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #c8e0f4;
  border-top-color: var(--ic-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 8px;
}

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

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.empty-icon { font-size: 60px; margin-bottom: 16px; }
.empty-state h2 { color: var(--ic-navy); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* ---- FOOTER ---- */
.footer {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 12px;
}

.footer p { margin-bottom: 4px; }

/* ---- UTILITIES ---- */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .main-content { padding: 16px; }
  .navbar { padding: 0 16px; }
  .version-compare { flex-direction: column; }
  .version-arrow { transform: rotate(90deg); }
}
