/* 
 * DUGSI KAAB Global Theme CSS
 * Powered by Plus Jakarta Sans & Inter
 */

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

:root {
    /* Color defaults (overridden dynamically via head.php) */
    --primary: #0B6E6E;
    --primary-rgb: 11, 110, 110;
    --accent: #E85D4C;
    --sidebar-bg: #ffffff;
    --sidebar-bg-rgb: 255, 255, 255;
    
    /* Premium Palette Variables */
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #f1f5f9;
    --border-hover: #cbd5e1;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    /* Premium Soft Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.08);

    /* Animation Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Styling */
body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--light-bg) !important;
    color: var(--text);
    line-height: 1.6;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* Rounded Cards */
.card, .card-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover, .card-box:hover {
    transform: none;
    box-shadow: var(--shadow-sm) !important;
}

/* Modern Input Controls */
.form-control, .form-select {
    font-family: 'Inter', sans-serif;
    font-size: 0.925rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: var(--text);
    transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Floating label design override if used */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary);
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Sleek Buttons */
.btn {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: 12px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.25);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: rgba(var(--primary-rgb), 0.95);
    border-color: rgba(var(--primary-rgb), 0.95);
    transform: none;
    box-shadow: none;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

/* Sidebar Custom Styling */
.sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar .nav-link {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    margin: 0.2rem 0.8rem;
    padding: 0.7rem 1rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.sidebar .nav-link.active,
.sidebar .nav-link.active:hover {
    color: #ffffff;
    background-color: var(--primary) !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

/* Dropdown menus in Sidebar */
.sidebar .submenu {
    padding-left: 0;
    margin-left: 1.5rem !important;
    margin-right: 0.8rem !important;
}

.sidebar .submenu .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    margin: 0.1rem 0;
}

.sidebar .rotate-icon {
    transition: transform var(--transition-normal);
}

.sidebar .rotate-icon.rotate {
    transform: rotate(180deg);
}

/* Modern Header Top Bar */
.topbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.8rem 2rem !important;
    z-index: 90;
}

.topbar .toggle-btn {
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.topbar .toggle-btn:hover {
    background: #f1f5f9;
}

/* Modern Profile box */
.profile {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-pill);
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: all var(--transition-fast);
}

.profile:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

/* Glassmorphism Notification and Profile Dropdown */
.dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    padding: 0.5rem !important;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.6rem 1rem !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background-color: #f1f5f9 !important;
    color: var(--primary) !important;
    transform: translateX(2px);
}

/* Table Enhancements */
.table {
    border-collapse: separate;
    border-spacing: 0 0.4rem;
}

.table thead th {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
}

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

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

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

/* Pulse Animation for active indicators */
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Visual Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Timeline registration steps indicators */
.step-progressbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.step-progressbar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e2e8f0;
    z-index: 1;
    transform: translateY(-50%);
}

.step-progress-line {
    position: absolute;
    top: 50%;
    left: 0;
    height: 2px;
    background-color: var(--primary);
    z-index: 1;
    transform: translateY(-50%);
    transition: width var(--transition-normal);
}

.step-node {
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.step-node.active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

.step-node.completed {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* Modern Scrollbar styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Alert Boxes */
.alert {
    border-radius: var(--radius-md) !important;
    border: none;
    box-shadow: var(--shadow-sm);
}

/* Translucent Icon Badges and Hover Animations for Stats Card */
.bg-primary-subtle {
    background-color: rgba(var(--primary-rgb), 0.1) !important;
    color: var(--primary) !important;
}
.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
}
.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #f59e0b !important;
}
.bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.1) !important;
    color: #06b6d4 !important;
}

.card:hover .bg-primary-subtle i,
.card:hover .bg-success-subtle i,
.card:hover .bg-warning-subtle i,
.card:hover .bg-info-subtle i {
    transform: scale(1.15) rotate(5deg);
}

.bg-primary-subtle i,
.bg-success-subtle i,
.bg-warning-subtle i,
.bg-info-subtle i {
    transition: transform var(--transition-normal);
    display: inline-block;
}

/* ============================================================
   GLOBAL PAGE COMPONENT LIBRARY
   Auto-applies to every view using .content wrapper
   ============================================================ */

/* --- Page Header Block --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header-left h4,
.page-header-left h5 {
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.page-header-left p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.page-header-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* --- Filter Panel --- */
.filter-panel {
    background: #ffffff;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm) !important;
}

.filter-panel .form-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

/* --- Enhanced Table Head --- */
.table thead tr th {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
    border-bottom: 2px solid var(--border-color) !important;
    padding: 0.9rem 1rem !important;
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--primary-rgb), 0.03) !important;
}

/* Override table-light dark bg */
.table-light { background-color: transparent !important; }
thead.table-light th { background-color: transparent !important; }

/* --- Soft Badge Variants --- */
.badge-soft-primary   { background: rgba(var(--primary-rgb), 0.1); color: var(--primary); }
.badge-soft-success   { background: rgba(16,185,129,0.12); color: #059669; }
.badge-soft-danger    { background: rgba(239,68,68,0.12);  color: #dc2626; }
.badge-soft-warning   { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-soft-info      { background: rgba(6,182,212,0.12);  color: #0891b2; }
.badge-soft-secondary { background: rgba(100,116,139,0.1); color: #475569; }

.badge-soft-primary, .badge-soft-success, .badge-soft-danger,
.badge-soft-warning, .badge-soft-info, .badge-soft-secondary {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.8em;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
}

/* --- Modal Enhancements --- */
.modal-content {
    border: none !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: 0 32px 64px rgba(0,0,0,0.12) !important;
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.25rem 1.5rem !important;
    background: #fafbfc;
}

.modal-header .modal-title {
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
}

.modal-body {
    padding: 1.5rem !important;
}

.modal-footer {
    padding: 1rem 1.5rem !important;
    border-top: 1px solid var(--border-color) !important;
    background: #fafbfc;
}

.modal.fade .modal-dialog {
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

/* --- Empty State --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    background: var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.75rem;
    color: var(--text-muted);
}

.empty-state h5 {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 280px;
    margin: 0 auto;
}

/* --- Loading Skeleton Shimmer --- */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}
.skeleton-row {
    height: 52px;
    border-radius: var(--radius-md);
    margin-bottom: 6px;
}

/* --- Enhanced Pagination --- */
.pagination .page-link {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.45rem 0.85rem;
    margin: 0 2px;
    transition: all var(--transition-fast);
}

.pagination .page-link:hover {
    background: rgba(var(--primary-rgb), 0.06);
    border-color: var(--primary) !important;
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.25);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
}

/* --- List Group Item Enhancement --- */
.list-group-item {
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1rem 1.25rem !important;
    transition: background var(--transition-fast);
}

.list-group-item:last-child {
    border-bottom: none !important;
}

.list-group-item:hover {
    background-color: rgba(var(--primary-rgb), 0.03) !important;
}

.list-group-item.unread {
    background-color: rgba(var(--primary-rgb), 0.04) !important;
    border-left: 3px solid var(--primary) !important;
}

/* --- Section Title Divider --- */
.section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* --- Mobile Sticky Action Row --- */
.action-row {
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    z-index: 100;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* --- Avatar Initials --- */
.avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* --- Content Area Padding Refinement --- */
.content {
    padding: 1.75rem 2rem !important;
}

@media (max-width: 768px) {
    .content { padding: 1rem !important; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn { flex: 1; justify-content: center; }
}

/* --- Status Indicator Dots --- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.active   { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.status-dot.inactive { background: var(--text-muted); }
.status-dot.pending  { background: var(--warning); box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }

/* --- Card with Left Accent Border --- */
.card-accent-primary { border-left: 4px solid var(--primary) !important; }
.card-accent-success { border-left: 4px solid var(--success) !important; }
.card-accent-warning { border-left: 4px solid var(--warning) !important; }
.card-accent-danger  { border-left: 4px solid var(--danger) !important; }
.card-accent-info    { border-left: 4px solid var(--info) !important; }

/* --- Subscription Plan Card --- */
.plan-card {
    border-radius: var(--radius-xl) !important;
    border: 2px solid var(--border-color) !important;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.plan-card:hover,
.plan-card.selected {
    border-color: var(--primary) !important;
    box-shadow: 0 8px 30px rgba(var(--primary-rgb), 0.15) !important;
    transform: translateY(-4px);
}

.plan-card.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.9rem;
    border-bottom-left-radius: var(--radius-md);
    letter-spacing: 0.05em;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1;
}

.plan-price sup {
    font-size: 1.1rem;
    font-weight: 600;
    vertical-align: top;
    margin-top: 0.5rem;
    display: inline-block;
}

.plan-feature {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
}

.plan-feature i.bi-check-lg { color: var(--success); font-weight: 800; }
.plan-feature i.bi-x-lg     { color: var(--text-muted); }

/* --- Glow CTA Button --- */
.btn-glow {
    animation: glowPulse 2.5s infinite;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25); }
    50%       { box-shadow: 0 4px 24px rgba(var(--primary-rgb), 0.5); }
}

/* --- Notification Item Overrides --- */
.notif-item {
    transition: background-color var(--transition-fast);
    border-left: 3px solid transparent !important;
}

.notif-item.unread {
    background-color: rgba(var(--primary-rgb), 0.04) !important;
    border-left-color: var(--primary) !important;
}

.notif-item:hover {
    background-color: rgba(var(--primary-rgb), 0.06) !important;
}

/* --- Form Control Addon Icon --- */
.input-with-icon {
    position: relative;
}

.input-with-icon .bi {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-with-icon .form-control {
    padding-left: 2.4rem;
}

.input-with-icon .form-control:focus ~ .bi {
    color: var(--primary);
}

