/* Bolesca Foodindo - Consolidate Portal BFI (CPB) Design System */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --color-primary: #F40000;           /* Merah Bolesca Food */
    --color-secondary: #0D0E30;         /* Biru Navy */
    --color-background: #EDEDEE;        /* Abu-Abu Terang */
    --color-text-main: #0D0E30;
    --color-text-muted: #65686B;        /* Abu-Abu */
    --color-text-dark: #53565A;         /* Abu-Abu Gelap */
    --color-white: #FFFFFF;
    
    /* Category Colors */
    --color-ops: #F3AF00;              /* Mustard Seed */
    --color-ops-dark: #916600;
    --color-service: #809E9B;          /* Sage */
    --color-service-dark: #506B67;
    --color-security: #EB3C31;         /* Cayenne */
    --color-security-dark: #B02D2A;
    --color-legal: #0D0E30;
    
    /* Status & Alerts */
    --color-success: #2E7D32;          /* Soft Sage Success */
    --color-warning: #F57C00;
    --color-error: #EB3C31;
    
    /* Shadows & Border Radii */
    --shadow-sm: 0 2px 4px rgba(13, 14, 48, 0.05);
    --shadow-md: 0 4px 12px rgba(13, 14, 48, 0.08);
    --shadow-lg: 0 12px 24px rgba(13, 14, 48, 0.12);
    --shadow-hover: 0 16px 32px rgba(13, 14, 48, 0.16);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
}

/* Auth Screens Layout (Login & OTP) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(13, 14, 48, 0.05) 0%, rgba(244, 0, 0, 0.03) 90%), var(--color-background);
    padding: 20px;
}

.auth-container {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 1000px;
    max-width: 100%;
    display: flex;
    overflow: hidden;
    min-height: 600px;
}

.auth-sidebar {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #171954 100%);
    color: var(--color-white);
    width: 45%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(244, 0, 0, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.auth-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-sidebar-brand img {
    height: 48px;
    background: var(--color-white);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.auth-sidebar-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
}

.auth-sidebar-desc {
    color: #A5A7D0;
    font-size: 14px;
}

.auth-sidebar-footer {
    font-size: 12px;
    color: #6D70A6;
}

.auth-form-side {
    width: 55%;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    margin-bottom: 36px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--color-text-muted);
    width: 18px;
    height: 18px;
}

.form-control {
    width: 100%;
    background-color: var(--color-background);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 16px 12px 42px;
    font-size: 14px;
    color: var(--color-secondary);
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-primary);
    background-color: var(--color-white);
    box-shadow: 0 0 0 4px rgba(244, 0, 0, 0.08);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input {
    cursor: pointer;
    accent-color: var(--color-primary);
    width: 16px;
    height: 16px;
}

.forgot-link {
    color: var(--color-primary);
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: #D30000;
    box-shadow: 0 4px 12px rgba(244, 0, 0, 0.25);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.btn-secondary:hover {
    background-color: #171954;
    box-shadow: 0 4px 12px rgba(13, 14, 48, 0.25);
}

.btn-outline {
    border: 2px solid var(--color-background);
    background-color: transparent;
    color: var(--color-secondary);
}

.btn-outline:hover {
    background-color: var(--color-background);
}

.btn-danger {
    background-color: var(--color-security);
    color: var(--color-white);
}

.btn-danger:hover {
    background-color: var(--color-security-dark);
    box-shadow: 0 4px 12px rgba(235, 60, 49, 0.25);
}

/* Segmented OTP Input */
.otp-container {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.otp-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    background-color: var(--color-background);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--color-secondary);
    transition: var(--transition-fast);
}

.otp-input:focus {
    border-color: var(--color-primary);
    background-color: var(--color-white);
    box-shadow: 0 0 0 4px rgba(244, 0, 0, 0.08);
}

.otp-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 24px;
}

.otp-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
}

.otp-timer span {
    font-weight: 700;
    color: var(--color-secondary);
}

.otp-resend-link {
    color: var(--color-primary);
    font-weight: 600;
    background: none;
    cursor: pointer;
}

.otp-resend-link.disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* Alert States */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background-color: rgba(235, 60, 49, 0.1);
    color: var(--color-error);
    border-left: 4px solid var(--color-error);
}

.alert-success {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--color-success);
    border-left: 4px solid var(--color-success);
}

/* Core Dashboard Layout (Header + Content) */
.dashboard-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background-color: transparent !important;
    color: var(--color-white);
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    transition: all 0.3s ease;
}

/* Light Theme Header Overrides */
.theme-light .header {
    border-bottom: 1px solid rgba(13, 14, 48, 0.08);
}
.theme-light .header-brand-text {
    color: var(--color-secondary);
}
.theme-light .nav-link {
    color: #65686B;
}
.theme-light .nav-link:hover, .theme-light .nav-link.active {
    color: var(--color-secondary);
}
.theme-light .user-menu {
    color: var(--color-secondary);
}
.theme-light .user-menu:hover {
    background-color: rgba(13, 14, 48, 0.05);
}
.theme-light .user-dept {
    color: #65686B;
}
.theme-light .user-avatar {
    border-color: var(--color-primary);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand > a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.header-brand img {
    height: 38px;
    background: var(--color-white);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.header-brand-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: #A5A7D0;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-white);
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.user-menu:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--color-primary);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-dept {
    font-size: 11px;
    color: #A5A7D0;
}

/* User Menu Dropdown */
.user-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background-color: var(--color-white);
    color: var(--color-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 220px;
    padding: 8px;
    z-index: 100;
    display: none;
}

.user-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--color-background);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--color-background);
    margin: 8px 0;
}

.main-content {
    flex: 1;
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Landing User Dashboard specific styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-title-section h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-secondary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.dashboard-title-section p {
    color: var(--color-text-muted);
    font-size: 15px;
}

.controls-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-bar {
    position: relative;
    width: 320px;
}

.search-bar input {
    width: 100%;
    background-color: var(--color-white);
    border: 1px solid rgba(13, 14, 48, 0.12);
    border-radius: var(--radius-md);
    padding: 12px 16px 12px 42px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(244, 0, 0, 0.12), var(--shadow-md);
    background-color: var(--color-white);
}

.search-bar svg {
    position: absolute;
    left: 14px;
    top: 15px;
    color: var(--color-text-muted);
    width: 16px;
    height: 16px;
    transition: var(--transition-fast);
}

.search-bar input:focus + svg {
    color: var(--color-primary);
}

.category-tabs {
    display: inline-flex;
    gap: 4px;
    background-color: rgba(13, 14, 48, 0.05);
    padding: 5px;
    border-radius: 100px;
    border: 1px solid rgba(13, 14, 48, 0.03);
}

.tab-btn {
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    background: none;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all 0.25s ease;
}

.tab-btn:hover {
    color: var(--color-secondary);
    background-color: rgba(13, 14, 48, 0.04);
}

.tab-btn.active {
    background-color: var(--color-white);
    color: var(--color-secondary);
    box-shadow: 0 4px 10px rgba(13, 14, 48, 0.08);
}

/* App Grid Cards */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.app-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 12px;
    min-height: 140px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    cursor: pointer;
    
    /* Animation definition */
    animation: fadeInUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Stagger Animation Delays */
.app-card:nth-child(1) { animation-delay: 0.05s; }
.app-card:nth-child(2) { animation-delay: 0.1s; }
.app-card:nth-child(3) { animation-delay: 0.15s; }
.app-card:nth-child(4) { animation-delay: 0.2s; }
.app-card:nth-child(5) { animation-delay: 0.25s; }
.app-card:nth-child(6) { animation-delay: 0.3s; }
.app-card:nth-child(7) { animation-delay: 0.35s; }
.app-card:nth-child(8) { animation-delay: 0.4s; }

.app-card::before {
    display: none;
}

.app-card:hover {
    transform: translateY(-6px) scale(1.05);
}

.app-card-icon {
    width: 88px;
    height: 88px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.app-card:hover .app-card-icon {
    transform: scale(1.1) translateY(-4px);
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 12px 32px rgba(255, 255, 255, 0.22);
}

.app-card-icon img,
.app-card-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-card-icon svg.lucide {
    width: 54px !important;
    height: 54px !important;
}

.app-card-title-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.app-card-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
    line-height: 1.2;
    transition: all 0.3s ease;
}

.app-card:hover .app-card-title {
    text-shadow: 0 4px 12px rgba(255, 255, 255, 0.4);
}

.app-card-category {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.8px;
}

/* ========================================== */
/* Theme Dark (Dynamic Contrast Overrides)     */
/* ========================================== */

.theme-dark {
    color: #ffffff;
}

.theme-dark .dashboard-title-section h1 {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.theme-dark .dashboard-title-section p {
    color: rgba(255, 255, 255, 0.72) !important;
}

.theme-dark .search-bar input {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    backdrop-filter: blur(8px);
}

.theme-dark .search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.theme-dark .search-bar input:focus {
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.theme-dark .search-bar svg {
    color: rgba(255, 255, 255, 0.5) !important;
}

.theme-dark .search-bar input:focus + svg {
    color: #ffffff !important;
}

.theme-dark .category-tabs {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px);
}

.theme-dark .tab-btn {
    color: rgba(255, 255, 255, 0.6) !important;
}

.theme-dark .tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

.theme-dark .tab-btn.active {
    background-color: #ffffff !important;
    color: var(--color-secondary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.theme-dark .app-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.theme-dark .app-card:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.theme-dark .app-card-title {
    color: #ffffff !important;
}

.theme-dark .app-card-icon {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

/* Admin Dashboard layout with Sidebar */
.admin-layout {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    background-color: var(--color-secondary);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    height: 72px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header img {
    height: 34px;
    background: var(--color-white);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.sidebar-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: #A5A7D0;
    transition: var(--transition-fast);
}

.sidebar-item:hover, .sidebar-item.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-white);
}

.sidebar-item.active {
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--color-background);
}

.admin-header {
    background-color: var(--color-white);
    height: 72px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 999;
}

.admin-header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-secondary);
}

.admin-content {
    padding: 40px;
    flex-grow: 1;
    overflow-y: auto;
}

/* Admin Dashboard widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(13, 14, 48, 0.05);
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-secondary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue {
    background-color: rgba(13, 14, 48, 0.08);
    color: var(--color-secondary);
}

.stat-icon.red {
    background-color: rgba(244, 0, 0, 0.08);
    color: var(--color-primary);
}

.stat-icon.yellow {
    background-color: rgba(243, 175, 0, 0.08);
    color: var(--color-ops);
}

.stat-icon.green {
    background-color: rgba(46, 125, 50, 0.08);
    color: var(--color-success);
}

/* Panel Card Container */
.card-panel {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 24px;
    border: 1px solid rgba(13, 14, 48, 0.05);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-background);
    padding-bottom: 16px;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-secondary);
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.table th {
    background-color: var(--color-secondary);
    color: var(--color-white);
    padding: 14px 16px;
    font-weight: 600;
}

.table th:first-child {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.table th:last-child {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-background);
    color: var(--color-text-dark);
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background-color: rgba(13, 14, 48, 0.02);
}

.table tbody tr.zebra {
    background-color: var(--color-background);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--color-success);
}

.badge-danger {
    background-color: rgba(235, 60, 49, 0.1);
    color: var(--color-error);
}

.badge-info {
    background-color: rgba(13, 14, 48, 0.08);
    color: var(--color-secondary);
}

.badge-warning {
    background-color: rgba(243, 175, 0, 0.1);
    color: var(--color-ops-dark);
}

/* Action dropdowns / buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background-color: var(--color-background);
    color: var(--color-secondary);
}

.btn-icon:hover {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.btn-icon.danger:hover {
    background-color: var(--color-error);
    color: var(--color-white);
}

/* Admin forms layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.form-grid-full {
    grid-column: span 2;
}

/* Multi-select check list for group mappings */
.checkbox-grid {
    background-color: var(--color-background);
    border-radius: var(--radius-md);
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item label {
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

/* Search and filters row in table headers */
.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    background-color: var(--color-white);
    border: 1px solid rgba(13, 14, 48, 0.1);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    color: var(--color-secondary);
    cursor: pointer;
}

.filter-input-date {
    background-color: var(--color-white);
    border: 1px solid rgba(13, 14, 48, 0.1);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    color: var(--color-secondary);
}

/* Mock SP Visual Handoff page */
.sp-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    max-width: 700px;
    margin: 40px auto;
    border-top: 8px solid var(--sp-color, var(--color-primary));
}

.sp-header {
    text-align: center;
    margin-bottom: 30px;
}

.sp-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 6px;
}

.sp-subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
}

.token-box {
    background-color: var(--color-secondary);
    color: #4AF626; /* Matrix Green for developers */
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 24px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
    max-height: 150px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Mobile / Tablet Responsive ========== */

/* Horizontal scroll helper for category tabs */
.category-tabs-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 8px;
}
.category-tabs-wrap::-webkit-scrollbar {
    display: none;
}
.category-tabs-wrap .category-tabs {
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
}

@media (max-width: 1024px) {
    .main-content {
        padding: 28px 20px;
    }
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 14px;
    }
    .app-card-icon {
        width: 72px;
        height: 72px;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .auth-container {
        flex-direction: column;
        width: 100%;
        max-width: 500px;
    }
    .auth-sidebar {
        width: 100%;
        padding: 30px;
        min-height: 200px;
    }
    .auth-form-side {
        width: 100%;
        padding: 40px;
    }
    .admin-layout {
        flex-direction: column;
        min-height: 100vh;
    }
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-menu {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 24px 16px;
    }
    .sidebar-item {
        white-space: normal;
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background-color: rgba(13, 14, 48, 0.5);
        backdrop-filter: blur(3px);
        z-index: 1040;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .mobile-sidebar-toggle {
        display: flex !important;
    }
    .admin-header {
        padding: 0 16px;
        height: auto;
        min-height: 64px;
        gap: 8px;
    }
    .admin-header-title {
        font-size: 16px;
        line-height: 1.25;
    }
    .admin-header .ad-sync-pill {
        display: none !important;
    }
    .admin-content {
        padding: 16px;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .form-grid-full {
        grid-column: span 1;
    }

    /* Collapse common inline multi-col admin grids on tablet/phone */
    .card-panel [style*="grid-template-columns: 1fr 1fr"],
    .card-panel [style*="grid-template-columns:1fr 1fr"],
    .admin-content [style*="grid-template-columns: 1fr 1.5fr"],
    .admin-content [style*="grid-template-columns:1fr 1.5fr"],
    .admin-content [style*="grid-template-columns: 1.5fr 1fr"],
    .admin-content [style*="grid-template-columns:1.5fr 1fr"],
    .admin-content [style*="grid-template-columns: 2fr 1fr"],
    .admin-content [style*="grid-template-columns:2fr 1fr"],
    .admin-content [style*="grid-template-columns: 1fr 2fr"],
    .admin-content [style*="grid-template-columns:1fr 2fr"],
    .admin-content [style*="grid-template-columns: 2.1fr 1fr"],
    .admin-content [style*="grid-template-columns:2.1fr 1fr"],
    .admin-content [style*="grid-template-columns: 2fr 1fr 1fr"],
    .admin-content [style*="grid-template-columns:2fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .admin-content table {
        min-width: 640px;
    }

    /* User Portal Dashboard */
    .header {
        padding: 10px 14px;
        height: auto;
        min-height: 60px;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 1000;
        background-color: rgba(255, 255, 255, 0.92) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .theme-dark .header,
    .bg-dark_navy .header,
    .bg-bolesca_crimson .header,
    .bg-emerald_breeze .header,
    .bg-sunset_glow .header,
    .bg-custom_image .header,
    .bg-custom_css .header {
        background-color: rgba(13, 14, 48, 0.88) !important;
    }
    .mobile-nav-toggle {
        display: none !important;
    }
    .header-brand {
        min-width: 0;
        flex: 1;
    }
    .header-brand-text {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 42vw;
    }
    .user-menu {
        padding: 4px 6px;
        gap: 8px;
    }
    .user-info {
        display: none;
    }
    .header-nav {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
    }
    .header-nav .nav-link {
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
    }
    .main-content {
        padding: 20px 14px 32px;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 18px;
    }
    .dashboard-title-section h1 {
        font-size: 24px;
    }
    .dashboard-title-section p {
        font-size: 13.5px;
    }
    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }
    .search-bar {
        width: 100%;
        max-width: none;
    }
    .apps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .app-card {
        min-height: 120px;
        padding: 10px 8px;
        gap: 10px;
    }
    .app-card-icon {
        width: 64px;
        height: 64px;
        border-radius: 14px;
    }
    .app-card-icon svg.lucide {
        width: 36px !important;
        height: 36px !important;
    }
    .app-card-title {
        font-size: 12.5px;
    }
    .app-card:hover {
        transform: none;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -4px;
        padding-bottom: 4px;
    }
    .card-panel {
        padding: 18px 14px;
    }
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .stat-card {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .stat-value {
        font-size: 22px;
    }
    .sp-card {
        width: 100%;
        max-width: 100%;
        margin: 12px;
        padding: 24px 18px;
    }

    /* Profile page */
    .card-panel table td:first-child {
        width: auto !important;
        display: block;
        padding-bottom: 2px !important;
        font-size: 12px;
    }
    .card-panel table td {
        display: block;
        padding: 4px 0 14px !important;
        word-break: break-word;
    }
    .card-panel table tr {
        display: block;
        border-bottom: 1px solid rgba(13, 14, 48, 0.06);
        margin-bottom: 8px;
    }

    .user-dropdown {
        right: 0;
        left: auto;
        min-width: 220px;
        max-width: calc(100vw - 24px);
    }

    .dashboard-wrapper {
        overflow-x: hidden;
        background-attachment: scroll !important;
    }
}

@media (max-width: 480px) {
    .header-brand-text {
        max-width: 38vw;
        font-size: 13.5px;
    }
    .header-brand img {
        height: 32px;
    }
    .dashboard-title-section h1 {
        font-size: 20px;
    }
    .apps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .app-card-icon {
        width: 56px;
        height: 56px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-header .user-info {
        display: none;
    }
    .btn {
        min-height: 44px;
    }
    .tab-btn {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
}

/* CPB Custom Pagination Styles */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: var(--radius-sm);
    gap: 6px;
    margin: 0;
    align-items: center;
}

.page-item {
    display: inline;
}

.page-item .page-link,
.page-item span {
    position: relative;
    display: block;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-secondary);
    background-color: var(--color-white);
    border: 1px solid rgba(13, 14, 48, 0.08);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition-fast);
}

.page-item .page-link:hover {
    background-color: var(--color-background);
    border-color: rgba(13, 14, 48, 0.15);
    color: var(--color-primary);
}

.page-item.active .page-link,
.page-item.active span {
    z-index: 3;
    color: var(--color-white) !important;
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

.page-item.disabled .page-link,
.page-item.disabled span {
    color: var(--color-text-muted);
    pointer-events: none;
    background-color: var(--color-white);
    border-color: rgba(13, 14, 48, 0.04);
    opacity: 0.5;
}

/* High Contrast Font Color Overrides for Dark/Custom Backgrounds in Light Theme */
.bg-dark_navy,
.bg-bolesca_crimson,
.bg-emerald_breeze,
.bg-sunset_glow,
.bg-custom_image,
.bg-custom_css {
    color: #ffffff !important;
}

.bg-dark_navy .dashboard-title-section h1,
.bg-bolesca_crimson .dashboard-title-section h1,
.bg-emerald_breeze .dashboard-title-section h1,
.bg-sunset_glow .dashboard-title-section h1,
.bg-custom_image .dashboard-title-section h1,
.bg-custom_css .dashboard-title-section h1 {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.bg-dark_navy .dashboard-title-section p,
.bg-bolesca_crimson .dashboard-title-section p,
.bg-emerald_breeze .dashboard-title-section p,
.bg-sunset_glow .dashboard-title-section p,
.bg-custom_image .dashboard-title-section p,
.bg-custom_css .dashboard-title-section p {
    color: rgba(255, 255, 255, 0.85) !important;
}

.bg-dark_navy .header-brand-text,
.bg-bolesca_crimson .header-brand-text,
.bg-emerald_breeze .header-brand-text,
.bg-sunset_glow .header-brand-text,
.bg-custom_image .header-brand-text,
.bg-custom_css .header-brand-text {
    color: #ffffff !important;
}

.bg-dark_navy .nav-link,
.bg-bolesca_crimson .nav-link,
.bg-emerald_breeze .nav-link,
.bg-sunset_glow .nav-link,
.bg-custom_image .nav-link,
.bg-custom_css .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
}

.bg-dark_navy .nav-link:hover, .bg-dark_navy .nav-link.active,
.bg-bolesca_crimson .nav-link:hover, .bg-bolesca_crimson .nav-link.active,
.bg-emerald_breeze .nav-link:hover, .bg-emerald_breeze .nav-link.active,
.bg-sunset_glow .nav-link:hover, .bg-sunset_glow .nav-link.active,
.bg-custom_image .nav-link:hover, .bg-custom_image .nav-link.active,
.bg-custom_css .nav-link:hover, .bg-custom_css .nav-link.active {
    color: #ffffff !important;
    font-weight: 600;
}

.bg-dark_navy .user-menu,
.bg-bolesca_crimson .user-menu,
.bg-emerald_breeze .user-menu,
.bg-sunset_glow .user-menu,
.bg-custom_image .user-menu,
.bg-custom_css .user-menu {
    color: #ffffff !important;
}

.bg-dark_navy .user-dept,
.bg-bolesca_crimson .user-dept,
.bg-emerald_breeze .user-dept,
.bg-sunset_glow .user-dept,
.bg-custom_image .user-dept,
.bg-custom_css .user-dept {
    color: rgba(255, 255, 255, 0.75) !important;
}

.bg-dark_navy .search-bar input,
.bg-bolesca_crimson .search-bar input,
.bg-emerald_breeze .search-bar input,
.bg-sunset_glow .search-bar input,
.bg-custom_image .search-bar input,
.bg-custom_css .search-bar input {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(8px);
}

.bg-dark_navy .search-bar input::placeholder,
.bg-bolesca_crimson .search-bar input::placeholder,
.bg-emerald_breeze .search-bar input::placeholder,
.bg-sunset_glow .search-bar input::placeholder,
.bg-custom_image .search-bar input::placeholder,
.bg-custom_css .search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.bg-dark_navy .search-bar svg,
.bg-bolesca_crimson .search-bar svg,
.bg-emerald_breeze .search-bar svg,
.bg-sunset_glow .search-bar svg,
.bg-custom_image .search-bar svg,
.bg-custom_css .search-bar svg {
    color: rgba(255, 255, 255, 0.6) !important;
}

.bg-dark_navy .category-tabs,
.bg-bolesca_crimson .category-tabs,
.bg-emerald_breeze .category-tabs,
.bg-sunset_glow .category-tabs,
.bg-custom_image .category-tabs,
.bg-custom_css .category-tabs {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(8px);
}

.bg-dark_navy .tab-btn,
.bg-bolesca_crimson .tab-btn,
.bg-emerald_breeze .tab-btn,
.bg-sunset_glow .tab-btn,
.bg-custom_image .tab-btn,
.bg-custom_css .tab-btn {
    color: rgba(255, 255, 255, 0.75) !important;
}

.bg-dark_navy .tab-btn:hover,
.bg-bolesca_crimson .tab-btn:hover,
.bg-emerald_breeze .tab-btn:hover,
.bg-sunset_glow .tab-btn:hover,
.bg-custom_image .tab-btn:hover,
.bg-custom_css .tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

.bg-dark_navy .tab-btn.active,
.bg-bolesca_crimson .tab-btn.active,
.bg-emerald_breeze .tab-btn.active,
.bg-sunset_glow .tab-btn.active,
.bg-custom_image .tab-btn.active,
.bg-custom_css .tab-btn.active {
    background-color: #ffffff !important;
    color: var(--color-secondary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}
