@import url("../appbuilder/css/themes/flatly.css");

/* ==========================================================================
   Konteks Production UI Theme
   Modern, sleek design with excellent dark/light mode contrast
   Matching the dashboard design system
   ========================================================================== */

:root {
    /* Dashboard Color Palette - Shared across all pages */
    --health-green: #00E676;
    --health-amber: #FFAB00;
    --health-red: #FF5252;
    --health-blue: #64B5F6;
    --health-purple: #7C4DFF;
    --health-teal: #26A69A;
    --health-orange: #FF7043;
    --health-pink: #EC407A;

    /* Light Mode - Clean, professional with warm undertones */
    --theme-bg: #f8f9fc;
    --theme-surface: #ffffff;
    --theme-surface-subtle: #f1f5f9;
    --theme-surface-elevated: #ffffff;
    --theme-soft-border: rgba(15, 23, 42, 0.08);
    --theme-strong-border: rgba(15, 23, 42, 0.15);
    --theme-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --theme-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 8px 32px rgba(15, 23, 42, 0.06);
    --theme-shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12), 0 16px 48px rgba(15, 23, 42, 0.08);
    --theme-text-primary: #1e293b;
    --theme-text-secondary: #475569;
    --theme-text-muted: #64748b;
    --theme-heading: #0f172a;
    
    /* Modern accent colors - matching dashboard palette */
    --theme-accent-primary: var(--health-purple); /* Purple - clear primary action */
    --theme-accent-primary-dark: #6C3FD9;
    --theme-accent-primary-light: rgba(124, 77, 255, 0.1);
    --theme-accent-secondary: var(--health-blue);
    --theme-accent-success: var(--health-green); /* Green - success states */
    --theme-accent-success-light: rgba(0, 230, 118, 0.1);
    --theme-accent-info: var(--health-teal); /* Teal - informational */
    --theme-accent-info-light: rgba(38, 166, 154, 0.1);
    --theme-accent-warning: var(--health-amber); /* Amber - warnings */
    --theme-accent-warning-light: rgba(255, 171, 0, 0.1);
    --theme-accent-danger: var(--health-red); /* Red - errors/danger */
    --theme-accent-danger-light: rgba(255, 82, 82, 0.1);
    
    /* Refined border radii for modern look */
    --theme-radius-sm: 0.5rem;
    --theme-radius-md: 0.75rem;
    --theme-radius-lg: 1rem;
    --theme-radius-xl: 1.5rem;
    
    /* Transition for smooth theme switching */
    --theme-transition: background-color 0.3s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================================================
   Dark Mode - High contrast, matching dashboard design
   ========================================================================== */
html[data-theme="dark"] {
    --theme-bg: #121212; /* Dark base matching dashboards */
    --theme-surface: #1A1A1A; /* Card surfaces */
    --theme-surface-subtle: #1A1A1A;
    --theme-surface-elevated: #2D2D2D; /* Elevated elements */
    --theme-soft-border: rgba(255, 255, 255, 0.1);
    --theme-strong-border: rgba(255, 255, 255, 0.15);
    --theme-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    --theme-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3);
    --theme-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5), 0 16px 48px rgba(0, 0, 0, 0.4);
    
    /* High contrast text - matching dashboard style */
    --theme-text-primary: #FFFFFF;
    --theme-text-secondary: rgba(255, 255, 255, 0.7);
    --theme-text-muted: rgba(255, 255, 255, 0.5);
    --theme-heading: #ffffff;
    
    /* Adjusted accents for dark mode - using dashboard colors */
    --theme-accent-primary: var(--health-purple);
    --theme-accent-primary-dark: #9171FF;
    --theme-accent-primary-light: rgba(124, 77, 255, 0.15);
    --theme-accent-secondary: var(--health-blue);
    --theme-accent-success: var(--health-green);
    --theme-accent-success-light: rgba(0, 230, 118, 0.15);
    --theme-accent-info: var(--health-teal);
    --theme-accent-info-light: rgba(38, 166, 154, 0.15);
    --theme-accent-warning: var(--health-amber);
    --theme-accent-warning-light: rgba(255, 171, 0, 0.15);
    --theme-accent-danger: var(--health-red);
    --theme-accent-danger-light: rgba(255, 82, 82, 0.15);
}

/* Light mode explicit - using dashboard palette */
html[data-theme="light"] {
    --theme-bg: #f8f9fc;
    --theme-surface: #ffffff;
    --theme-surface-subtle: #f1f5f9;
    --theme-text-primary: #1e293b;
    --theme-text-secondary: #475569;
    --theme-text-muted: #64748b;
    --theme-heading: #0f172a;
    --theme-accent-primary: var(--health-purple);
}

/* ==========================================================================
   Base Typography & Layout
   ========================================================================== */
html,
body {
    background-color: var(--theme-bg);
    transition: var(--theme-transition);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--theme-text-primary);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern typographic scale */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 1.1rem; font-weight: 600; }
h5, h6 { font-size: 1rem; font-weight: 600; }

p { color: var(--theme-text-secondary); line-height: 1.7; }
.muted { color: var(--theme-text-muted); }

h1, h2, h3, h4, h5, h6 {
    color: var(--theme-heading);
    margin-bottom: 0.5em;
    transition: color 0.2s ease;
}

strong, b {
    color: var(--theme-text-primary);
    font-weight: 600;
}

.text-muted, small, .help-block {
    color: var(--theme-text-muted) !important;
}

/* Links with smooth transitions */
a {
    color: var(--theme-accent-primary);
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover, a:focus {
    color: var(--theme-accent-primary-dark);
    text-decoration: none;
}

hr {
    border: none;
    border-top: 1px solid var(--theme-soft-border);
    margin: 1.5rem 0;
}

.page-header {
    border: none;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 0;
}

/* ==========================================================================
   Navigation Bar - Modern, sleek design
   ========================================================================== */
.breadcrumb {
    border-radius: var(--theme-radius-md);
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-soft-border);
    box-shadow: var(--theme-shadow-sm);
    color: var(--theme-text-secondary);
    padding: 0.75rem 1rem;
}

.navbar {
    position: relative;
    z-index: 1030;
    border: none;
    border-radius: var(--theme-radius-lg);
    margin: 1rem 1.5rem 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--theme-transition);
}

/* Dark mode navbar - slightly elevated feel */
html[data-theme="dark"] .navbar {
    background: var(--theme-surface-elevated);
    border: 1px solid var(--theme-soft-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar .navbar-brand,
.navbar .navbar-nav > li > a,
.navbar .navbar-text,
.navbar .navbar-link {
    color: var(--theme-text-primary) !important;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.15s ease, background-color 0.15s ease;
}

/* Prominent brand styling */
.navbar .navbar-brand {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--theme-radius-sm);
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar .navbar-brand:hover {
    transform: translateY(-1px);
    opacity: 0.9;
    text-decoration: none !important;
}

.navbar .navbar-brand > img {
    height: 40px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
}

.navbar .navbar-nav > li > a:hover,
.navbar .navbar-nav > li > a:focus,
.navbar .navbar-nav > .active > a,
.navbar .navbar-nav > .active > a:hover,
.navbar .navbar-nav > .open > a,
.navbar .navbar-nav > .open > a:hover {
    background-color: var(--theme-accent-primary-light) !important;
    color: var(--theme-accent-primary) !important;
    border-radius: var(--theme-radius-sm);
}

html[data-theme="dark"] .navbar .navbar-nav > li > a:hover,
html[data-theme="dark"] .navbar .navbar-nav > li > a:focus,
html[data-theme="dark"] .navbar .navbar-nav > .active > a {
    background-color: var(--theme-accent-primary-light) !important;
    color: var(--theme-accent-primary) !important;
}

.navbar-toggle .icon-bar {
    background-color: var(--theme-text-primary);
}

/* Dropdown menus */
.navbar .dropdown-menu {
    position: absolute;
    z-index: 1050;
    border-radius: var(--theme-radius-md);
    border: 1px solid var(--theme-soft-border);
    box-shadow: var(--theme-shadow-md);
    padding: 0.5rem;
    background-color: var(--theme-surface);
    margin-top: 0.5rem;
}

html[data-theme="dark"] .navbar .dropdown-menu {
    background-color: var(--theme-surface-elevated);
}

.navbar .dropdown-menu > li > a {
    border-radius: var(--theme-radius-sm);
    padding: 0.6rem 1rem;
    color: var(--theme-text-secondary);
    font-weight: 500;
}

.navbar .dropdown-menu > li > a:hover,
.navbar .dropdown-menu > li > a:focus {
    background-color: var(--theme-accent-primary-light);
    color: var(--theme-accent-primary);
}

@media (max-width: 767px) {
    .navbar {
        margin: 0.75rem;
        padding: 0.5rem 1rem;
        border-radius: var(--theme-radius-md);
    }
}

/* ==========================================================================
   Sidebar Menu
   ========================================================================== */
.list-group.menu {
    position: relative;
    z-index: 100;
    border-radius: var(--theme-radius-lg);
    border: 1px solid var(--theme-soft-border);
    background-color: var(--theme-surface);
    box-shadow: var(--theme-shadow-md);
    overflow: hidden;
}

html[data-theme="dark"] .list-group.menu {
    background-color: var(--theme-surface-elevated);
    border-color: rgba(255, 255, 255, 0.08);
}

.list-group.menu .list-group-item {
    border: none;
    padding: 0.85rem 1.25rem;
    color: var(--theme-text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.15s ease;
    background-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-group.menu .list-group-item i,
.list-group.menu .list-group-item .fa {
    width: 1.25rem;
    text-align: center;
    color: var(--theme-text-muted);
    transition: color 0.15s ease;
}

.list-group.menu .list-group-item:hover,
.list-group.menu .list-group-item:focus {
    background-color: var(--theme-accent-primary-light);
    color: var(--theme-accent-primary);
    text-decoration: none;
}

.list-group.menu .list-group-item:hover i,
.list-group.menu .list-group-item:hover .fa {
    color: var(--theme-accent-primary);
}

html[data-theme="dark"] .list-group.menu .list-group-item:hover,
html[data-theme="dark"] .list-group.menu .list-group-item:focus {
    background-color: rgba(59, 130, 246, 0.15);
}

.list-group.menu .list-group-item.active,
.list-group.menu .list-group-item.active:hover,
.list-group.menu .list-group-item.active:focus {
    background: linear-gradient(135deg, var(--theme-accent-primary), #2563eb);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.list-group.menu .list-group-item.active i,
.list-group.menu .list-group-item.active .fa {
    color: #ffffff;
}

/* ==========================================================================
   Cards, Panels & Wells - Modern elevated surfaces
   ========================================================================== */
.panel,
.card,
.well {
    border-radius: var(--theme-radius-lg);
    border: 1px solid var(--theme-soft-border);
    background-color: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.panel:hover,
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--theme-shadow-md);
}

/* Don't elevate wells on hover */
.well:hover {
    transform: none;
    box-shadow: var(--theme-shadow-sm);
}

.panel-heading,
.card-header {
    background-color: var(--theme-surface-subtle);
    border-bottom: 1px solid var(--theme-soft-border);
    border-top-left-radius: calc(var(--theme-radius-lg) - 1px);
    border-top-right-radius: calc(var(--theme-radius-lg) - 1px);
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.panel-title {
    font-weight: 700;
    color: var(--theme-text-primary);
    font-size: 0.9rem;
}

.panel-body,
.card-body {
    padding: 1.25rem;
}

.panel-footer,
.card-footer {
    background-color: var(--theme-surface-subtle);
    border-top: 1px solid var(--theme-soft-border);
    border-bottom-left-radius: calc(var(--theme-radius-lg) - 1px);
    border-bottom-right-radius: calc(var(--theme-radius-lg) - 1px);
    padding: 1rem 1.25rem;
}

/* ==========================================================================
   List Groups
   ========================================================================== */
.list-group-item {
    border: none;
    border-bottom: 1px solid var(--theme-soft-border);
    background-color: var(--theme-surface);
    color: var(--theme-text-secondary);
    padding: 1rem 1.25rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

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

.list-group-item:hover,
.list-group-item:focus {
    background-color: var(--theme-accent-primary-light);
    color: var(--theme-text-primary);
}

.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
    background-color: var(--theme-accent-primary);
    color: #ffffff;
    border-color: var(--theme-accent-primary);
}

/* ==========================================================================
   Tables - Clean, readable data display
   ========================================================================== */
.table {
    background-color: var(--theme-surface);
    border-radius: var(--theme-radius-lg);
    overflow: hidden;
    margin-bottom: 0;
}

.appbuilder .container .table,
.container .table {
    border-radius: var(--theme-radius-lg);
    background-color: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
    border: 1px solid var(--theme-soft-border);
}

.table > thead > tr > th {
    border-bottom: 2px solid var(--theme-soft-border);
    background-color: var(--theme-surface-subtle);
    color: var(--theme-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 1rem 1.25rem;
}

.table > tbody > tr > td,
.table > tfoot > tr > td {
    border-top: 1px solid var(--theme-soft-border);
    color: var(--theme-text-primary);
    padding: 1rem 1.25rem;
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--theme-surface-subtle);
}

.table-hover > tbody > tr:hover {
    background-color: var(--theme-accent-primary-light);
}

/* Dark mode table adjustments */
html[data-theme="dark"] .table > thead > tr > th {
    background-color: var(--theme-surface-subtle);
    color: var(--theme-text-muted);
}

html[data-theme="dark"] .table > tbody > tr > td {
    color: var(--theme-text-primary);
}

/* ==========================================================================
   Buttons - Modern, accessible design
   ========================================================================== */
.btn {
    border-radius: var(--theme-radius-sm);
    border: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.6rem 1.25rem;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.15s ease;
}

.btn:focus,
.btn:active {
    outline: none;
    box-shadow: 0 0 0 3px var(--theme-accent-primary-light);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--theme-shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

/* Primary button - clear call to action */
.btn-primary {
    background-color: var(--theme-accent-primary);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--theme-accent-primary-dark);
    color: #ffffff;
}

/* Dark mode primary button - brighter for visibility */
html[data-theme="dark"] .btn-primary {
    background-color: var(--theme-accent-primary);
    color: #0f172a;
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus {
    background-color: var(--theme-accent-primary-dark);
    color: #0f172a;
}

.btn-success {
    background-color: var(--theme-accent-success);
    color: #ffffff;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: #059669;
    color: #ffffff;
}

.btn-info {
    background-color: var(--theme-accent-info);
    color: #ffffff;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    background-color: #0891b2;
    color: #ffffff;
}

.btn-warning {
    background-color: var(--theme-accent-warning);
    color: #ffffff;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background-color: #d97706;
    color: #ffffff;
}

.btn-danger {
    background-color: var(--theme-accent-danger);
    color: #ffffff;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-default {
    background-color: var(--theme-surface-subtle);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-soft-border);
}

.btn-default:hover,
.btn-default:focus,
.btn-default:active {
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
}

html[data-theme="dark"] .btn-default {
    background-color: var(--theme-surface-elevated);
    color: var(--theme-text-primary);
    border-color: var(--theme-strong-border);
}

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

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

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-primary:focus {
    color: #0f172a;
}

.btn-link {
    color: var(--theme-accent-primary);
    text-decoration: none;
    padding: 0.5rem;
}

.btn-link:hover {
    color: var(--theme-accent-primary-dark);
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   Form Controls - Clean, accessible inputs
   ========================================================================== */
.form-control,
.input-group-addon {
    border-radius: var(--theme-radius-sm);
    border: 1px solid var(--theme-soft-border);
    background-color: var(--theme-surface);
    color: var(--theme-text-primary);
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    height: auto;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--theme-accent-primary);
    box-shadow: 0 0 0 3px var(--theme-accent-primary-light);
    background-color: var(--theme-surface);
}

.form-control::placeholder {
    color: var(--theme-text-muted);
}

html[data-theme="dark"] .form-control {
    background-color: var(--theme-surface-subtle);
    border-color: var(--theme-strong-border);
    color: var(--theme-text-primary);
}

html[data-theme="dark"] .form-control:focus {
    background-color: var(--theme-surface);
    border-color: var(--theme-accent-primary);
}

.input-group-addon {
    background-color: var(--theme-surface-subtle);
    color: var(--theme-text-muted);
    border-color: var(--theme-soft-border);
}

label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Alerts - Clear, contextual feedback
   ========================================================================== */
.alert {
    border-radius: var(--theme-radius-md);
    border: none;
    box-shadow: var(--theme-shadow-sm);
    color: var(--theme-text-primary);
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background-color: var(--theme-accent-success-light);
    border-left: 4px solid var(--theme-accent-success);
    color: #065f46;
}

html[data-theme="dark"] .alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--theme-accent-success);
}

.alert-info {
    background-color: var(--theme-accent-info-light);
    border-left: 4px solid var(--theme-accent-info);
    color: #0e7490;
}

html[data-theme="dark"] .alert-info {
    background-color: rgba(6, 182, 212, 0.15);
    color: var(--theme-accent-info);
}

.alert-warning {
    background-color: var(--theme-accent-warning-light);
    border-left: 4px solid var(--theme-accent-warning);
    color: #92400e;
}

html[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--theme-accent-warning);
}

.alert-danger {
    background-color: var(--theme-accent-danger-light);
    border-left: 4px solid var(--theme-accent-danger);
    color: #b91c1c;
}

html[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--theme-accent-danger);
}

/* ==========================================================================
   Labels & Badges - Modern pill design
   ========================================================================== */
.label,
.badge {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
}

.label-default,
.badge-default {
    background-color: var(--theme-surface-subtle);
    color: var(--theme-text-secondary);
}

html[data-theme="dark"] .label-default,
html[data-theme="dark"] .badge-default {
    background-color: var(--theme-surface-elevated);
    color: var(--theme-text-secondary);
}

.label-primary,
.badge-primary {
    background-color: var(--theme-accent-primary);
    color: #ffffff;
}

html[data-theme="dark"] .label-primary,
html[data-theme="dark"] .badge-primary {
    color: #0f172a;
}

.label-success,
.badge-success {
    background-color: var(--theme-accent-success);
    color: #ffffff;
}

.label-info,
.badge-info {
    background-color: var(--theme-accent-info);
    color: #ffffff;
}

.label-warning,
.badge-warning {
    background-color: var(--theme-accent-warning);
    color: #ffffff;
}

.label-danger,
.badge-danger {
    background-color: var(--theme-accent-danger);
    color: #ffffff;
}

/* Soft badge variants */
.badge-soft {
    font-weight: 600;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
}

.badge-soft.badge-primary {
    background-color: var(--theme-accent-primary-light);
    color: var(--theme-accent-primary);
}

.badge-soft.badge-success {
    background-color: var(--theme-accent-success-light);
    color: var(--theme-accent-success);
}

.badge-soft.badge-warning {
    background-color: var(--theme-accent-warning-light);
    color: var(--theme-accent-warning);
}

.badge-soft.badge-danger {
    background-color: var(--theme-accent-danger-light);
    color: var(--theme-accent-danger);
}

.badge-soft.badge-info {
    background-color: var(--theme-accent-info-light);
    color: var(--theme-accent-info);
}

.badge-soft.badge-secondary {
    background-color: var(--theme-surface-subtle);
    color: var(--theme-text-secondary);
}

.badge-soft.badge-dark {
    background-color: var(--theme-surface-elevated);
    color: var(--theme-text-primary);
}

/* ==========================================================================
   Pagination - Clean, accessible navigation
   ========================================================================== */
.pagination > li > a,
.pagination > li > span {
    border: none;
    border-radius: var(--theme-radius-sm);
    margin: 0 0.15rem;
    color: var(--theme-text-secondary);
    background-color: var(--theme-surface);
    box-shadow: var(--theme-shadow-sm);
    padding: 0.5rem 0.85rem;
    transition: all 0.15s ease;
}

.pagination > li > a:hover,
.pagination > li > a:focus,
.pagination > li > span:hover,
.pagination > li > span:focus {
    background-color: var(--theme-accent-primary);
    color: #ffffff;
    transform: translateY(-1px);
}

html[data-theme="dark"] .pagination > li > a:hover,
html[data-theme="dark"] .pagination > li > a:focus {
    color: #0f172a;
}

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover {
    background-color: var(--theme-accent-primary);
    color: #ffffff;
    box-shadow: var(--theme-shadow-md);
}

html[data-theme="dark"] .pagination > .active > a {
    color: #0f172a;
}

/* ==========================================================================
   Modals - Elegant overlays
   ========================================================================== */
.modal-content {
    border-radius: var(--theme-radius-xl);
    border: 1px solid var(--theme-soft-border);
    box-shadow: var(--theme-shadow-lg);
    background-color: var(--theme-surface);
}

.modal-header {
    border-color: var(--theme-soft-border);
    background-color: var(--theme-surface);
    border-top-left-radius: calc(var(--theme-radius-xl) - 1px);
    border-top-right-radius: calc(var(--theme-radius-xl) - 1px);
    padding: 1.25rem 1.5rem;
}

.modal-header .close {
    color: var(--theme-text-muted);
    opacity: 0.7;
    font-size: 1.5rem;
}

.modal-header .close:hover {
    color: var(--theme-text-primary);
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
    color: var(--theme-text-primary);
}

.modal-footer {
    border-color: var(--theme-soft-border);
    background-color: var(--theme-surface-subtle);
    border-bottom-left-radius: calc(var(--theme-radius-xl) - 1px);
    border-bottom-right-radius: calc(var(--theme-radius-xl) - 1px);
    padding: 1rem 1.5rem;
}

.modal-title {
    color: var(--theme-heading);
    font-weight: 700;
}

/* Modal backdrop - darker for better focus */
.modal-backdrop.in {
    opacity: 0.5;
}

html[data-theme="dark"] .modal-backdrop.in {
    opacity: 0.7;
}

/* ==========================================================================
   Popovers & Tooltips
   ========================================================================== */
.popover {
    border-radius: var(--theme-radius-md);
    border: 1px solid var(--theme-soft-border);
    box-shadow: var(--theme-shadow-md);
    color: var(--theme-text-secondary);
    background-color: var(--theme-surface);
}

.tooltip .tooltip-inner {
    border-radius: var(--theme-radius-sm);
    background-color: var(--theme-heading);
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

html[data-theme="dark"] .tooltip .tooltip-inner {
    background-color: var(--theme-surface-elevated);
    color: var(--theme-text-primary);
}

/* ==========================================================================
   Jumbotron & Code blocks
   ========================================================================== */
.jumbotron {
    border-radius: var(--theme-radius-xl);
    background-color: var(--theme-surface);
    box-shadow: var(--theme-shadow-md);
    border: 1px solid var(--theme-soft-border);
    padding: 2.5rem;
}

.code,
pre,
code {
    background-color: var(--theme-surface-subtle);
    border-radius: var(--theme-radius-sm);
    border: 1px solid var(--theme-soft-border);
    color: var(--theme-text-primary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

pre {
    padding: 1rem 1.25rem;
}

code {
    padding: 0.2rem 0.4rem;
    font-size: 0.9em;
}

/* ==========================================================================
   Tabs
   ========================================================================== */
.nav-tabs {
    border-bottom: 2px solid var(--theme-soft-border);
}

.nav-tabs > li > a {
    border-radius: var(--theme-radius-sm) var(--theme-radius-sm) 0 0;
    border: none;
    color: var(--theme-text-secondary);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    margin-bottom: -2px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-tabs > li > a:hover,
.nav-tabs > li > a:focus {
    background-color: var(--theme-accent-primary-light);
    color: var(--theme-accent-primary);
    border-color: transparent;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--theme-accent-primary);
    background-color: var(--theme-surface);
    border: none;
    border-bottom: 2px solid var(--theme-accent-primary);
    font-weight: 600;
}

/* ==========================================================================
   AppBuilder Containers
   ========================================================================== */
.appbuilder .container,
.appbuilder .container-fluid {
    background: transparent;
}

.appbuilder .row {
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Footer - Clean, modern footer design
   ========================================================================== */
.footer {
    border-top: 1px solid var(--theme-soft-border);
    color: var(--theme-text-muted);
    background-color: var(--theme-surface);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

html[data-theme="dark"] .footer {
    background-color: var(--theme-surface-subtle);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Footer layout helpers for public pages */
.footer-section .footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.footer-section .footer-links a {
    color: var(--theme-text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--theme-radius-md);
    transition: all 0.15s ease;
}

.footer-section .footer-links a:hover {
    background-color: var(--theme-accent-primary-light);
    color: var(--theme-accent-primary);
    text-decoration: none;
}

html[data-theme="dark"] .footer-section .footer-links a:hover {
    background-color: rgba(59, 130, 246, 0.15);
}

.footer-section .footer-copyright {
    display: block;
    text-align: center;
    color: var(--theme-text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    padding-top: 1rem;
    border-top: 1px solid var(--theme-soft-border);
    margin-top: 1rem;
}

/* ==========================================================================
   Theme Toggle - Prominent, accessible toggle button
   ========================================================================== */
.konteks-theme-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    border: none;
    background: linear-gradient(135deg, var(--theme-accent-primary), #2563eb);
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 48px;
    height: 48px;
}

.konteks-theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.konteks-theme-toggle:active {
    transform: scale(0.95);
}

.konteks-theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--theme-accent-primary-light), 0 4px 14px rgba(59, 130, 246, 0.4);
}

.konteks-theme-icon {
    font-size: 1.25rem;
    line-height: 1;
}

/* Dark mode toggle styling - gold/amber for visibility */
html[data-theme="dark"] .konteks-theme-toggle {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

html[data-theme="dark"] .konteks-theme-toggle:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

html[data-theme="dark"] .konteks-theme-toggle:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3), 0 4px 14px rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   Dark Mode Icon & Element Visibility
   ========================================================================== */
/* Ensure all icons are clearly visible in dark mode */
html[data-theme="dark"] .fa,
html[data-theme="dark"] .fas,
html[data-theme="dark"] .far,
html[data-theme="dark"] .fab,
html[data-theme="dark"] .material-icons {
    color: var(--theme-text-primary);
}

/* Navbar elements must be clearly visible */
html[data-theme="dark"] .navbar .navbar-brand,
html[data-theme="dark"] .navbar .navbar-nav > li > a,
html[data-theme="dark"] .navbar .navbar-text,
html[data-theme="dark"] .navbar .navbar-link {
    color: var(--theme-text-primary) !important;
}

html[data-theme="dark"] .navbar .navbar-toggle .icon-bar {
    background-color: var(--theme-text-primary);
}

/* Make inline SVGs visible in dark mode */
html[data-theme="dark"] svg.icon,
html[data-theme="dark"] svg.k-icon,
html[data-theme="dark"] svg.inline-icon {
    fill: currentColor;
    stroke: currentColor;
}

/* Preserve image/logo visibility in dark mode */
html[data-theme="dark"] img.logo,
html[data-theme="dark"] .navbar-brand img {
    filter: brightness(1.1) contrast(1.05);
}

/* ==========================================================================
   Responsive Theme Toggle Position
   ========================================================================== */
@media (max-width: 767px) {
    .konteks-theme-toggle {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
        padding: 0.65rem;
    }
    
    .konteks-theme-icon {
        font-size: 1.1rem;
    }
}

/* Navbar-embedded toggle (alternative position) */
.navbar .konteks-theme-toggle--navbar {
    display: inline-flex;
    position: static;
    margin-left: 0.75rem;
    box-shadow: none;
    padding: 0.4rem;
    width: auto;
    height: auto;
    border-radius: var(--theme-radius-md);
    background: transparent;
    color: var(--theme-text-primary);
}

.navbar .konteks-theme-toggle--navbar:hover {
    background-color: var(--theme-accent-primary-light);
    transform: none;
}

html[data-theme="dark"] .navbar .konteks-theme-toggle--navbar:hover {
    background-color: rgba(245, 158, 11, 0.15);
}

.navbar .konteks-theme-toggle--navbar .konteks-theme-icon {
    font-size: 1.1rem;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
/* Spacing utilities */
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

/* Text utilities */
.text-muted { color: var(--theme-text-muted) !important; }
.text-secondary { color: var(--theme-text-secondary) !important; }
.text-primary { color: var(--theme-accent-primary) !important; }
.text-success { color: var(--theme-accent-success) !important; }
.text-warning { color: var(--theme-accent-warning) !important; }
.text-danger { color: var(--theme-accent-danger) !important; }
.text-info { color: var(--theme-accent-info) !important; }

/* Background utilities */
.bg-surface { background-color: var(--theme-surface) !important; }
.bg-surface-subtle { background-color: var(--theme-surface-subtle) !important; }
.bg-surface-elevated { background-color: var(--theme-surface-elevated) !important; }

/* Border utilities */
.border-soft { border-color: var(--theme-soft-border) !important; }
.rounded-sm { border-radius: var(--theme-radius-sm) !important; }
.rounded-md { border-radius: var(--theme-radius-md) !important; }
.rounded-lg { border-radius: var(--theme-radius-lg) !important; }
.rounded-xl { border-radius: var(--theme-radius-xl) !important; }

/* Shadow utilities */
.shadow-sm { box-shadow: var(--theme-shadow-sm) !important; }
.shadow-md { box-shadow: var(--theme-shadow-md) !important; }
.shadow-lg { box-shadow: var(--theme-shadow-lg) !important; }

/* Transition utility */
.transition { transition: var(--theme-transition); }

