/* ==========================================================================
   NOVA IT PARK — RECRUITMENT MANAGEMENT SYSTEM (RMS)
   Design System & Main Stylesheet (Vanilla Modern CSS)
   ========================================================================== */

:root {
  /* Brand Palette — NOVA IT PARK Official Theme */
  --primary: #00794E;           /* Brand Emerald Green */
  --primary-hover: #00633f;
  --primary-light: #e6f2ed;
  --primary-focus: rgba(0, 121, 78, 0.25);
  
  --secondary: #00396F;         /* Brand Deep Corporate Navy Blue */
  --secondary-hover: #002c56;
  --secondary-light: #e6ebf1;
  --secondary-focus: rgba(0, 57, 111, 0.25);

  /* Accent & Functional Colors */
  --accent: #00794E;
  --accent-blue: #00396F;
  --accent-purple: #5c3b9e;
  --success: #00794E;
  --success-light: #e6f2ed;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --info: #00396F;
  --info-light: #e6ebf1;

  /* Neutral Surface Colors */
  --bg-body: #F8F9FB;          /* Light Neutral Background */
  --bg-surface: #ffffff;
  --bg-sidebar: #002548;       /* Deep Corporate Navy Sidebar */
  --bg-sidebar-hover: #003362;
  --bg-sidebar-active: #00794E;/* Brand Green Active */
  
  --text-main: #2D2D2D;        /* Neutral Dark Charcoal Text */
  --text-muted: #555555;
  --text-light: #888888;
  --text-white: #ffffff;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #00794E;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

  /* Layout dimensions */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 70px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
}

img, svg {
  vertical-align: middle;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 1.85rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 0.95rem; }

p {
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   App Shell Layout (Sidebar + Topbar + Content)
   ========================================================================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  height: var(--topbar-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-white);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.sidebar-brand-badge {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 0.9rem;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex: 1;
}

.nav-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #475569;
  font-weight: 700;
  padding: 0.75rem 0.75rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 0.2rem;
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-white);
  transform: translateX(2px);
}

.nav-item.active {
  background-color: var(--primary);
  color: var(--text-white);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

/* Main Content Area */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.app-topbar {
  height: var(--topbar-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-search {
  position: relative;
  width: 320px;
}

.topbar-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  background-color: var(--bg-body);
  transition: all 0.2s ease;
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-focus);
}

.topbar-search svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  width: 16px;
  height: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Page Content Container */
.page-container {
  padding: 1.75rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title-group h1 {
  font-size: 1.6rem;
  color: var(--text-main);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   UI Components (Buttons, Cards, Tables, Forms, Badges, Tabs, Modals)
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
  text-decoration: none;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(0, 121, 78, 0.35);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--text-white);
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(0, 57, 111, 0.3);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  color: var(--text-white);
}

.btn-outline-secondary {
  background-color: transparent;
  color: var(--secondary);
  border-color: var(--secondary);
}

.btn-outline-secondary:hover {
  background-color: var(--secondary);
  color: var(--text-white);
}

.btn-success {
  background-color: var(--primary);
  color: var(--text-white);
}

.btn-success:hover {
  background-color: var(--primary-hover);
  color: var(--text-white);
}

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

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

.btn-warning {
  background-color: var(--warning);
  color: #78350f;
}

.btn-warning:hover {
  background-color: #d97706;
  color: var(--text-white);
}

.btn-outline-primary {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary-light);
  color: var(--primary-hover);
}

/* Cards */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background-color: var(--bg-body);
  border-top: 1px solid var(--border-color);
}

/* KPI Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.primary { background-color: var(--primary-light); color: var(--primary); }
.stat-icon.success { background-color: var(--success-light); color: var(--success); }
.stat-icon.warning { background-color: var(--warning-light); color: var(--warning); }
.stat-icon.danger  { background-color: var(--danger-light);  color: var(--danger); }
.stat-icon.info    { background-color: var(--info-light);    color: var(--info); }
.stat-icon.purple  { background-color: #f3e8ff;              color: var(--accent-purple); }

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 0.2rem;
}

.stat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

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

.table th {
  background-color: #f8fafc;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 0.95rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color 0.12s ease;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  line-height: 1;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge-gray     { background-color: #f1f5f9; color: #475569; }
.badge-blue     { background-color: #dbeafe; color: #1e40af; }
.badge-indigo   { background-color: #e0e7ff; color: #3730a3; }
.badge-purple   { background-color: #f3e8ff; color: #6b21a8; }
.badge-cyan     { background-color: #cffafe; color: #155e75; }
.badge-teal     { background-color: #ccfbf1; color: #115e59; }
.badge-emerald  { background-color: #d1fae5; color: #065f46; }
.badge-success  { background-color: #dcfce7; color: #166534; }
.badge-warning  { background-color: #fef3c7; color: #92400e; }
.badge-amber    { background-color: #fef3c7; color: #b45309; }
.badge-orange   { background-color: #ffedd5; color: #9a3412; }
.badge-rose     { background-color: #ffe4e6; color: #9f1239; }
.badge-danger   { background-color: #fee2e2; color: #991b1b; }
.badge-dark     { background-color: #334155; color: #f8fafc; }

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: var(--danger);
}

.form-control, .form-select {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-focus);
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Alerts */
.alert {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--success-light);
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-danger {
  background-color: var(--danger-light);
  border-color: #fecaca;
  color: #991b1b;
}

.alert-warning {
  background-color: var(--warning-light);
  border-color: #fde68a;
  color: #92400e;
}

.alert-info {
  background-color: var(--info-light);
  border-color: #bfdbfe;
  color: #1e40af;
}

/* Tabs Navigation */
.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-link {
  padding: 0.75rem 1.15rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-link:hover {
  color: var(--primary);
}

.tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-dialog {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.modal-lg {
  max-width: 800px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

@media (max-width: 768px) {
  .page-container {
    padding: 1rem;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .page-actions .btn {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .topbar-search {
    width: 100%;
    max-width: 220px;
  }
  .user-info {
    display: none;
  }
  .card-body {
    padding: 1rem;
  }
  .card-header, .card-footer {
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  .btn {
    padding: 0.55rem 0.95rem;
  }
}
