/* ==========================================================================
   ANTI-MATRIX ASSESSMENT PLATFORM — ENTERPRISE LIGHT DESIGN SYSTEM
   Palette: Main #F8FAFC | Sidebar #FFFFFF | Cards #FFFFFF | Text #172033 | Accent #F97316
   ========================================================================== */

:root {
  --bg-main: #F8FAFC;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --border-color: #E2E8F0;
  --border-light: #CBD5E1;
  
  --primary: #F97316;
  --primary-hover: #EA580C;
  --primary-light: #FFF7ED;
  --primary-border: #FFEDD5;
  
  --text-main: #172033;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  
  --success: #16A34A;
  --success-bg: #F0FDF4;
  --success-border: #BBF7D0;
  
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --warning-border: #FDE68A;
  
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --danger-border: #FECACA;
  
  --info: #2563EB;
  --info-bg: #EFF6FF;
  --info-border: #BFDBFE;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar-width: 250px;
  --header-height: 60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.15s ease-in-out;
}

/* Base resets & typography */
body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff !important;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary, .btn-outline-secondary {
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  color: #334155;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  transition: var(--transition);
}
.btn-secondary:hover, .btn-outline-secondary:hover {
  background-color: #F8FAFC;
  border-color: var(--border-light);
  color: #0F172A;
}

.btn-outline-primary {
  background-color: #FFFFFF;
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  transition: var(--transition);
}
.btn-outline-primary:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */
.card-dark, .card-clean, .card-light {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.25rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.metric-card:hover {
  border-color: #CBD5E1;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.metric-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-custom {
  color: var(--text-main);
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.table-custom thead th {
  background-color: #F8FAFC;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  border-top: none;
}
.table-custom tbody tr {
  background-color: #FFFFFF;
  transition: var(--transition);
}
.table-custom tbody tr:hover {
  background-color: #F8FAFC;
}
.table-custom tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.875rem;
  color: var(--text-main);
}

/* Badges */
.badge-custom {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.badge-active, .badge-completed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.badge-used, .badge-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}
.badge-expired, .badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.badge-disabled, .badge-secondary {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}
.badge-in_progress, .badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-control-custom, .form-select-custom {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  transition: var(--transition);
}
.form-control-custom:focus, .form-select-custom:focus {
  background-color: #FFFFFF;
  border-color: var(--primary);
  color: var(--text-main);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
  outline: none;
}
.form-control-custom::placeholder {
  color: var(--text-dim);
}
.form-label-custom {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   AUTHENTICATION PAGE
   ========================================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-main);
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-md);
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.auth-brand-logo {
  width: 38px;
  height: 38px;
  background-color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
}
.auth-brand-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.auth-brand-text span {
  color: var(--primary);
}

.password-field-wrapper {
  position: relative;
}
.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.password-toggle-btn:hover {
  color: var(--primary);
}

/* ==========================================================================
   ADMIN LAYOUT & SIDEBAR
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}
.sidebar-brand {
  height: var(--header-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-menu {
  list-style: none;
  padding: 0.75rem 0.5rem;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}
.sidebar-item {
  margin-bottom: 0.2rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  background-color: #F8FAFC;
  color: var(--text-main);
}
.sidebar-link.active {
  background-color: var(--primary-light);
  color: var(--primary-hover);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}
.sidebar-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
}

.admin-main {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
}
.admin-header {
  height: var(--header-height);
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}
.admin-content {
  padding: 1.5rem 1.75rem;
  flex-grow: 1;
}

/* ==========================================================================
   CANDIDATE PORTAL
   ========================================================================== */
.candidate-header {
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.countdown-box {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  text-align: center;
}
.countdown-digits {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-hover);
  font-family: monospace;
}

.voucher-card {
  background: #FFFFFF;
  border: 1px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}
.voucher-code {
  font-family: monospace;
  font-size: 1.15rem;
  background-color: #F8FAFC;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  color: #0369A1;
}

/* ==========================================================================
   PILLS & TABS
   ========================================================================== */
.custom-category-pills .nav-link {
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-size: 0.875rem;
}
.custom-category-pills .nav-link:hover {
  color: var(--text-main);
  background: #F1F5F9;
}
.custom-category-pills .nav-link.active {
  background: #FFFFFF;
  color: var(--primary-hover);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
}
