/* =========================================================
   MDGIF STAFF SHELL — Modern Navigation Styles
   ========================================================= */

:root {
    --shell-primary: #073E23;
    --shell-primary-light: #0B6B3A;
    --shell-primary-soft: #E8F5EE;
    --shell-accent: #F59E0B;
    --shell-accent-gold: #EAB308;
    --shell-sidebar-bg: #073E23;
    --shell-sidebar-bg-2: #052F1A;
    --shell-sidebar-text: #D1E7DD;
    --shell-sidebar-text-active: #FFFFFF;
    --shell-sidebar-hover: rgba(255, 255, 255, 0.08);
    --shell-sidebar-active: rgba(255, 255, 255, 0.14);
    --shell-border: #E2E8F0;
    --shell-surface: #FFFFFF;
    --shell-surface-muted: #F8FAFC;
    --shell-text: #0F172A;
    --shell-text-muted: #64748B;
    --shell-radius: 12px;
    --shell-radius-sm: 8px;
    --shell-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shell-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shell-shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.08);
}

/* =========================================================
   APP SHELL
   ========================================================= */
.app-shell {
    background: var(--shell-surface-muted);
    min-height: 100vh;
}

.app-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--shell-surface-muted);
    color: var(--shell-text-muted);
    gap: 16px;
}

.app-loading-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid var(--shell-primary-soft);
    border-top-color: var(--shell-primary);
    border-radius: 50%;
    animation: shell-spin 0.9s linear infinite;
}

@keyframes shell-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   TOPBAR
   ========================================================= */
.navbar-custom {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--shell-border);
    padding: 0;
    min-height: 62px;
    box-shadow: var(--shell-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-custom .topbar {
    min-height: 62px;
    padding: 0 20px;
}

/* =========================================================
   LOGO
   ========================================================= */
.logo-topbar .logo-light,
.logo-topbar .logo-dark {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-topbar img {
    max-height: 28px;
    width: auto;
}

/* =========================================================
   MENU TOGGLE BUTTON
   ========================================================= */
.button-toggle-menu {
    border: none;
    background: transparent;
    color: var(--shell-text);
    width: 38px;
    height: 38px;
    border-radius: var(--shell-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.15s ease;
}

.button-toggle-menu:hover {
    background: var(--shell-primary-soft);
    color: var(--shell-primary);
}

/* =========================================================
   SEARCH
   ========================================================= */
.app-search .search-form {
    position: relative;
}

.app-search .search-form input {
    height: 40px;
    padding: 8px 16px 8px 42px;
    background: var(--shell-surface-muted);
    border: 1px solid var(--shell-border);
    border-radius: 999px;
    width: 320px;
    font-size: 13.5px;
    transition: all 0.18s ease;
}

.app-search .search-form input:focus {
    outline: none;
    border-color: var(--shell-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(11, 107, 58, 0.12);
    width: 360px;
}

.app-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--shell-text-muted);
    pointer-events: none;
    font-size: 15px;
}

/* =========================================================
   TOPBAR ICON BUTTONS
   ========================================================= */
.topbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.topbar-menu .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--shell-radius-sm);
    color: var(--shell-text-muted);
    font-size: 20px;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.topbar-menu .icon-btn:hover {
    background: var(--shell-primary-soft);
    color: var(--shell-primary);
}

.topbar-menu .noti-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #DC2626;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* =========================================================
   USER CHIP
   ========================================================= */
.user-chip {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px !important;
    border-radius: 999px;
    text-decoration: none !important;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.user-chip:hover {
    background: var(--shell-primary-soft);
    border-color: var(--shell-primary-soft);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--shell-primary), var(--shell-primary-light));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.user-meta {
    line-height: 1.15;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--shell-text);
}

.user-role {
    font-size: 11px;
    color: var(--shell-text-muted);
    font-weight: 500;
}

.user-caret {
    font-size: 16px;
    color: var(--shell-text-muted);
}

/* =========================================================
   DROPDOWN
   ========================================================= */
.dropdown-menu.profile-dropdown {
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius);
    box-shadow: var(--shell-shadow-lg);
    padding: 6px;
    min-width: 240px;
    margin-top: 8px !important;
}

.dropdown-menu.profile-dropdown .dropdown-header {
    padding: 10px 14px;
    font-size: 12px;
    color: var(--shell-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--shell-border);
    margin-bottom: 4px;
}

.dropdown-menu.profile-dropdown .dropdown-item {
    border-radius: var(--shell-radius-sm);
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--shell-text);
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.12s ease;
}

.dropdown-menu.profile-dropdown .dropdown-item:hover {
    background: var(--shell-primary-soft);
    color: var(--shell-primary);
}

.dropdown-menu.profile-dropdown .dropdown-item.text-danger:hover {
    background: #FEF2F2;
    color: #B91C1C;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.leftside-menu,
html[data-menu-color] .leftside-menu,
[data-bs-theme="dark"] .leftside-menu {
    background: linear-gradient(180deg, #073E23 0%, #052F1A 100%) !important;
    background-color: #073E23 !important;
    color: var(--shell-sidebar-text);
    width: 260px;
    transition: width 0.25s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 24px rgba(7, 62, 35, 0.25);
}

/* =========================================================
   SIDEBAR BRAND
   ========================================================= */
.leftside-menu .logo-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    /* padding: 22px 16px 18px !important; */
    min-height: auto !important;
    height: auto !important;
    line-height: normal !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    text-decoration: none !important;
    text-align: center !important;
}

.leftside-menu .brand-crest-wrap {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(234, 179, 8, 0.7);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    /* margin-bottom: 10px; */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leftside-menu .brand-crest-wrap:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(234, 179, 8, 0.35);
}

.leftside-menu .brand-crest-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.leftside-menu .brand-title-text {
    color: #FFFFFF;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1.2px;
    line-height: 1.1;
    margin: 0;
}

.leftside-menu .brand-subtitle-text {
    color: #D1E7DD;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    line-height: 1.35;
    margin-top: 5px;
    max-width: 220px;
    opacity: 0.9;
}

/* =========================================================
   SIDEBAR USER CARD
   ========================================================= */
.leftbar-user {
    padding: 16px 14px 8px;
}

.leftbar-user .user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--shell-radius);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-decoration: none;
    transition: all 0.15s ease;
    backdrop-filter: blur(4px);
}

.leftbar-user .user-card:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

.user-avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFFFFF;
    color: #0B6B3A;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.user-card-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    overflow: hidden;
}

.user-card-name {
    color: #fff;
    font-weight: 700;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-role {
    color: var(--shell-sidebar-text);
    font-size: 11.5px;
    opacity: 0.85;
}

/* =========================================================
   SIDEBAR MENU
   ========================================================= */
.leftside-menu .side-nav {
    padding: 8px 12px 24px;
    list-style: none;
    margin: 0;
}

/* Section title */
.leftside-menu .side-nav-title {
    color: var(--shell-sidebar-text);
    text-transform: uppercase;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    opacity: 0.75;
    padding: 20px 14px 8px;
}

/* Top-level nav item */
.leftside-menu .side-nav-item>.side-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--shell-radius-sm);
    color: var(--shell-sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.15s ease;
    position: relative;
    margin-bottom: 2px;
}

.leftside-menu .side-nav-item>.side-nav-link:hover {
    background: var(--shell-sidebar-hover);
    color: #fff;
}

.leftside-menu .side-nav-item>.side-nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Active parent */
.leftside-menu .side-nav-item.active>.side-nav-link {
    background: var(--shell-sidebar-active);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.leftside-menu .side-nav-item.active>.side-nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    background: var(--shell-accent);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

/* Menu arrow */
.leftside-menu .side-nav-link .menu-arrow {
    display: inline-block;
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    opacity: 0.75;
    font-size: 0;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Menu arrow open (facing downward) */
.leftside-menu .side-nav-link[aria-expanded="true"] .menu-arrow,
.leftside-menu .side-nav-item.active>.side-nav-link .menu-arrow,
.leftside-menu .side-nav-item:has(.collapse.show)>.side-nav-link .menu-arrow,
.leftside-menu .side-nav-item:has(.collapsing)>.side-nav-link .menu-arrow,
.leftside-menu .side-nav-link:not(.collapsed)[data-bs-toggle="collapse"] .menu-arrow,
.leftside-menu .side-nav-item>a:not(.collapsed)[data-bs-toggle="collapse"] .menu-arrow {
    transform: rotate(45deg) !important;
    opacity: 1;
}

/* Explicitly closed menu arrow */
.leftside-menu .side-nav-link.collapsed .menu-arrow,
.leftside-menu .side-nav-link[aria-expanded="false"].collapsed .menu-arrow {
    transform: rotate(-45deg) !important;
    opacity: 0.75;
}


/* Submenu */
.leftside-menu .side-nav-second-level {
    list-style: none;
    padding: 4px 0 4px 20px;
    margin: 0;
    position: relative;
}

.leftside-menu .side-nav-second-level::before {
    content: "";
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.leftside-menu .side-nav-second-level .side-nav-link {
    display: block;
    padding: 8px 14px 8px 24px;
    border-radius: var(--shell-radius-sm);
    color: var(--shell-sidebar-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
    margin-bottom: 1px;
}

.leftside-menu .side-nav-second-level .side-nav-link::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: all 0.15s ease;
}

.leftside-menu .side-nav-second-level .side-nav-link:hover {
    background: var(--shell-sidebar-hover);
    color: #fff;
}

.leftside-menu .side-nav-second-level .side-nav-link:hover::before {
    background: var(--shell-accent);
}

.leftside-menu .side-nav-second-level .side-nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    font-weight: 700;
    border-left: 3.5px solid #F59E0B;
    padding-left: 20px;
}

.leftside-menu .side-nav-second-level .side-nav-link.active::before {
    background: #F59E0B;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
}

.menu-badge-yellow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #EAB308;
    color: #0F172A;
    font-weight: 800;
    font-size: 11px;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 999px;
    margin-left: auto;
    box-shadow: 0 2px 6px rgba(234, 179, 8, 0.4);
}

.sidebar-bottom-nav {
    margin-top: auto;
    padding: 16px 12px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    list-style: none;
    margin-bottom: 0;
}

.sidebar-bottom-nav .side-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--shell-radius-sm);
    color: var(--shell-sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    cursor: pointer;
}

.sidebar-bottom-nav .side-nav-link:hover {
    background: var(--shell-sidebar-hover);
    color: #fff;
}

/* Danger / Logout link contrast */
.leftside-menu .side-nav-item>.side-nav-link.text-danger {
    color: #FCA5A5 !important;
}

.leftside-menu .side-nav-item>.side-nav-link.text-danger:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #fff !important;
}

/* =========================================================
   HOVER / CLOSE BUTTONS
   ========================================================= */
.button-sm-hover,
.button-close-fullsidebar {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    color: var(--shell-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shell-shadow-md);
    transition: all 0.15s ease;
    z-index: 10;
}

.button-sm-hover {
    top: 76px;
    right: -13px;
    border: 1px solid var(--shell-border);
}

.button-close-fullsidebar {
    top: 20px;
    right: 16px;
    background: transparent;
    color: var(--shell-sidebar-text);
    box-shadow: none;
}

.button-close-fullsidebar:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.button-sm-hover:hover {
    background: var(--shell-primary);
    color: #fff;
    border-color: var(--shell-primary);
}

/* =========================================================
   DARK MODE OVERRIDES
   ========================================================= */
[data-bs-theme="dark"] .navbar-custom {
    background: rgba(15, 23, 42, 0.85);
    border-color: #1E293B;
}

[data-bs-theme="dark"] .app-shell {
    background: #0F172A;
}

[data-bs-theme="dark"] .user-name {
    color: #F1F5F9;
}


/* =========================================================
   STAFF DASHBOARD — Modern Styles
   ========================================================= */

/* Reuse of design tokens (assumes staff-shell.css is loaded) */
:root {
    --brand-primary: #0B6B3A;
    --brand-primary-light: #128C52;
    --brand-primary-soft: #E8F5EE;
    --brand-accent: #F59E0B;
    --brand-accent-soft: #FEF3C7;
    --surface: #FFFFFF;
    --surface-muted: #F8FAFC;
    --surface-subtle: #F1F5F9;
    --border: #E2E8F0;
    --border-soft: #EEF2F7;
    --text-strong: #0F172A;
    --text-muted: #64748B;
    --text-soft: #94A3B8;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.08);
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* =========================================================
   HERO
   ========================================================= */
.dash-hero {
    background: linear-gradient(135deg, #0B6B3A 0%, #128C52 60%, #16A34A 100%);
    border-radius: var(--radius-lg);
    padding: 26px 30px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.dash-hero::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
    border-radius: 50%;
}

.dash-hero::after {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.18), transparent 70%);
    border-radius: 50%;
}

.dash-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #E8F5EE;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.dash-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin: 0 0 6px;
    color: #fff;
}

.dash-subtitle {
    font-size: 14px;
    color: #D1FAE5;
    margin: 0;
}

/* Inline input on hero */
.dash-input {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px 14px;
    color: #fff;
    height: 40px;
}

.dash-input i {
    font-size: 18px;
    opacity: 0.85;
}

.dash-input input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    width: 170px;
}

.dash-input input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Hero button */
.dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 10px;
    height: 40px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.dash-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    transform: translateY(-1px);
}

.dash-btn i {
    font-size: 16px;
}

/* =========================================================
   STAT CARDS
   ========================================================= */
.stat-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 22px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    overflow: hidden;
    height: 100%;
}

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

.stat-card .stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    color: #fff;
}

.stat-card .stat-body {
    flex: 1;
    position: relative;
    z-index: 1;
}

.stat-card .stat-label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-soft);
    font-weight: 700;
    margin-bottom: 6px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1.1;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.stat-card .stat-trend {
    font-size: 12px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-card .stat-trend i {
    font-size: 13px;
}

.stat-card .stat-deco {
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.06;
    z-index: 0;
}

/* Variants */
.stat-card.stat-primary .stat-icon-wrap {
    background: linear-gradient(135deg, #0B6B3A, #16A34A);
    box-shadow: 0 6px 14px rgba(11, 107, 58, 0.25);
}

.stat-card.stat-primary .stat-deco {
    background: #0B6B3A;
}

.stat-card.stat-info .stat-icon-wrap {
    background: linear-gradient(135deg, #0369A1, #0EA5E9);
    box-shadow: 0 6px 14px rgba(2, 132, 199, 0.25);
}

.stat-card.stat-info .stat-deco {
    background: #0284C7;
}

.stat-card.stat-success .stat-icon-wrap {
    background: linear-gradient(135deg, #15803D, #22C55E);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.25);
}

.stat-card.stat-success .stat-deco {
    background: #16A34A;
}

.stat-card.stat-warning .stat-icon-wrap {
    background: linear-gradient(135deg, #B45309, #F59E0B);
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.28);
}

.stat-card.stat-warning .stat-deco {
    background: #F59E0B;
}

/* =========================================================
   MODERN CARD + TABLE HEADER
   ========================================================= */
.modern-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface-muted);
    flex-wrap: wrap;
    gap: 12px;
}

.section-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.table-card-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-strong);
}

.table-card-header p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.btn-view-all:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}

/* =========================================================
   DATA TABLE
   ========================================================= */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

.data-table thead th {
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-strong);
    vertical-align: middle;
}

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

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

.data-table tbody tr:hover {
    background: #FAFBFD;
}

/* Row details */
.date-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.date-cell i {
    font-size: 15px;
    color: var(--text-soft);
}

.ref-link {
    color: var(--brand-primary);
    font-weight: 700;
    text-decoration: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    padding: 3px 8px;
    background: var(--brand-primary-soft);
    border-radius: 6px;
    transition: all 0.15s ease;
}

.ref-link:hover {
    background: var(--brand-primary);
    color: #fff;
}

.company-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.company-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0B6B3A, #16A34A);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.text-truncate-cell {
    display: inline-block;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
    font-weight: 500;
}

/* =========================================================
   STATUS PILL
   ========================================================= */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.status-pill.bg-success {
    background: #DCFCE7 !important;
    color: #166534 !important;
}

.status-pill.bg-secondary {
    background: #F1F5F9 !important;
    color: #475569 !important;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 9px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-modern i {
    font-size: 15px;
}

.btn-modern.btn-primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.btn-modern.btn-primary:hover {
    background: #095A31;
    box-shadow: 0 6px 14px rgba(11, 107, 58, 0.25);
    transform: translateY(-1px);
    color: #fff;
}

.btn-modern.btn-outline {
    background: #fff;
    border-color: var(--border);
    color: var(--text-strong);
}

.btn-modern.btn-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
}

.btn-modern.btn-sm-icon {
    padding: 6px 12px;
    font-size: 12.5px;
}

/* =========================================================
   LOADING SPINNER
   ========================================================= */
.app-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--brand-primary-soft);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: dash-spin 0.9s linear infinite;
}

@keyframes dash-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .dash-hero {
        padding: 20px;
    }

    .dash-title {
        font-size: 20px;
    }

    .dash-input input {
        width: 130px;
    }

    .table-card-header {
        padding: 16px;
    }

    .text-truncate-cell {
        max-width: 140px;
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 991.98px) {
    .app-search .search-form input {
        width: 220px;
    }

    .app-search .search-form input:focus {
        width: 240px;
    }
}

@media (max-width: 767.98px) {
    .navbar-custom .topbar {
        padding: 0 12px;
    }

    .leftside-menu {
        width: 100%;
    }
}

/* =========================================================
   TEMPLATE DESIGN STANDARDS — APPLICATION REVIEW & DETAILS
   ========================================================= */

/* Header controls */
.page-main-title {
    font-size: 24px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.4px;
}

.page-main-sub {
    font-size: 13px;
    color: #64748B;
    font-weight: 500;
}

.btn-header-back {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #1E293B;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-header-back:hover {
    background: #F8FAFC;
    border-color: #94A3B8;
    color: #0F172A;
}

.btn-header-actions {
    background: #0B6B3A !important;
    border: 1px solid #0B6B3A !important;
    color: #FFFFFF !important;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(11, 107, 58, 0.25);
}

.btn-header-actions:hover {
    background: #095A31 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(11, 107, 58, 0.35);
}

/* =========================================================
   HERO BANNER (Refinery photo + Deep Green + Diagonal Gold Slash)
   ========================================================= */
.app-hero-template {
    position: relative;
    border-radius: 14px;
    padding: 28px 32px 22px;
    color: #FFFFFF;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(7, 62, 35, 0.22);
    background-color: #073E23;
    background-image:
        linear-gradient(125deg, transparent 65%, rgba(245, 158, 11, 0.20) 73%, rgba(234, 179, 8, 0.75) 74.5%, rgba(234, 179, 8, 0.9) 75.8%, transparent 77.5%),
        linear-gradient(90deg, rgba(7, 62, 35, 0.95) 0%, rgba(7, 62, 35, 0.88) 55%, rgba(7, 62, 35, 0.72) 100%),
        url('/assets/images/Refinery6.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-eyebrow-yellow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EAB308;
    color: #0F172A;
    font-weight: 800;
    font-size: 11.5px;
    letter-spacing: 0.4px;
    padding: 4px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(234, 179, 8, 0.35);
}

.hero-project-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin: 0 0 6px;
    color: #FFFFFF;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.hero-company-name {
    font-size: 15px;
    color: #E2E8F0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Glass info card top right */
.hero-meta-glass {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 12px 18px;
    color: #FFFFFF;
    min-width: 220px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.meta-glass-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.meta-glass-ref {
    font-size: 15px;
    font-weight: 800;
    color: #FFFFFF;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    margin: 2px 0 8px;
}

.meta-glass-date {
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 6px;
}

/* =========================================================
   HORIZONTAL WORKFLOW STEPPER (6 Stages)
   ========================================================= */
.hero-stepper-wrap {
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-stepper {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    padding: 6px 0;
}

.hero-stepper::before {
    content: "";
    position: absolute;
    top: 24px;
    left: 30px;
    right: 30px;
    height: 3px;
    background: rgba(255, 255, 255, 0.22);
    z-index: 1;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 65px;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    margin-top: 7px;
    line-height: 1.2;
    max-width: 100px;
}

.step-sublabel {
    font-size: 9.5px;
    margin-top: 2px;
    opacity: 0.8;
}

/* Completed stage */
.step-item.step-completed .step-circle {
    background: #16A34A;
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(22, 163, 74, 0.6);
}

.step-item.step-completed .step-label {
    color: #FFFFFF;
}

/* Active stage */
.step-item.step-active .step-circle {
    background: rgba(7, 62, 35, 0.95);
    border: 2.5px solid #EAB308;
    color: #EAB308;
    box-shadow: 0 0 14px rgba(234, 179, 8, 0.85);
    transform: scale(1.08);
}

.step-item.step-active .step-label {
    color: #FACC15;
    font-weight: 800;
}

.step-item.step-active .step-sublabel {
    color: #FDE047;
    font-weight: 700;
}

/* Pending stage */
.step-item.step-pending .step-circle {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.65);
}

.step-item.step-pending .step-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Stage Meta Strip on Hero Right */
.hero-stage-meta {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 12px 18px;
    color: #FFFFFF;
}

.stage-meta-item {
    flex: 1;
}

.stage-meta-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    margin-bottom: 2px;
}

.stage-meta-value {
    font-size: 13.5px;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stage-meta-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.16);
}

/* =========================================================
   TWO-COLUMN CARDS & TILES
   ========================================================= */
.card-custom {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.card-custom-header {
    padding: 16px 20px;
    border-bottom: 1px solid #EEF2F7;
    background: #FFFFFF;
}

.badge-icon-green {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #0B6B3A;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.card-custom-title {
    font-size: 15px;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
}

.card-custom-sub {
    font-size: 12px;
    color: #64748B;
    margin-top: 1px;
}

/* Project Overview Details */
.project-overview-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.project-overview-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 0;
}

/* Key Information Tiles */
.key-info-tile {
    background: #F8FAFC;
    border: 1px solid #EEF2F6;
    border-radius: 10px;
    padding: 12px 14px;
    height: 100%;
    transition: all 0.15s ease;
}

.key-info-tile:hover {
    background: #FFFFFF;
    border-color: #CBD5E1;
}

.key-info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    font-weight: 700;
    margin-bottom: 4px;
}

.key-info-value {
    font-size: 13.5px;
    font-weight: 700;
    color: #0F172A;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #EAB308;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
}

.badge-priority-yellow {
    background: #FEF3C7;
    color: #92400E;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    display: inline-block;
}

/* Tabs */
.template-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #E2E8F0;
    padding-bottom: 2px;
    overflow-x: auto;
}

.template-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: #64748B;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.template-tab-btn:hover {
    color: #0B6B3A;
}

.template-tab-btn.active {
    color: #0B6B3A;
    border-bottom-color: #0B6B3A;
    font-weight: 700;
}

/* =========================================================
   QUICK ACTIONS BUTTONS
   ========================================================= */
.btn-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    transition: all 0.18s ease;
    cursor: pointer;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #FFFFFF;
}

.btn-action-green {
    background: #16A34A !important;
    color: #FFFFFF !important;
}

.btn-action-green:hover {
    background: #15803D !important;
}

.btn-action-blue {
    background: #2563EB !important;
    color: #FFFFFF !important;
}

.btn-action-blue:hover {
    background: #1D4ED8 !important;
}

.btn-action-amber {
    background: #F59E0B !important;
    color: #FFFFFF !important;
}

.btn-action-amber:hover {
    background: #D97706 !important;
}

.btn-action-purple {
    background: #7C3AED !important;
    color: #FFFFFF !important;
}

.btn-action-purple:hover {
    background: #6D28D9 !important;
}

.btn-action-cyan {
    background: #0284C7 !important;
    color: #FFFFFF !important;
}

.btn-action-cyan:hover {
    background: #0369A1 !important;
}

.btn-action-outline-red {
    background: #FFFFFF !important;
    border: 1.5px solid #DC2626 !important;
    color: #DC2626 !important;
}

.btn-action-outline-red:hover {
    background: #FEF2F2 !important;
    color: #B91C1C !important;
}

/* =========================================================
   VERTICAL TIMELINE
   ========================================================= */
.template-timeline {
    position: relative;
    padding-left: 28px;
}

.template-timeline::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: #E2E8F0;
}

.timeline-step-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-step-item:last-child {
    margin-bottom: 0;
}

.timeline-node {
    position: absolute;
    left: -28px;
    top: 1px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 2;
}

.timeline-node.node-completed {
    background: #16A34A;
    color: #FFFFFF;
}

.timeline-node.node-current {
    background: #FEF08A;
    border: 2.5px solid #EAB308;
    color: #854D0E;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

.timeline-node.node-pending {
    background: #E2E8F0;
    color: #94A3B8;
}

.timeline-title {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
}

.timeline-time {
    font-size: 11px;
    color: #64748B;
    margin-top: 1px;
}

.badge-current-pill {
    background: #FEF08A;
    color: #854D0E;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: 6px;
    display: inline-block;
}