:root {
    --primary-color: #2c3e50;
    /* Deep Navy */
    --secondary-color: #34495e;
    /* Lighter Navy */
    --accent-color: #3498db;
    /* Bright Blue */
    --success-color: #27ae60;
    --danger-color: #c0392b;
    --text-color: #333;
    --text-light: #7f8c8d;
    --bg-color: #ecf0f1;
    /* Light Gray */
    --sidebar-width: 260px;
    --header-height: 60px;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --transition-speed: 0.3s;
    --sidebar-bg: #1f2937;
    --sidebar-text: #e5e7eb;
    --accent: #3b82f6;
    --header-bg: #ffffff;
    --sidebar-collapsed-width: 70px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: width var(--transition-speed);
    overflow: hidden;
}

/* Collapsed state */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Hide brand text when collapsed */
.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand span {
    display: none;
}

/* Sidebar menu text */
.sidebar-menu a span {
    transition: opacity 0.2s;
}

/* Hide text when collapsed */
.sidebar.collapsed .sidebar-menu a span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Center icons when collapsed */
.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 12px 0;
}

/* Remove left border when collapsed */
.sidebar.collapsed .sidebar-menu a.active,
.sidebar.collapsed .sidebar-menu a:hover {
    border-left: none;
}

/* Main content shift */
.main-content {
    transition: margin-left var(--transition-speed);
}

.sidebar.collapsed~.main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Tooltip (collapsed mode only) */
.sidebar.collapsed .sidebar-menu a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-collapsed-width) + 10px);
    background: #111;
    color: #fff;
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    top: 50%;
    transition: opacity 0.2s;
    z-index: 2000;
}

.sidebar.collapsed .sidebar-menu a:hover::after {
    opacity: 1;
}

/* Toggle button */
.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--secondary-color);
    margin-right: 15px;
}

/* Mobile auto-collapse */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }

    .sidebar span {
        display: none;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip i {
    color: var(--accent-color);
}

/* Hidden tooltip text */
.tooltip .tooltip-text {
    visibility: hidden;
    width: max-content;
    max-width: 220px;
    background-color: var(--primary-color);
    color: #fff;
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.4;

    position: absolute;
    z-index: 999;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);

    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Arrow */
.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

/* Show on hover */
.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}


.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #bdc3c7;
    text-decoration: none;
    transition: var(--transition-speed);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--secondary-color);
    color: white;
    border-left: 4px solid var(--accent-color);
}

.sidebar-menu i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: var(--header-height);
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Content Area */
.content-wrapper {
    padding: 30px;
    overflow-y: auto;
}

/* Dashboard Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-info h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary-color);
}

.card-info p {
    margin: 5px 0 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.card-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    opacity: 0.2;
}

/* Tables */
.data-table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.data-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-speed);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #a93226;
}

/* DataTables Overrides */
table.dataTable thead th {
    background-color: var(--bg-color) !important;
    color: var(--secondary-color) !important;
    border-bottom: 2px solid #ddd !important;
}

table.dataTable.no-footer {
    border-bottom: none !important;
}

/* Login Page Specific */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
}

.login-card {
    background: white;
    width: 380px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-logo {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition-speed);
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.login-btn:hover {
    background-color: var(--secondary-color);
}

/* Candidate Grid */
.candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.candidate-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}

.candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.candidate-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.candidate-name {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin: 0;
}

.candidate-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.candidate-body {
    padding: 20px;
    flex-grow: 1;
}

.candidate-info-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 0.95rem;
}

.candidate-info-row i {
    width: 25px;
    color: var(--accent-color);
    text-align: center;
    margin-right: 10px;
}

.candidate-tags {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #eef2f7;
    color: var(--secondary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.candidate-footer {
    padding: 15px 20px;
    background-color: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-view {
    background-color: #e3f2fd;
    color: var(--accent-color);
}

.btn-view:hover {
    background-color: var(--accent-color);
    color: white;
}

.btn-delete {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.btn-delete:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 0.95rem;
    transition: 0.2s;
}

.search-input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}