:root {
  /* LIGHT THEME (Default) */
  --surface-0: hsl(0, 0%, 94%);
  --surface-1: hsl(0, 0%, 100%);
  --surface-2: hsl(0, 0%, 96%);
  --text-main: hsl(0, 0%, 10%);
  --text-muted: hsl(0, 0%, 40%);
  --border:    hsl(0, 0%, 85%);
  --accent:    hsl(142, 71%, 45%);
  --danger:    hsl(0, 84%, 60%);
  --warning:   hsl(38, 92%, 50%);
  
  --sidebar-width: 80px;
}

body.dark {
  /* DARK THEME */
  --surface-0: hsl(0, 0%, 5%);
  --surface-1: hsl(0, 0%, 10%);
  --surface-2: hsl(0, 0%, 15%);
  --text-main: hsl(0, 0%, 90%);
  --text-muted: hsl(0, 0%, 60%);
  --border:    hsl(0, 0%, 20%);
}

body {
  background-color: var(--surface-0);
  color: var(--text-main);
  transition: background-color 0.3s, color 0.3s;
  font-family: 'Inter', sans-serif;
  margin: 0;
  overflow: hidden;
  height: 100vh;
}

/* --- Layout --- */
.app-container { display: flex; height: 100vh; position: relative; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  z-index: 100; transition: all 0.3s ease; padding-top: 20px;
}

.sidebar-header { 
    width: 100%; display: flex; justify-content: center; 
    padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}

.logo-icon {
  width: 40px; height: 40px;
  background: var(--text-main); color: var(--surface-1);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}

.nav-item {
  background: none; border: none;
  display: flex; justify-content: center; align-items: center;
  width: 50px; height: 50px; border-radius: 12px;
  color: var(--text-muted); font-size: 1.2rem; margin-bottom: 8px;
  text-decoration: none; transition: all 0.2s; position: relative;
}
.nav-item:hover { background-color: var(--surface-2); color: var(--text-main); }
.nav-item.active { color: var(--surface-1); background-color: var(--text-main); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

.user-profile {
  margin-top: auto; padding: 20px 0; border-top: 1px solid var(--border);
  width: 100%; display: flex; justify-content: center;
}

.sidebar-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 90; backdrop-filter: blur(2px);
    display: none; opacity: 0; transition: opacity 0.3s;
}
.sidebar-overlay.show { display: block; opacity: 1; }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.2rem; color: var(--text-main); margin-right: 15px; }

/* --- Main Content --- */
.main-content {
  flex: 1; display: flex; flex-direction: column;
  background-color: var(--surface-0);
  width: calc(100% - var(--sidebar-width));
}

.top-bar {
  height: 70px; background-color: var(--surface-1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}

.content-wrapper { padding: 32px; flex: 1; overflow-y: auto; overflow-x: hidden; }

/* --- Components --- */
.card-panel {
  background-color: var(--surface-1); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; margin-bottom: 24px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.monochrome-img { filter: grayscale(100%) contrast(1.1); transition: filter 0.3s ease; object-fit: cover; }
.monochrome-img:hover { filter: grayscale(0%); }

.exec-img { width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--surface-2); }
.bod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.bod-item {
  background-color: var(--surface-1); border: 1px solid var(--border);
  padding: 16px; border-radius: 8px; display: flex; align-items: center; gap: 12px;
}
.bod-item img { width: 48px; height: 48px; border-radius: 50%; }

/* --- Tables & Lists --- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.custom-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.custom-table th {
  background-color: var(--surface-2); color: var(--text-muted);
  text-align: left; padding: 12px 16px; font-size: 0.8rem; text-transform: uppercase; white-space: nowrap;
  position: sticky; top: 0; z-index: 10; border-bottom: 2px solid var(--border);
}
.custom-table td { 
    padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-main); 
    vertical-align: middle;
}
.custom-table tr:hover td { background-color: var(--surface-2); }

/* Row Highlight for IDS */
.row-active td {
    background-color: hsla(142, 71%, 45%, 0.05) !important;
    border-bottom: 1px solid var(--accent);
}

.badge-soft { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; border: 1px solid transparent; display: inline-block;}
.badge-soft.success { background-color: hsla(142, 71%, 45%, 0.1); color: var(--accent); border-color: hsla(142, 71%, 45%, 0.2); }
.badge-soft.danger { background-color: hsla(0, 84%, 60%, 0.1); color: var(--danger); border-color: hsla(0, 84%, 60%, 0.2); }
.badge-soft.info { background-color: hsla(217, 91%, 60%, 0.1); color: #3b82f6; border-color: hsla(217, 91%, 60%, 0.2); }
.badge-soft.warning { background-color: hsla(38, 92%, 50%, 0.1); color: var(--warning); border-color: hsla(38, 92%, 50%, 0.2); }

.search-input {
  background-color: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-main); padding: 8px 12px; border-radius: 6px; width: 100%;
}

@media (max-width: 768px) {
    .sidebar { width: 280px; position: fixed; left: -280px; top: 0; bottom: 0; align-items: flex-start; padding: 20px; box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    .sidebar.active { transform: translateX(280px); }
    .mobile-toggle { display: block; }
    .main-content { width: 100%; }
    .top-bar { padding: 0 16px; height: 60px; }
    .content-wrapper { padding: 16px; }
}

/* --- KPI Progress Bar Specifics --- */
.kpi-track-container {
    position: relative;
    height: 25px;
    background-color: var(--surface-2);
    border-radius: 12px;
    margin-top: 30px; /* Space for labels */
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.kpi-actual-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #34d399);
    border-radius: 12px;
    transition: width 1s ease-in-out;
    position: relative;
    z-index: 1;
}

.kpi-target-line {
    position: absolute;
    top: -10px;
    bottom: -10px;
    width: 2px;
    background-color: var(--danger);
    border-left: 2px dashed var(--danger); /* Dashed Line */
    z-index: 5;
    transform: translateX(-50%);
}

.kpi-target-label {
    position: absolute;
    top: -35px;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--danger);
    white-space: nowrap;
    background: var(--surface-1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--danger);
}

.kpi-actual-label {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}