/**
 * WORLD PEACE — GMS (Grant Management System)
 * Official Institutional Humanitarian Design System
 * Official Royal Blue: #1A60B7
 */

:root {
    --wp-primary: #1A60B7;
    --wp-primary-hover: #144b91;
    --wp-primary-light: #e8f1fb;
    --wp-primary-rgb: 26, 96, 183;
    
    --wp-dark: #1e293b;
    --wp-gray-50: #f8fafc;
    --wp-gray-100: #f1f5f9;
    --wp-gray-200: #e2e8f0;
    --wp-gray-300: #cbd5e1;
    --wp-gray-500: #64748b;
    --wp-gray-700: #334155;
    
    --wp-success: #10b981;
    --wp-warning: #f59e0b;
    --wp-danger: #ef4444;
    --wp-info: #0ea5e9;

    --sidebar-width: 280px;
    --header-height: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8fafc;
    color: var(--wp-gray-700);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar Styling */
.gms-sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--wp-gray-200);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.gms-sidebar .brand-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--wp-gray-200);
    background: #ffffff;
}

.gms-sidebar .brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.gms-sidebar .menu-heading {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp-gray-500);
    padding: 1rem 1.25rem 0.4rem;
}

.gms-sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.25rem;
    color: var(--wp-gray-700);
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease-in-out;
}

.gms-sidebar .nav-link i {
    font-size: 1.15rem;
    margin-right: 0.75rem;
    color: var(--wp-gray-500);
    width: 20px;
    text-align: center;
}

.gms-sidebar .nav-link:hover {
    color: var(--wp-primary);
    background: var(--wp-primary-light);
    border-left-color: var(--wp-primary);
}

.gms-sidebar .nav-link:hover i {
    color: var(--wp-primary);
}

.gms-sidebar .nav-link.active {
    color: var(--wp-primary);
    background: var(--wp-primary-light);
    border-left-color: var(--wp-primary);
    font-weight: 600;
}

.gms-sidebar .nav-link.active i {
    color: var(--wp-primary);
}

.gms-sidebar .nav-item-sub .nav-link {
    padding-left: 2.75rem;
    font-size: 0.83rem;
}

.gms-sidebar .sop-badge {
    margin-left: auto;
    font-size: 0.68rem;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

/* Main Content & Top Header */
.gms-main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.gms-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--wp-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.gms-content {
    flex: 1;
    padding: 1.75rem;
}

/* Institutional Cards */
.card-gms {
    background: #ffffff;
    border: 1px solid var(--wp-gray-200);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-gms-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(26, 96, 183, 0.08);
    border-color: #bfdbfe;
}

.card-header-gms {
    background: #ffffff;
    border-bottom: 1px solid var(--wp-gray-200);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Buttons */
.btn-wp-primary {
    background-color: var(--wp-primary);
    border-color: var(--wp-primary);
    color: #ffffff;
    font-weight: 500;
}

.btn-wp-primary:hover, .btn-wp-primary:focus {
    background-color: var(--wp-primary-hover);
    border-color: var(--wp-primary-hover);
    color: #ffffff;
}

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

.btn-wp-outline:hover {
    background-color: var(--wp-primary);
    color: #ffffff;
}

/* Tables */
.table-gms {
    margin-bottom: 0;
}

.table-gms thead th {
    background: var(--wp-gray-50);
    color: var(--wp-gray-500);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--wp-gray-200);
    padding: 0.75rem 1rem;
}

.table-gms tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--wp-gray-100);
    font-size: 0.88rem;
}

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

/* Badges & Status Pills */
.badge-status {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.badge-draft { background: #f1f5f9; color: #475569; }
.badge-submitted { background: #fef3c7; color: #92400e; }
.badge-l2 { background: #e0f2fe; color: #0369a1; }
.badge-l3 { background: #e0e7ff; color: #4338ca; }
.badge-l4 { background: #fae8ff; color: #86198f; }
.badge-l5 { background: #dcfce7; color: #15803d; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }

/* Filter Tabs / Pills */
.filter-pills .btn {
    border-radius: 20px;
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
    font-weight: 500;
}

/* 5-Tier Circuit Indicator Steps */
.approval-timeline {
    position: relative;
    padding: 1.5rem 0;
}

.step-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    position: relative;
}

.step-item:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 32px;
    left: 15px;
    height: calc(100% - 16px);
    width: 2px;
    background: var(--wp-gray-200);
}

.step-item.step-done:not(:last-child)::before {
    background: var(--wp-success);
}

.step-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--wp-gray-200);
    color: var(--wp-gray-500);
    margin-right: 1rem;
    flex-shrink: 0;
    z-index: 1;
}

.step-item.step-done .step-badge {
    background: var(--wp-success);
    color: #ffffff;
}

.step-item.step-active .step-badge {
    background: var(--wp-primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px var(--wp-primary-light);
}

.step-item.step-rejected .step-badge {
    background: var(--wp-danger);
    color: #ffffff;
}

/* Notification Badge & Bell */
.notification-bell-btn {
    position: relative;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--wp-gray-700);
    padding: 0.4rem;
}

.notification-counter {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.38rem;
    border-radius: 9999px;
    background-color: #ef4444;
    color: #ffffff;
}

/* Language Switcher */
.lang-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wp-gray-700);
    background: var(--wp-gray-100);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid var(--wp-gray-200);
}

.lang-switcher-btn:hover {
    background: #ffffff;
    border-color: var(--wp-primary);
    color: var(--wp-primary);
}

/* SOP Manual Embedded Reader */
.sop-box {
    background: #ffffff;
    border: 1px solid var(--wp-gray-200);
    border-left: 4px solid var(--wp-primary);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sop-box h4 {
    color: var(--wp-primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .gms-sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    .gms-sidebar.show {
        margin-left: 0;
    }
    .gms-main-wrapper {
        margin-left: 0;
    }
}

