:root {
    --primary: #1a3a5c;
    --primary-light: #2c5282;
    --primary-dark: #0f2440;
    --accent: #c9a84c;
    --accent-hover: #b8943a;
    --sidebar-width: 250px;
}

html, body {
    font-size: 14px;
    min-height: 100vh;
    background: #f5f7fa;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ========== SIDEBAR ========== */
#wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    transition: margin-left 0.3s ease;
    flex-shrink: 0;
}

.sidebar.toggled {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-brand {
    padding: 20px 20px 10px;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand i {
    font-size: 24px;
    color: var(--accent);
}

.sidebar-divider {
    border-color: rgba(255,255,255,0.1);
    margin: 10px 15px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--accent);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-left-color: var(--accent);
    font-weight: 600;
}

#page-content-wrapper {
    flex: 1;
    overflow-x: hidden;
}

#menu-toggle {
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--primary);
}

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 40px 30px 20px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(26, 58, 92, 0.3);
}

.login-header h2 {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.login-body {
    padding: 0 30px 20px;
}

.login-body .form-label {
    font-weight: 600;
    color: #444;
    font-size: 13px;
}

.login-body .input-group-text {
    background: #f8f9fa;
    border-right: none;
    color: var(--primary);
}

.login-body .form-control {
    border-left: none;
    padding: 10px 12px;
}

.login-body .input-group:focus-within .input-group-text {
    border-color: var(--primary-light);
}

.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 12px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.3);
}

.login-footer {
    text-align: center;
    padding: 15px 30px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #888;
}

/* ========== DASHBOARD ========== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    padding: 14px 20px;
}

.card-body {
    padding: 20px;
}

.stat-card {
    border-radius: 12px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.text-white-50 {
    color: rgba(255,255,255,0.65) !important;
}

/* ========== TABLES ========== */
.table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
}

/* ========== FORMS ========== */
.form-label {
    font-weight: 600;
    color: #444;
    font-size: 13px;
}

/* ========== PAGE TITLES ========== */
.page-title {
    font-family: 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    margin: 0;
}

@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }
}

/* ========== BREADCRUMB ========== */
.breadcrumb-custom {
    font-size: 13px;
    color: #6b7280;
    margin: -4px 0 0;
    padding: 0;
}

.breadcrumb-custom a {
    color: var(--primary-light);
    text-decoration: none;
}

.breadcrumb-custom a:hover {
    text-decoration: underline;
}

.breadcrumb-custom .separator {
    margin: 0 6px;
    color: #9ca3af;
}

.breadcrumb-custom .current {
    color: #6b7280;
}

/* ========== ACTION BAR ========== */
.action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.total-badge {
    background: #eef2ff;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 10px;
    white-space: nowrap;
}

.btn-add-project {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add-project:hover {
    background: var(--primary-light);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.25);
}

/* ========== DIRECTORY CARD ========== */
.directory-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.directory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.directory-title-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.directory-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.directory-title {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.directory-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 2px 0 0;
}

.search-wrapper {
    position: relative;
    min-width: 280px;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
}

.search-wrapper input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    background: #f9fafb;
    transition: all 0.2s;
    outline: none;
}

.search-wrapper input:focus {
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

/* ========== MODERN TABLE ========== */
.table-container {
    padding: 0;
    overflow-x: auto;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-modern thead th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b7280;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.table-modern tbody tr {
    transition: background 0.15s;
}

.table-modern tbody tr:hover {
    background: #f9fafb;
}

.table-modern tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

.table-modern .code-cell {
    font-family: 'Inter', monospace;
    font-weight: 500;
    color: var(--primary-light);
    font-size: 12px;
}

.table-modern .name-cell {
    font-weight: 500;
    color: #111827;
}

.table-modern .flag-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-modern .budget-cell {
    font-weight: 500;
    color: #111827;
}

.table-modern .actions-cell {
    display: flex;
    gap: 6px;
}

.table-modern .btn-sm-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
    text-decoration: none;
}

.table-modern .btn-sm-icon:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background: #eef2ff;
}

.table-modern .btn-sm-icon.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.table-modern .empty-state {
    text-align: center;
    padding: 40px 16px;
    color: #9ca3af;
    font-size: 14px;
}

/* Status badges */
.badge-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.badge-status.ongoing {
    background: #eef2ff;
    color: var(--primary-light);
}

.badge-status.completed {
    background: #ecfdf5;
    color: #059669;
}

.badge-status.planning {
    background: #fffbeb;
    color: #d97706;
}

.badge-status.on-hold {
    background: #fef2f2;
    color: #dc2626;
}

@media (max-width: 768px) {
    .directory-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        min-width: 100%;
    }

    .action-bar {
        flex-wrap: wrap;
    }

    .table-modern thead th,
    .table-modern tbody td {
        padding: 10px 12px;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.toggled {
        margin-left: 0;
    }
}

/* ========== PAGINATION ========== */
.pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 13px;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background: #eef2ff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 2px;
}

.page-num {
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.page-num:hover {
    background: #f3f4f6;
}

.page-num.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-dots {
    padding: 0 4px;
    color: #9ca3af;
    font-size: 13px;
}

.pagination-per-page select {
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.pagination-per-page select:focus {
    border-color: var(--primary-light);
}

/* ========== BADGES ========== */
.badge {
    font-weight: 500;
    padding: 6px 12px;
}
