/* ============================================================
   ePerolehan Design System — Perbadanan Labuan Navy Theme
   ============================================================ */

/* CSS Variables */
:root {
    /* Brand Colors — navy palette matching the Perbadanan Labuan logo */
    --ep-primary: #1c3d75;
    --ep-primary-light: #2d5495;
    --ep-primary-dark: #13294f;
    --ep-primary-50: #eef2f9;
    --ep-primary-100: #dbe4f0;
    --ep-primary-200: #b6c8e0;
    --ep-primary-500: #2d5495;
    --ep-primary-600: #1c3d75;
    --ep-primary-700: #13294f;
    --ep-primary-900: #0a1a36;

    /* Semantic */
    --ep-success: #10b981;
    --ep-success-bg: #d1fae5;
    --ep-success-text: #065f46;
    --ep-warning: #f59e0b;
    --ep-warning-bg: #fef3c7;
    --ep-warning-text: #92400e;
    --ep-danger: #ef4444;
    --ep-danger-bg: #fee2e2;
    --ep-danger-text: #991b1b;
    --ep-info: #06b6d4;
    --ep-info-bg: #cffafe;
    --ep-info-text: #164e63;
    --ep-purple: #8b5cf6;
    --ep-purple-bg: #ede9fe;
    --ep-pink: #ec4899;

    /* Neutrals */
    --ep-bg: #f8fafc;
    --ep-surface: #ffffff;
    --ep-surface-2: #f1f5f9;
    --ep-border: #e2e8f0;
    --ep-border-2: #cbd5e1;
    --ep-text: #0f172a;
    --ep-text-muted: #64748b;
    --ep-text-light: #94a3b8;

    /* Layout */
    --ep-sidebar-w: 260px;
    --ep-sidebar-w-collapsed: 76px;
    --ep-topbar-h: 64px;
    --ep-radius: 10px;
    --ep-radius-lg: 14px;
    --ep-radius-sm: 6px;

    /* Shadow */
    --ep-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --ep-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --ep-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --ep-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --ep-shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

    /* Typography */
    --ep-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --ep-font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--ep-bg);
    color: var(--ep-text);
    font-family: var(--ep-font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ep-primary); text-decoration: none; transition: color .15s; }
/* Don't change text color on hover for elements that own their visual style
   (buttons, sidebar/dropdown items, etc.) — they manage their own hover colors. */
a:not(.ep-btn):not(.ep-nav-link):not(.ep-icon-btn):not(.ep-dropdown-item):not(.ep-notif-item):not(.ep-tab):not(.ep-auth-action):hover { color: var(--ep-primary-dark); }

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; font-weight: 600; color: var(--ep-text); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1rem; color: var(--ep-text-muted); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ep-bg); }
::-webkit-scrollbar-thumb { background: var(--ep-border-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--ep-text-light); }

/* ============================================================
   LAYOUT — App shell, sidebar, topbar
   ============================================================ */
.ep-app {
    display: flex;
    min-height: 100vh;
}

.ep-sidebar {
    width: var(--ep-sidebar-w);
    /* Light theme — white sidebar against the gray content (--ep-bg) so the two
       panels are clearly distinguished. Blue used only for the active accent. */
    background: var(--ep-surface);
    color: var(--ep-text-muted);
    border-right: 1px solid var(--ep-border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width .25s ease;
    display: flex;
    flex-direction: column;
}

.ep-sidebar-header {
    height: var(--ep-topbar-h);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--ep-border);
    color: var(--ep-text);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.02em;
}

.ep-sidebar-header .ep-brand-mark {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.ep-sidebar-header .ep-brand-text {
    overflow: hidden;
    white-space: nowrap;
}

.ep-sidebar-header .ep-brand-text small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--ep-text-muted);
    margin-top: 1px;
}

.ep-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px 24px;
}

.ep-sidebar-body::-webkit-scrollbar-track { background: transparent; }
.ep-sidebar-body::-webkit-scrollbar-thumb { background: var(--ep-border-2); }

.ep-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ep-nav-section {
    padding: 18px 14px 6px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--ep-text-light);
    font-weight: 700;
}
.ep-sidebar-body > .ep-nav-section:first-child { padding-top: 6px; }
.ep-sidebar-body .ep-nav + .ep-nav-section { margin-top: 4px; }

.ep-nav-item { position: relative; }

.ep-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--ep-radius-sm);
    color: #475569;
    transition: all .18s ease;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
}

.ep-nav-link:hover {
    background: var(--ep-surface-2);
    color: var(--ep-text);
}

/* Active state — soft green tint with a deeper-green accent bar + text. */
.ep-nav-link.active {
    background: var(--ep-primary-100);
    color: var(--ep-primary-700);
    font-weight: 600;
    box-shadow:
        inset 3px 0 0 0 var(--ep-primary-700),
        0 4px 14px -8px rgba(19,41,79,0.35);
}
.ep-nav-link.active .ep-nav-icon { color: var(--ep-primary-700); }

.ep-nav-link .ep-nav-icon {
    flex-shrink: 0;
    font-size: 18px;
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ep-nav-link .ep-nav-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ep-nav-link .ep-nav-caret {
    transition: transform .2s;
}

.ep-nav-item.open > .ep-nav-link .ep-nav-caret { transform: rotate(90deg); }

.ep-nav-sub {
    list-style: none;
    margin: 4px 0 4px 30px;
    padding: 0;
    border-left: 1px solid var(--ep-border);
    padding-left: 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}

.ep-nav-item.open > .ep-nav-sub { max-height: 600px; }

.ep-nav-sub .ep-nav-link {
    padding: 8px 12px;
    font-size: 13px;
}

.ep-nav-sub .ep-nav-link.active {
    background: var(--ep-primary-100);
    color: var(--ep-primary-700);
    box-shadow: inset 2px 0 0 0 var(--ep-primary-700);
}

.ep-nav-link .ep-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--ep-danger);
    color: #fff;
    font-weight: 700;
    margin-left: auto;
}

.ep-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--ep-border);
    font-size: 11px;
    color: var(--ep-text-muted);
}

/* Main content */
.ep-main {
    flex: 1;
    margin-left: var(--ep-sidebar-w);
    min-width: 0;
    transition: margin-left .25s ease;
}

.ep-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--ep-topbar-h);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ep-border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.ep-topbar-toggle {
    background: none;
    border: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--ep-radius-sm);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--ep-text-muted);
    transition: all .15s;
}

.ep-topbar-toggle:hover { background: var(--ep-surface-2); color: var(--ep-text); }

.ep-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.ep-search input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-sm);
    padding: 0 14px 0 38px;
    background: var(--ep-surface-2);
    font-size: 13px;
    transition: all .15s;
}

.ep-search input:focus {
    background: #fff;
    border-color: var(--ep-primary-500);
    outline: none;
    box-shadow: 0 0 0 3px var(--ep-primary-100);
}

.ep-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ep-text-light);
    font-size: 16px;
}

.ep-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ep-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--ep-radius-sm);
    border: 0;
    background: transparent;
    color: var(--ep-text-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    position: relative;
    transition: all .15s;
}

.ep-icon-btn:hover { background: var(--ep-surface-2); color: var(--ep-text); }

.ep-icon-btn .ep-notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--ep-danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

.ep-icon-btn iconify-icon { font-size: 19px; }

.ep-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 100px;
    background: var(--ep-surface-2);
    cursor: pointer;
    border: 0;
    transition: all .15s;
}

.ep-user-menu:hover { background: var(--ep-border); }

.ep-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ep-primary-500), var(--ep-primary-700));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.ep-avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.ep-avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.ep-user-info { text-align: left; }
.ep-user-info .name { font-size: 13px; font-weight: 600; color: var(--ep-text); display: block; line-height: 1.2; }
.ep-user-info .role { font-size: 11px; color: var(--ep-text-muted); display: block; line-height: 1.2; }

/* Content area */
.ep-content {
    padding: 24px 28px 48px;
    min-height: calc(100vh - var(--ep-topbar-h));
}

.ep-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ep-page-header h1 {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0;
}

.ep-page-header .ep-page-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.ep-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ep-text-muted);
    list-style: none;
    margin: 0;
    padding: 0;
}

.ep-breadcrumb a { color: var(--ep-text-muted); }
.ep-breadcrumb a:hover { color: var(--ep-primary); }
.ep-breadcrumb li:not(:first-child)::before { content: "/"; margin-right: 6px; color: var(--ep-text-light); }
.ep-breadcrumb li.active { color: var(--ep-text); font-weight: 500; }

.ep-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   COLLAPSED SIDEBAR
   ============================================================ */
body.ep-sidebar-collapsed .ep-sidebar { width: var(--ep-sidebar-w-collapsed); }
body.ep-sidebar-collapsed .ep-sidebar .ep-brand-text,
body.ep-sidebar-collapsed .ep-sidebar .ep-nav-text,
body.ep-sidebar-collapsed .ep-sidebar .ep-nav-caret,
body.ep-sidebar-collapsed .ep-sidebar .ep-nav-section,
body.ep-sidebar-collapsed .ep-sidebar .ep-sidebar-footer { display: none; }
body.ep-sidebar-collapsed .ep-sidebar .ep-nav-link { justify-content: center; padding: 12px; }
body.ep-sidebar-collapsed .ep-main { margin-left: var(--ep-sidebar-w-collapsed); }

@media (max-width: 992px) {
    .ep-sidebar { transform: translateX(-100%); }
    body.ep-sidebar-open .ep-sidebar { transform: translateX(0); }
    .ep-main { margin-left: 0 !important; }
}

/* ============================================================
   CARDS
   ============================================================ */
.ep-card {
    background: var(--ep-surface);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow-sm);
    overflow: hidden;
}

.ep-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ep-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ep-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.ep-card-header .ep-card-subtitle {
    font-size: 12px;
    color: var(--ep-text-muted);
    margin: 2px 0 0;
}

.ep-card-body { padding: 20px; }
.ep-card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--ep-border);
    background: var(--ep-surface-2);
    font-size: 12px;
    color: var(--ep-text-muted);
}

.ep-card-tight .ep-card-body { padding: 14px 18px; }

/* Stat cards */
.ep-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ep-stat {
    background: var(--ep-surface);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    padding: 18px 20px;
    box-shadow: var(--ep-shadow-sm);
    position: relative;
    overflow: hidden;
}

.ep-stat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--ep-primary);
}

.ep-stat.ep-stat-success::before { background: var(--ep-success); }
.ep-stat.ep-stat-warning::before { background: var(--ep-warning); }
.ep-stat.ep-stat-danger::before  { background: var(--ep-danger); }
.ep-stat.ep-stat-info::before    { background: var(--ep-info); }
.ep-stat.ep-stat-purple::before  { background: var(--ep-purple); }

.ep-stat-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ep-stat-label {
    font-size: 12px;
    color: var(--ep-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ep-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ep-text);
    margin: 6px 0 0;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.ep-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--ep-radius-sm);
    display: grid;
    place-items: center;
    background: var(--ep-primary-50);
    color: var(--ep-primary-600);
    font-size: 20px;
    flex-shrink: 0;
}

.ep-stat.ep-stat-success .ep-stat-icon { background: var(--ep-success-bg); color: var(--ep-success-text); }
.ep-stat.ep-stat-warning .ep-stat-icon { background: var(--ep-warning-bg); color: var(--ep-warning-text); }
.ep-stat.ep-stat-danger  .ep-stat-icon { background: var(--ep-danger-bg);  color: var(--ep-danger-text);  }
.ep-stat.ep-stat-info    .ep-stat-icon { background: var(--ep-info-bg);    color: var(--ep-info-text);    }
.ep-stat.ep-stat-purple  .ep-stat-icon { background: var(--ep-purple-bg);  color: var(--ep-purple);       }

.ep-stat-trend {
    margin-top: 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--ep-text-muted);
}
.ep-stat-trend.up { color: var(--ep-success-text); }
.ep-stat-trend.down { color: var(--ep-danger-text); }
.ep-stat-trend iconify-icon { font-size: 14px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.ep-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--ep-radius-sm);
    border: 1px solid transparent;
    background: var(--ep-surface);
    color: var(--ep-text);
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    font-family: inherit;
}

.ep-btn:disabled { opacity: .55; cursor: not-allowed; }
.ep-btn iconify-icon { font-size: 16px; }

.ep-btn-primary { background: var(--ep-primary); color: #fff; border-color: var(--ep-primary); }
.ep-btn-primary:hover:not(:disabled) { background: var(--ep-primary-dark); border-color: var(--ep-primary-dark); color: #fff; box-shadow: 0 4px 8px rgba(28,61,117,0.25); }

.ep-btn-secondary { background: var(--ep-surface); color: var(--ep-text); border-color: var(--ep-border); }
.ep-btn-secondary:hover:not(:disabled) { background: var(--ep-surface-2); border-color: var(--ep-border-2); color: var(--ep-text); }

.ep-btn-success { background: var(--ep-success); color: #fff; border-color: var(--ep-success); }
.ep-btn-success:hover:not(:disabled) { background: #059669; border-color: #059669; color: #fff; }

.ep-btn-danger { background: var(--ep-danger); color: #fff; border-color: var(--ep-danger); }
.ep-btn-danger:hover:not(:disabled) { background: #dc2626; border-color: #dc2626; color: #fff; }

.ep-btn-warning { background: var(--ep-warning); color: #fff; border-color: var(--ep-warning); }
.ep-btn-warning:hover:not(:disabled) { background: #d97706; border-color: #d97706; color: #fff; }

.ep-btn-ghost { background: transparent; border-color: transparent; color: var(--ep-text-muted); }
.ep-btn-ghost:hover { background: var(--ep-surface-2); color: var(--ep-text); }

.ep-btn-sm { padding: 5px 10px; font-size: 12px; }
.ep-btn-lg { padding: 11px 22px; font-size: 14px; }
.ep-btn-icon { width: 34px; height: 34px; padding: 0; }
.ep-btn-icon.ep-btn-sm { width: 28px; height: 28px; }

.ep-btn-block { width: 100%; }

.ep-btn-group { display: inline-flex; }
.ep-btn-group .ep-btn { border-radius: 0; }
.ep-btn-group .ep-btn:first-child { border-radius: var(--ep-radius-sm) 0 0 var(--ep-radius-sm); }
.ep-btn-group .ep-btn:last-child { border-radius: 0 var(--ep-radius-sm) var(--ep-radius-sm) 0; }
.ep-btn-group .ep-btn + .ep-btn { margin-left: -1px; }

/* ============================================================
   FORMS
   ============================================================ */
.ep-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.ep-form-group { display: flex; flex-direction: column; gap: 6px; }
.ep-form-group.col-12 { grid-column: span 12; }
.ep-form-group.col-6  { grid-column: span 6; }
.ep-form-group.col-4  { grid-column: span 4; }
.ep-form-group.col-3  { grid-column: span 3; }
.ep-form-group.col-8  { grid-column: span 8; }

@media (max-width: 768px) {
    .ep-form-group.col-3, .ep-form-group.col-4, .ep-form-group.col-6, .ep-form-group.col-8 { grid-column: span 12; }
}

.ep-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ep-text);
}

.ep-label .req { color: var(--ep-danger); margin-left: 3px; }
.ep-label .hint { color: var(--ep-text-muted); font-weight: 400; margin-left: 6px; font-size: 11px; }

.ep-input, .ep-select, .ep-textarea {
    width: 100%;
    border: 1px solid var(--ep-border);
    background: var(--ep-surface);
    border-radius: var(--ep-radius-sm);
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--ep-text);
    transition: all .15s;
    font-family: inherit;
}

.ep-input:focus, .ep-select:focus, .ep-textarea:focus {
    border-color: var(--ep-primary-500);
    outline: none;
    box-shadow: 0 0 0 3px var(--ep-primary-100);
}

.ep-input[readonly], .ep-input:disabled, .ep-select:disabled, .ep-textarea:disabled {
    background: var(--ep-surface-2);
    color: var(--ep-text-muted);
    cursor: not-allowed;
}

.ep-textarea { min-height: 100px; resize: vertical; }

.ep-input-group { display: flex; align-items: stretch; }
.ep-input-group .ep-input, .ep-input-group .ep-select { border-radius: 0; }
.ep-input-group > *:first-child { border-radius: var(--ep-radius-sm) 0 0 var(--ep-radius-sm); }
.ep-input-group > *:last-child  { border-radius: 0 var(--ep-radius-sm) var(--ep-radius-sm) 0; }
.ep-input-group .ep-input + .ep-input,
.ep-input-group .ep-input + .ep-select,
.ep-input-group .ep-select + .ep-input { border-left: 0; }

.ep-input-addon {
    background: var(--ep-surface-2);
    border: 1px solid var(--ep-border);
    padding: 9px 12px;
    color: var(--ep-text-muted);
    font-size: 13px;
    display: grid;
    place-items: center;
}

.ep-form-help { font-size: 12px; color: var(--ep-text-muted); }
.ep-form-error { font-size: 12px; color: var(--ep-danger); }

.ep-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}
.ep-checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ep-primary); }

.ep-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}
.ep-radio input[type="radio"] { accent-color: var(--ep-primary); }

/* Switch */
.ep-switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.ep-switch input { opacity: 0; width: 0; height: 0; }
.ep-switch .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--ep-border-2); border-radius: 999px;
    transition: .2s;
}
.ep-switch .slider::before {
    position: absolute; content: ""; width: 18px; height: 18px;
    left: 2px; bottom: 2px; background: #fff; border-radius: 50%;
    transition: .2s; box-shadow: var(--ep-shadow-sm);
}
.ep-switch input:checked + .slider { background: var(--ep-primary); }
.ep-switch input:checked + .slider::before { transform: translateX(16px); }

/* ============================================================
   TABLES
   ============================================================ */
.ep-table-wrap {
    background: var(--ep-surface);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow-sm);
    overflow: hidden;
}

.ep-table-toolbar {
    padding: 14px 16px;
    border-bottom: 1px solid var(--ep-border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ep-table-toolbar .ep-search-mini {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 320px;
}

.ep-table-toolbar .ep-search-mini input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-sm);
    padding: 0 12px 0 36px;
    background: var(--ep-surface);
    font-size: 13px;
}

.ep-table-toolbar .ep-search-mini iconify-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    font-size: 16px; color: var(--ep-text-light);
}

/* Toolbar filter dropdowns — compact and aligned with search input */
.ep-table-toolbar .ep-select,
.ep-table-toolbar select.ep-toolbar-filter {
    width: auto;
    min-width: 130px;
    height: 36px;
    padding: 0 32px 0 12px;
    font-size: 13px;
    flex: 0 0 auto;
}
.ep-table-toolbar .ep-input[type="date"] {
    width: auto;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    flex: 0 0 auto;
}

.ep-table-scroll { overflow-x: auto; }

.ep-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ep-table thead th {
    background: var(--ep-surface-2);
    color: var(--ep-text-muted);
    font-weight: 600;
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--ep-border);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .05em;
    white-space: nowrap;
}

.ep-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ep-border);
    vertical-align: middle;
    color: var(--ep-text);
}

.ep-table tbody tr:hover { background: var(--ep-surface-2); }
.ep-table tbody tr:last-child td { border-bottom: 0; }

.ep-table td .ep-cell-strong { font-weight: 600; color: var(--ep-text); }
.ep-table td .ep-cell-muted { color: var(--ep-text-muted); font-size: 12px; }

.ep-table-empty {
    padding: 60px 24px;
    text-align: center;
    color: var(--ep-text-muted);
}

.ep-table-empty iconify-icon {
    font-size: 56px;
    color: var(--ep-border-2);
    margin-bottom: 12px;
}

.ep-table-empty h4 { color: var(--ep-text); font-weight: 600; margin-bottom: 4px; }
.ep-table-empty p { font-size: 13px; }

.ep-table-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* ============================================================
   Datatables — modern styling
   ============================================================ */
table.dataTable.ep-table { width: 100% !important; }

/* Wrapper — give the whole table toolbar+pagination breathing room */
.dataTables_wrapper {
    padding: 4px 0 6px;
}

/* Length selector — sits at bottom-left with info */
.dataTables_wrapper .dataTables_length {
    font-size: 13px;
    color: var(--ep-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.dataTables_wrapper .dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* Bottom row wrapper — left (length + info) | right (pagination) */
.ep-dt-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 16px;
}
.ep-dt-bottom-left {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.ep-dt-pag { display: inline-flex; }
.dataTables_wrapper .dataTables_length select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--ep-border) !important;
    border-radius: 6px !important;
    padding: 6px 28px 6px 10px !important;
    font-size: 13px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2364748b' d='M0 0l5 6 5-6z'/></svg>") no-repeat right 10px center;
    cursor: pointer;
    color: var(--ep-text);
    font-weight: 500;
    transition: border-color .15s;
}
.dataTables_wrapper .dataTables_length select:hover { border-color: var(--ep-primary) !important; }
.dataTables_wrapper .dataTables_length select:focus { outline: 2px solid rgba(28,61,117,0.20); outline-offset: 1px; }

/* Built-in filter is hidden — custom .ep-search-mini used instead */
.dataTables_wrapper .dataTables_filter { display: none; }

/* Info text — default placement (top of wrapper, right-aligned) when no toolbar */
.dataTables_wrapper .dataTables_info {
    padding: 0;
    font-size: 12.5px;
    color: var(--ep-text-muted);
    font-weight: 500;
    margin: 0;
}
.ep-dt-info-spot {
    padding: 4px 16px 10px;
    text-align: right;
    font-size: 12.5px;
    color: var(--ep-text-muted);
}
.ep-dt-info-spot:empty { display: none; }

/* When info is moved into .ep-table-toolbar (top-right alongside search) */
.ep-table-toolbar .dataTables_info.ep-dt-info-in-toolbar {
    margin-left: auto;
    padding: 0;
    font-size: 12.5px;
    color: var(--ep-text-muted);
    font-weight: 500;
}

/* Pagination wrapper */
.dataTables_wrapper .dataTables_paginate {
    padding: 0;
    display: inline-flex;
    gap: 4px;
}

/* Pagination buttons — base */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    min-width: 34px;
    height: 34px;
    padding: 0 12px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    border: 1px solid var(--ep-border) !important;
    background: #fff !important;
    color: var(--ep-text) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 32px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Hover (only when not disabled/current) */
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--ep-primary-50, #eff6ff) !important;
    border-color: var(--ep-primary) !important;
    color: var(--ep-primary) !important;
}

/* Active/current page */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--ep-primary) !important;
    border-color: var(--ep-primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(28,61,117,0.30);
}

/* Disabled prev/next */
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    background: #f8fafc !important;
    border-color: var(--ep-border) !important;
    color: #cbd5e1 !important;
    cursor: not-allowed;
    box-shadow: none;
}

/* Previous/Next arrow styling — make them icon-like */
.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    padding: 0 !important;
    width: 34px;
    font-size: 16px !important;
}

/* Ellipsis */
.dataTables_wrapper .dataTables_paginate .ellipsis {
    padding: 0 8px;
    color: var(--ep-text-muted);
    line-height: 34px;
}

/* Sort indicator color refinement */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc:after {
    color: var(--ep-text-muted) !important;
    opacity: 0.6;
}
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_desc:after {
    color: var(--ep-primary) !important;
    opacity: 1;
}

/* Inside card — bottom row gets a top border for separation, no background tint */
.ep-card .dataTables_wrapper { padding: 0; }
.ep-card .ep-dt-bottom {
    border-top: 1px solid var(--ep-border);
}

/* ============================================================
   BADGES
   ============================================================ */
.ep-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    background: var(--ep-surface-2);
    color: var(--ep-text-muted);
    line-height: 1.6;
    white-space: nowrap;
}

.ep-badge::before {
    content: "";
    width: 5px;
    height: 5px;
    background: currentColor;
    border-radius: 50%;
    display: inline-block;
}

.ep-badge-primary { background: var(--ep-primary-50); color: var(--ep-primary-700); }
.ep-badge-success { background: var(--ep-success-bg); color: var(--ep-success-text); }
.ep-badge-warning { background: var(--ep-warning-bg); color: var(--ep-warning-text); }
.ep-badge-danger  { background: var(--ep-danger-bg);  color: var(--ep-danger-text);  }
.ep-badge-info    { background: var(--ep-info-bg);    color: var(--ep-info-text);    }
.ep-badge-purple  { background: var(--ep-purple-bg);  color: var(--ep-purple);       }
.ep-badge-muted   { background: var(--ep-surface-2);  color: var(--ep-text-muted);   }

.ep-badge.no-dot::before { display: none; }

/* ============================================================
   ALERTS
   ============================================================ */
.ep-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--ep-radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 3px solid;
}

.ep-alert iconify-icon { font-size: 20px; margin-top: 1px; flex-shrink: 0; }
.ep-alert strong { display: block; margin-bottom: 2px; }

.ep-alert-primary { background: var(--ep-primary-50); color: var(--ep-primary-900); border-color: var(--ep-primary); }
.ep-alert-success { background: var(--ep-success-bg); color: var(--ep-success-text); border-color: var(--ep-success); }
.ep-alert-warning { background: var(--ep-warning-bg); color: var(--ep-warning-text); border-color: var(--ep-warning); }
.ep-alert-danger  { background: var(--ep-danger-bg);  color: var(--ep-danger-text);  border-color: var(--ep-danger); }
.ep-alert-info    { background: var(--ep-info-bg);    color: var(--ep-info-text);    border-color: var(--ep-info); }

/* ============================================================
   MODAL
   ============================================================ */
.ep-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    animation: epFadeIn .2s ease;
}

.ep-modal {
    background: var(--ep-surface);
    border-radius: var(--ep-radius-lg);
    box-shadow: var(--ep-shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    animation: epScaleIn .2s ease;
}

.ep-modal.lg  { max-width: 780px; }
.ep-modal.xl  { max-width: 1100px; }
.ep-modal.xxl { max-width: 1280px; height: 92vh; }
.ep-modal.sm  { max-width: 420px; }

.ep-modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--ep-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ep-modal-header h3 { margin: 0; font-size: 16px; }

.ep-modal-close {
    background: none;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--ep-radius-sm);
    cursor: pointer;
    color: var(--ep-text-muted);
    display: grid;
    place-items: center;
}
.ep-modal-close:hover { background: var(--ep-surface-2); color: var(--ep-text); }

.ep-modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }

/* Modal form grouping — reusable section block inside any modal body */
.ep-modal-section {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px dashed var(--ep-border);
}
.ep-modal-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.ep-modal-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--ep-primary);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ep-modal-section-title iconify-icon { font-size: 14px; color: var(--ep-primary); }

.ep-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--ep-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    background: var(--ep-surface-2);
    border-radius: 0 0 var(--ep-radius-lg) var(--ep-radius-lg);
}

@keyframes epFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes epScaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ============================================================
   DROPDOWN
   ============================================================ */
.ep-dropdown { position: relative; display: inline-block; }
.ep-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--ep-surface);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow-lg);
    padding: 6px;
    z-index: 200;
    display: none;
    animation: epScaleIn .15s ease;
}
.ep-dropdown.show > .ep-dropdown-menu { display: block; }

.ep-dropdown-item,
button.ep-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--ep-text);
    border-radius: var(--ep-radius-sm);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    /* Hard button reset so <button class="ep-dropdown-item"> looks identical to <a>. */
    width: 100%;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    text-align: left;
    line-height: 1.3;
    transition: background .12s, color .12s;
}
.ep-dropdown-item:hover,
button.ep-dropdown-item:hover {
    background: var(--ep-primary-50) !important;
    color: var(--ep-primary-700);
}
.ep-dropdown-item:hover iconify-icon { color: var(--ep-primary-700); }
.ep-dropdown-item:focus,
.ep-dropdown-item:focus-visible,
button.ep-dropdown-item:focus,
button.ep-dropdown-item:focus-visible { outline: 0; box-shadow: none !important; }
.ep-dropdown-item iconify-icon { font-size: 16px; color: var(--ep-text-muted); flex-shrink: 0; }
.ep-dropdown-item.danger { color: var(--ep-danger); }
.ep-dropdown-item.danger iconify-icon { color: var(--ep-danger); }
.ep-dropdown-item.danger:hover,
button.ep-dropdown-item.danger:hover {
    background: rgba(239,68,68,0.08) !important;
    color: var(--ep-danger);
}
.ep-dropdown-item.danger:hover iconify-icon { color: var(--ep-danger); }
.ep-dropdown-divider { height: 1px; background: var(--ep-border); margin: 6px 0; }

.ep-dropdown-header {
    padding: 10px 14px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ep-text-muted);
    font-weight: 700;
}

/* User dropdown */
.ep-user-dropdown {
    min-width: 260px;
}
.ep-user-dropdown-header {
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--ep-border);
    margin: -6px -6px 6px;
}
.ep-user-dropdown-header strong { display: block; font-size: 13px; }
.ep-user-dropdown-header small { display: block; font-size: 11px; color: var(--ep-text-muted); }

/* Notif dropdown */
.ep-notif-dropdown {
    min-width: 380px;
    padding: 0;
    max-height: 480px;
    overflow: hidden;
    display: none;
}
.ep-dropdown.show > .ep-notif-dropdown { display: flex; flex-direction: column; }

.ep-notif-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--ep-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ep-notif-list {
    overflow-y: auto;
    max-height: 360px;
}
.ep-notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ep-border);
    cursor: pointer;
    transition: background .1s;
}
.ep-notif-item:hover { background: var(--ep-surface-2); }
.ep-notif-item.unread { background: var(--ep-primary-50); }
.ep-notif-item.unread:hover { background: var(--ep-primary-100); }
.ep-notif-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ep-primary-50);
    color: var(--ep-primary-600);
    flex-shrink: 0;
}
.ep-notif-item.success .ep-notif-icon { background: var(--ep-success-bg); color: var(--ep-success-text); }
.ep-notif-item.warning .ep-notif-icon { background: var(--ep-warning-bg); color: var(--ep-warning-text); }
.ep-notif-item.danger  .ep-notif-icon { background: var(--ep-danger-bg);  color: var(--ep-danger-text);  }
.ep-notif-body { flex: 1; min-width: 0; }
.ep-notif-body strong { font-size: 13px; display: block; }
.ep-notif-body p { font-size: 12px; color: var(--ep-text-muted); margin: 2px 0 4px; line-height: 1.4; }
.ep-notif-body small { font-size: 11px; color: var(--ep-text-light); }

.ep-notif-footer {
    padding: 10px;
    text-align: center;
    border-top: 1px solid var(--ep-border);
    background: var(--ep-surface-2);
}

/* ============================================================
   TOASTS — modern flash notifications
   ============================================================ */
.ep-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;  /* let clicks pass through gaps; child toasts re-enable */
}

.ep-toast {
    position: relative;
    min-width: 360px;
    max-width: 460px;
    background: var(--ep-surface);
    border: 1px solid var(--ep-border);
    border-left: 4px solid var(--ep-primary);
    border-radius: 12px;
    box-shadow: 0 18px 38px -10px rgba(15,23,42,0.20), 0 4px 12px -3px rgba(15,23,42,0.08);
    padding: 14px 16px 16px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    animation: epToastSlideIn .28s cubic-bezier(.22,.61,.36,1);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: auto;
}
/* Variant accent — solid colours only (no alpha) so the toast stays opaque
   over any background (e.g. the dark brand panel on the login page). */
.ep-toast-success { border-left-color: var(--ep-success); background: linear-gradient(90deg, #ecfdf5 0%, #ffffff 55%); }
.ep-toast-danger  { border-left-color: var(--ep-danger);  background: linear-gradient(90deg, #fef2f2 0%, #ffffff 55%); }
.ep-toast-warning { border-left-color: var(--ep-warning); background: linear-gradient(90deg, #fffbeb 0%, #ffffff 55%); }
.ep-toast-info    { border-left-color: var(--ep-info);    background: linear-gradient(90deg, #ecfeff 0%, #ffffff 55%); }

/* Circular icon badge — variant-coloured tint, bigger icon */
.ep-toast-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--ep-primary-100);
    color: var(--ep-primary);
    line-height: 1;
}
.ep-toast-icon iconify-icon {
    font-size: 26px !important;
    display: block;
    line-height: 1;
}
.ep-toast-success .ep-toast-icon { background: var(--ep-success-bg); color: var(--ep-success); }
.ep-toast-danger  .ep-toast-icon { background: var(--ep-danger-bg);  color: var(--ep-danger);  }
.ep-toast-warning .ep-toast-icon { background: var(--ep-warning-bg); color: var(--ep-warning); }
.ep-toast-info    .ep-toast-icon { background: var(--ep-info-bg);    color: var(--ep-info);    }

/* Body — vertical stacking enforced */
.ep-toast-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ep-toast-body strong {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ep-text);
    line-height: 1.3;
    margin: 0;
}
.ep-toast-body small {
    display: block;
    font-size: 13px;
    color: var(--ep-text-muted);
    line-height: 1.45;
    margin: 0;
    word-wrap: break-word;
}
/* Variant-tinted title for better visual grouping */
.ep-toast-success .ep-toast-body strong { color: var(--ep-success-text); }
.ep-toast-danger  .ep-toast-body strong { color: var(--ep-danger-text);  }
.ep-toast-warning .ep-toast-body strong { color: var(--ep-warning-text); }
.ep-toast-info    .ep-toast-body strong { color: var(--ep-info-text);    }

/* Close button */
.ep-toast-close {
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--ep-text-light);
    padding: 4px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: all .15s;
}
.ep-toast-close:hover { background: var(--ep-surface-2); color: var(--ep-text); }
.ep-toast-close iconify-icon { font-size: 16px; }

/* Auto-dismiss progress bar */
.ep-toast-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: transparent;
    overflow: hidden;
}
.ep-toast-progress > span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--ep-primary);
    transform-origin: left;
    animation: epToastProgress linear forwards;
}
.ep-toast-success .ep-toast-progress > span { background: var(--ep-success); }
.ep-toast-danger  .ep-toast-progress > span { background: var(--ep-danger);  }
.ep-toast-warning .ep-toast-progress > span { background: var(--ep-warning); }
.ep-toast-info    .ep-toast-progress > span { background: var(--ep-info);    }

@keyframes epToastSlideIn {
    from { opacity: 0; transform: translateX(110%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes epToastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ============================================================
   TABS
   ============================================================ */
.ep-tabs {
    display: flex;
    border-bottom: 1px solid var(--ep-border);
    gap: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.ep-tab {
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: var(--ep-text-muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-family: inherit;
}

.ep-tab:hover { color: var(--ep-text); }
.ep-tab.active { color: var(--ep-primary); border-bottom-color: var(--ep-primary); font-weight: 600; }
.ep-tab iconify-icon { font-size: 16px; }
.ep-tab .ep-badge { font-size: 10px; padding: 1px 6px; }

.ep-tab-panel { display: none; }
.ep-tab-panel.active { display: block; }

/* ============================================================
   TIMELINE
   ============================================================ */
.ep-timeline { position: relative; padding-left: 30px; }
.ep-timeline::before {
    content: "";
    position: absolute;
    left: 9px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--ep-border);
}

.ep-timeline-item {
    position: relative;
    padding-bottom: 22px;
}

.ep-timeline-item::before {
    content: "";
    position: absolute;
    left: -25px; top: 6px;
    width: 14px; height: 14px;
    background: var(--ep-surface);
    border: 3px solid var(--ep-primary);
    border-radius: 50%;
}

.ep-timeline-item.success::before { border-color: var(--ep-success); }
.ep-timeline-item.warning::before { border-color: var(--ep-warning); }
.ep-timeline-item.danger::before { border-color: var(--ep-danger); }
.ep-timeline-item.muted::before { border-color: var(--ep-border-2); }

.ep-timeline-time { font-size: 11px; color: var(--ep-text-muted); margin-bottom: 2px; }
.ep-timeline-title { font-size: 13px; font-weight: 600; }
.ep-timeline-desc { font-size: 12.5px; color: var(--ep-text-muted); }

/* ============================================================
   WORKFLOW STEPPER
   ============================================================ */
.ep-stepper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    margin-bottom: 24px;
}

.ep-step {
    flex: 1;
    min-width: 140px;
    padding: 14px;
    background: var(--ep-surface);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.ep-step > div:last-child { min-width: 0; flex: 1; }

.ep-step.done { background: var(--ep-success-bg); border-color: var(--ep-success); }
.ep-step.current { background: var(--ep-primary-50); border-color: var(--ep-primary); }
.ep-step.cancel { background: var(--ep-danger-bg); border-color: var(--ep-danger); }

.ep-step-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--ep-surface-2);
    color: var(--ep-text-muted);
    display: grid; place-items: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.ep-step.done .ep-step-num { background: var(--ep-success); color: #fff; }
.ep-step.current .ep-step-num { background: var(--ep-primary); color: #fff; }
.ep-step.cancel .ep-step-num { background: var(--ep-danger); color: #fff; }

.ep-step-label {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ep-step-meta { font-size: 11px; color: var(--ep-text-muted); margin-top: 1px; }

/* ============================================================
   UTILITIES
   ============================================================ */
.ep-flex { display: flex; }
.ep-flex-col { display: flex; flex-direction: column; }
.ep-items-center { align-items: center; }
.ep-justify-between { justify-content: space-between; }
.ep-justify-end { justify-content: flex-end; }
.ep-gap-1 { gap: 4px; }
.ep-gap-2 { gap: 8px; }
.ep-gap-3 { gap: 12px; }
.ep-gap-4 { gap: 16px; }
.ep-gap-6 { gap: 24px; }

.ep-w-full { width: 100%; }

.ep-text-sm { font-size: 12px; }
.ep-text-xs { font-size: 11px; }
.ep-text-lg { font-size: 15px; }
.ep-text-xl { font-size: 18px; font-weight: 600; }
.ep-text-2xl { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.ep-text-muted { color: var(--ep-text-muted); }
.ep-text-primary { color: var(--ep-primary); }
.ep-text-success { color: var(--ep-success-text); }
.ep-text-danger { color: var(--ep-danger-text); }
.ep-text-warning { color: var(--ep-warning-text); }
.ep-font-bold { font-weight: 700; }
.ep-font-semibold { font-weight: 600; }
.ep-font-mono { font-family: var(--ep-font-mono); }

.ep-mb-0 { margin-bottom: 0; }
.ep-mb-1 { margin-bottom: 4px; }
.ep-mb-2 { margin-bottom: 8px; }
.ep-mb-3 { margin-bottom: 12px; }
.ep-mb-4 { margin-bottom: 16px; }
.ep-mb-6 { margin-bottom: 24px; }
.ep-mt-2 { margin-top: 8px; }
.ep-mt-4 { margin-top: 16px; }
.ep-mt-6 { margin-top: 24px; }

.ep-grid { display: grid; }
.ep-grid-2 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ep-grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ep-grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 992px) { .ep-grid-3, .ep-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ep-grid-2, .ep-grid-3, .ep-grid-4 { grid-template-columns: 1fr; } }

.ep-hr { height: 1px; background: var(--ep-border); border: 0; margin: 16px 0; }

.ep-rounded { border-radius: var(--ep-radius); }
.ep-rounded-sm { border-radius: var(--ep-radius-sm); }
.ep-rounded-full { border-radius: 999px; }

.ep-divider {
    text-align: center;
    margin: 18px 0;
    color: var(--ep-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    position: relative;
}
.ep-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--ep-border); }
.ep-divider span { background: var(--ep-surface); padding: 0 14px; position: relative; }

/* ============================================================
   AUTH PAGE (login / register) — split-screen layout
   ============================================================ */
body.ep-auth-body {
    margin: 0;
    min-height: 100vh;
    background: #fff;
    overflow-x: hidden;
}

.ep-auth-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    background: var(--ep-surface);
}

@media (max-width: 980px) {
    .ep-auth-shell { grid-template-columns: 1fr; min-height: auto; }
    .ep-auth-aside { display: none; }
}

/* ===== LEFT — Form panel ===== */
.ep-auth-form {
    position: relative;
    padding: 32px 56px 40px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
}
@media (max-width: 980px) {
    .ep-auth-form { min-height: 100vh; max-height: none; padding: 24px 20px 32px; }
}

.ep-auth-lang {
    position: absolute;
    top: 28px;
    right: 28px;
    z-index: 5;
}
.ep-auth-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--ep-border);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: var(--ep-text);
    cursor: pointer;
    transition: border-color .15s;
}
.ep-auth-lang-btn:hover { border-color: var(--ep-primary-200); }
.ep-auth-lang-flag {
    width: 22px; height: 14px;
    display: inline-block;
    flex-shrink: 0;
    border-radius: 2px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 14'><rect width='28' height='14' fill='%23cc0001'/><rect y='1' width='28' height='1' fill='%23fff'/><rect y='3' width='28' height='1' fill='%23fff'/><rect y='5' width='28' height='1' fill='%23fff'/><rect y='7' width='28' height='1' fill='%23fff'/><rect y='9' width='28' height='1' fill='%23fff'/><rect y='11' width='28' height='1' fill='%23fff'/><rect y='13' width='28' height='1' fill='%23fff'/><rect width='11' height='7' fill='%23010066'/><circle cx='6.5' cy='3.5' r='2.3' fill='%23ffcc00'/><circle cx='7.1' cy='3.5' r='1.8' fill='%23010066'/></svg>");
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0,0,0,0.08);
}

.ep-auth-inner {
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 60px 0 32px;
}

/* Logo shown directly above the greeting on the form side */
.ep-auth-form-brand {
    text-align: center;
    margin-bottom: 12px;
    line-height: 0;
}
.ep-auth-form-brand img {
    width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.ep-auth-greeting {
    text-align: center;
    margin-bottom: 26px;
}
.ep-auth-greeting h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ep-text);
    margin: 0 0 6px;
    letter-spacing: -.02em;
}
.ep-auth-greeting p {
    color: var(--ep-text-muted);
    font-size: 13.5px;
    margin: 0;
}

/* Pill tabs (Email | Phone) */
.ep-auth-tabs {
    display: flex;
    gap: 6px;
    background: var(--ep-surface-2);
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 28px;
}
.ep-auth-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ep-text-muted);
    cursor: pointer;
    transition: all .2s;
}
.ep-auth-tab.active {
    background: var(--ep-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(28,61,117,0.30);
}
.ep-auth-tab iconify-icon { font-size: 16px; }

/* Form fields */
.ep-auth-inner form { display: flex; flex-direction: column; gap: 16px; }
.ep-auth-inner .ep-form-group { margin: 0; }
.ep-auth-inner .ep-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ep-text);
    margin-bottom: 7px;
}
.ep-auth-inner .ep-input,
.ep-auth-inner .ep-select {
    height: 44px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13.5px;
    border: 1px solid var(--ep-border);
}
.ep-auth-inner .ep-input:focus,
.ep-auth-inner .ep-select:focus {
    border-color: var(--ep-primary);
    box-shadow: 0 0 0 3px var(--ep-primary-100);
}

/* Inline password toggle button */
.ep-auth-pwd { position: relative; }
.ep-auth-pwd .ep-icon-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: transparent;
    color: var(--ep-text-muted);
    border: 0;
}
.ep-auth-pwd .ep-icon-btn:hover { color: var(--ep-primary); }

/* Row: Remember + Forgot */
.ep-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -2px;
    margin-bottom: 4px;
}
.ep-auth-row .ep-checkbox { font-size: 13px; color: var(--ep-text); }
.ep-auth-row a { font-size: 13px; color: var(--ep-primary); font-weight: 500; }
.ep-auth-row a:hover { text-decoration: underline; }

/* Primary submit */
.ep-auth-submit {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    background: var(--ep-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 16px rgba(28,61,117,0.30);
    transition: all .15s;
    margin-top: 8px;
}
.ep-auth-submit:hover { background: var(--ep-primary-dark); }
.ep-auth-submit:active { transform: translateY(1px); }

/* Divider with text */
.ep-auth-line {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0 18px;
}
.ep-auth-line::before, .ep-auth-line::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ep-border);
}
.ep-auth-line span {
    color: var(--ep-text-muted);
    font-size: 13px;
}

/* Secondary action buttons (two columns) */
.ep-auth-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ep-auth-actions .ep-auth-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--ep-border);
    border-radius: 8px;
    background: #fff;
    color: var(--ep-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.ep-auth-actions .ep-auth-action:hover {
    border-color: var(--ep-primary);
    color: var(--ep-primary);
    background: var(--ep-primary-50);
}
.ep-auth-actions .ep-auth-action iconify-icon { font-size: 18px; }

/* Footer link */
.ep-auth-bottom {
    text-align: center;
    margin-top: 24px;
    font-size: 13.5px;
    color: var(--ep-text-muted);
}
.ep-auth-bottom a {
    color: var(--ep-primary);
    font-weight: 600;
    text-decoration: underline;
}

/* ===== RIGHT — Brand panel ===== */
.ep-auth-aside {
    /* Olive-green brand gradient — matches the official ePerolehan green */
    background: linear-gradient(135deg, #1c3d75 0%, #0a1a36 100%);
    color: #fff;
    padding: 60px 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

/* Hexagon decorative pattern (SVG) */
.ep-auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='92' viewBox='0 0 80 92'><path d='M40 0 L80 23 L80 69 L40 92 L0 69 L0 23 Z' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'/></svg>");
    background-size: 90px 104px;
    opacity: 1;
    pointer-events: none;
}
/* Soft radial accent */
.ep-auth-aside::after {
    content: "";
    position: absolute;
    top: -200px; right: -180px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(147,197,253,0.22) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

.ep-auth-aside > * { position: relative; z-index: 1; }

.ep-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 36px;
    letter-spacing: -.01em;
}
.ep-auth-brand .mark {
    width: 44px; height: 44px;
    object-fit: contain;
}

/* Dashboard preview card */
.ep-auth-preview {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.35);
    width: 100%;
    max-width: 520px;
    color: var(--ep-text);
    overflow: hidden;
}
.ep-auth-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--ep-border);
    margin-bottom: 12px;
}
.ep-auth-preview-head .pv-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}
.ep-auth-preview-head .pv-title iconify-icon { color: var(--ep-primary); font-size: 18px; }
.ep-auth-preview-head .pv-crumb {
    font-size: 11px;
    color: var(--ep-text-muted);
}
.ep-auth-preview-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.ep-auth-preview-stat {
    background: var(--ep-surface-2);
    border-radius: 8px;
    padding: 10px;
}
.ep-auth-preview-stat .pv-label {
    font-size: 9.5px;
    color: var(--ep-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ep-auth-preview-stat .pv-value {
    font-size: 17px;
    font-weight: 700;
    margin-top: 2px;
}
.ep-auth-preview-stat.pv-success { background: #ecfdf5; }
.ep-auth-preview-stat.pv-success .pv-value { color: #059669; }
.ep-auth-preview-stat.pv-warn { background: #fffbeb; }
.ep-auth-preview-stat.pv-warn .pv-value { color: #d97706; }
.ep-auth-preview-stat.pv-info { background: #eff6ff; }
.ep-auth-preview-stat.pv-info .pv-value { color: #2563eb; }

.ep-auth-preview-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 130px;
    padding: 12px 4px 0;
    border-top: 1px dashed var(--ep-border);
}
.ep-auth-preview-chart .bar {
    flex: 1;
    background: linear-gradient(180deg, var(--ep-primary-500), var(--ep-primary-700));
    border-radius: 3px 3px 0 0;
    opacity: 0.85;
}
.ep-auth-preview-chart .bar.muted { background: var(--ep-border); }

/* Recent activity list inside preview card */
.ep-auth-preview-list {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--ep-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ep-auth-preview-list .pv-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--ep-surface-2);
    border-radius: 6px;
    font-size: 11.5px;
}
.ep-auth-preview-list .pv-row-name {
    flex: 1;
    font-weight: 600;
    color: var(--ep-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ep-auth-preview-list .pv-row-meta {
    color: var(--ep-text-muted);
    font-size: 11px;
    font-weight: 600;
}
.ep-auth-preview-list .pv-row-badge {
    font-size: 9.5px;
    padding: 3px 8px;
    border-radius: 100px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.ep-auth-preview-list .pv-row-badge.pv-success { background: #d1fae5; color: #059669; }
.ep-auth-preview-list .pv-row-badge.pv-info    { background: #dbeafe; color: #2563eb; }
.ep-auth-preview-list .pv-row-badge.pv-warn    { background: #fef3c7; color: #d97706; }

/* Headline + description */
.ep-auth-headline {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    margin: 44px 0 14px;
    letter-spacing: -.01em;
    max-width: 580px;
}
.ep-auth-desc {
    color: rgba(255,255,255,0.82);
    font-size: 14px;
    text-align: center;
    line-height: 1.65;
    max-width: 540px;
    margin: 0;
}

/* Aside footer credit */
.ep-auth-aside-foot {
    position: absolute;
    bottom: 20px;
    left: 0; right: 0;
    text-align: center;
    color: rgba(255,255,255,0.55);
    font-size: 11.5px;
    padding: 0 24px;
    z-index: 1;
}

/* Compact mode for the register page (scrolls the long form on the left) */
.ep-auth-shell.is-register .ep-auth-inner {
    max-width: 600px;
    padding: 56px 0 28px;
}

/* Form section group (used inside register) */
.ep-auth-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--ep-border);
}
.ep-auth-section:last-of-type { border-bottom: none; }
.ep-auth-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--ep-primary);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
}
.ep-auth-section .req { color: var(--ep-danger); margin-left: 2px; }

/* Kod Bidang picker */
.ep-auth-kb {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--ep-border);
    border-radius: 8px;
    padding: 14px;
    background: var(--ep-surface-2);
}
.ep-auth-kb-cat {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ep-primary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 8px 0 8px;
}
.ep-auth-kb-cat:first-child { margin-top: 0; }
.ep-auth-kb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}
.ep-auth-kb-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid var(--ep-border);
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}
.ep-auth-kb-item:hover { border-color: var(--ep-primary-200); background: var(--ep-primary-50); }
.ep-auth-kb-item input { margin-top: 2px; }
@media (max-width: 760px) {
    .ep-auth-kb-grid { grid-template-columns: 1fr; }
}

/* Language button flash feedback */
.ep-auth-lang-btn.is-flash { background: var(--ep-primary-50); border-color: var(--ep-primary); }

/* ============================================================
   AVATARS + SMALL UI
   ============================================================ */
.ep-row-avatar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ep-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--ep-surface-2);
    overflow: hidden;
}
.ep-progress > span {
    display: block;
    height: 100%;
    background: var(--ep-primary);
    border-radius: 3px;
    transition: width .25s;
}

/* Empty state inside card */
.ep-empty {
    text-align: center;
    padding: 36px 16px;
    color: var(--ep-text-muted);
}
.ep-empty > iconify-icon { font-size: 48px; color: var(--ep-border-2); display: block; margin: 0 auto 8px; }
/* Reset icons that live INSIDE buttons/badges inside the empty state */
.ep-empty .ep-btn iconify-icon,
.ep-empty .ep-badge iconify-icon {
    font-size: inherit;
    color: inherit;
    display: inline-flex;
    margin: 0;
}
.ep-empty p { font-size: 13px; }

/* KBD */
.ep-kbd {
    display: inline-block;
    padding: 1px 6px;
    background: var(--ep-surface-2);
    border: 1px solid var(--ep-border);
    border-radius: 4px;
    font-family: var(--ep-font-mono);
    font-size: 11px;
}

/* Spinner */
.ep-spinner {
    width: 18px; height: 18px;
    border: 2.5px solid var(--ep-border);
    border-top-color: var(--ep-primary);
    border-radius: 50%;
    animation: epSpin .8s linear infinite;
    display: inline-block;
}
@keyframes epSpin { to { transform: rotate(360deg); } }

/* DataTables: blend table with our look */
table.ep-table.dataTable {
    border-collapse: collapse !important;
}
table.ep-table.dataTable thead th {
    border-bottom: 1px solid var(--ep-border) !important;
}

/* Workflow status badges (state -> color) */
.ep-status-Draft       { background: var(--ep-surface-2);  color: var(--ep-text-muted); }
.ep-status-PendingApproval { background: var(--ep-warning-bg); color: var(--ep-warning-text); }
.ep-status-Published   { background: var(--ep-success-bg); color: var(--ep-success-text); }
.ep-status-Briefing    { background: var(--ep-info-bg); color: var(--ep-info-text); }
.ep-status-Closed      { background: var(--ep-warning-bg); color: var(--ep-warning-text); }
.ep-status-Opening     { background: var(--ep-purple-bg); color: var(--ep-purple); }
.ep-status-Evaluation  { background: var(--ep-purple-bg); color: var(--ep-purple); }
.ep-status-Recommended { background: var(--ep-success-bg); color: var(--ep-success-text); }
.ep-status-Approved    { background: var(--ep-success-bg); color: var(--ep-success-text); }
.ep-status-Awarded     { background: var(--ep-success-bg); color: var(--ep-success-text); }
.ep-status-Cancelled   { background: var(--ep-danger-bg);  color: var(--ep-danger-text); }
.ep-status-Rejected    { background: var(--ep-danger-bg);  color: var(--ep-danger-text); }
.ep-status-Verified    { background: var(--ep-success-bg); color: var(--ep-success-text); }
.ep-status-Pending     { background: var(--ep-warning-bg); color: var(--ep-warning-text); }
.ep-status-Suspended   { background: var(--ep-danger-bg);  color: var(--ep-danger-text); }

/* ============================================================
   PEMBUKA & PENILAI feedback cards — modern UX (shared across
   vendor-submission view, dokumen view tabs, kelulusan comparison)
   ============================================================ */
.ep-pb-hero { display: flex; align-items: center; gap: 18px; padding: 18px; background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); border: 1px solid var(--ep-border); border-radius: 12px; margin-bottom: 16px; }
.ep-pb-ring { width: 104px; height: 104px; flex-shrink: 0; border-radius: 50%; background: conic-gradient(var(--ring-color, var(--ep-primary)) calc(var(--ring-pct, 0) * 1%), #e2e8f0 0); display: flex; align-items: center; justify-content: center; position: relative; }
.ep-pb-ring-inner { width: 84px; height: 84px; background: #fff; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1; }
.ep-pb-ring-pct { font-size: 22px; font-weight: 800; color: var(--ring-color, var(--ep-primary)); line-height: 1; margin: 0; }
.ep-pb-ring-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ep-text-muted); margin-top: 5px; font-weight: 700; line-height: 1; }
.ep-pb-hero-meta { flex: 1; }
.ep-pb-hero-title { font-size: 17px; font-weight: 700; color: var(--ep-text); margin-bottom: 4px; }
.ep-pb-hero-sub { font-size: 13px; color: var(--ep-text-muted); line-height: 1.5; }
.ep-pb-hero-sub strong { color: var(--ep-text); }

.ep-pb-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.ep-pb-tiles.is-five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 640px) { .ep-pb-tiles, .ep-pb-tiles.is-five { grid-template-columns: repeat(2, 1fr); } }
.ep-pb-tile { text-align: center; padding: 14px 10px; border-radius: 10px; border: 1px solid; transition: transform .15s ease; }
.ep-pb-tile:hover { transform: translateY(-2px); }
.ep-pb-tile-ic { width: 36px; height: 36px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.ep-pb-tile-num { font-size: 22px; font-weight: 800; line-height: 1; }
.ep-pb-tile-label { font-size: 11px; color: var(--ep-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; font-weight: 600; }
.ep-pb-tile.is-success { background: #ecfdf5; border-color: #a7f3d0; }
.ep-pb-tile.is-success .ep-pb-tile-ic { background: rgba(16,185,129,0.18); color: #047857; }
.ep-pb-tile.is-success .ep-pb-tile-num { color: #047857; }
.ep-pb-tile.is-warning { background: #fffbeb; border-color: #fde68a; }
.ep-pb-tile.is-warning .ep-pb-tile-ic { background: rgba(245,158,11,0.18); color: #b45309; }
.ep-pb-tile.is-warning .ep-pb-tile-num { color: #b45309; }
.ep-pb-tile.is-danger { background: #fef2f2; border-color: #fecaca; }
.ep-pb-tile.is-danger .ep-pb-tile-ic { background: rgba(239,68,68,0.18); color: #b91c1c; }
.ep-pb-tile.is-danger .ep-pb-tile-num { color: #b91c1c; }
.ep-pb-tile.is-muted { background: var(--ep-surface-2); border-color: var(--ep-border); }
.ep-pb-tile.is-muted .ep-pb-tile-ic { background: #e2e8f0; color: #64748b; }
.ep-pb-tile.is-muted .ep-pb-tile-num { color: var(--ep-text); }
.ep-pb-tile.is-info { background: #eff6ff; border-color: #bfdbfe; }
.ep-pb-tile.is-info .ep-pb-tile-ic { background: rgba(59,130,246,0.15); color: #1d4ed8; }
.ep-pb-tile.is-info .ep-pb-tile-num { color: #1d4ed8; }

.ep-pb-findings { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.ep-pb-findings-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #92400e; margin-bottom: 10px; }
.ep-pb-findings-title iconify-icon { color: #d97706; font-size: 16px; }
.ep-pb-findings-list { display: flex; flex-direction: column; gap: 8px; }
.ep-pb-finding-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: #fff; border-radius: 8px; border: 1px solid var(--ep-border); }
.ep-pb-finding-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-size: 16px; }
.ep-pb-finding-row.is-missing .ep-pb-finding-ic { background: rgba(239,68,68,0.12); color: #b91c1c; }
.ep-pb-finding-row.is-expired .ep-pb-finding-ic { background: rgba(245,158,11,0.15); color: #b45309; }
.ep-pb-finding-body { flex: 1; min-width: 0; }
.ep-pb-finding-name { font-size: 13.5px; font-weight: 600; color: var(--ep-text); }
.ep-pb-finding-note { font-size: 12px; color: var(--ep-text-muted); margin-top: 2px; line-height: 1.45; }

.ep-pb-catatan { background: #fffbeb; border-left: 3px solid #f59e0b; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.ep-pb-catatan-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #92400e; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.ep-pb-catatan p { margin: 0; font-size: 13px; color: var(--ep-text); line-height: 1.55; }

.ep-pb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px dashed var(--ep-border); flex-wrap: wrap; }
.ep-pb-foot-actor { display: flex; align-items: center; gap: 10px; }
.ep-pb-foot-actor strong { font-size: 13px; color: var(--ep-text); display: block; line-height: 1.2; }
.ep-pb-foot-label { font-size: 10.5px; color: var(--ep-text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 1px; }
.ep-pb-foot-date { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ep-text-muted); font-weight: 500; }
.ep-pb-foot-date iconify-icon { color: var(--ep-primary); font-size: 14px; }

.ep-pn-hero { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 20px; background: linear-gradient(135deg, var(--ep-primary-50) 0%, #f8fafc 100%); border: 1px solid var(--ep-primary-200); border-radius: 12px; margin-bottom: 18px; }
@media (max-width: 600px) { .ep-pn-hero { grid-template-columns: 1fr; } }
.ep-pn-hero-score { min-width: 0; }
.ep-pn-hero-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--ep-text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.ep-pn-hero-label iconify-icon { color: var(--ep-primary); font-size: 14px; }
.ep-pn-hero-number { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.ep-pn-hero-number .big { font-size: 38px; font-weight: 800; color: var(--ep-primary); line-height: 1; letter-spacing: -.02em; }
.ep-pn-hero-number .max { font-size: 16px; font-weight: 600; color: var(--ep-text-muted); }
.ep-pn-hero-bar { height: 8px; background: #e2e8f0; border-radius: 100px; overflow: hidden; margin-bottom: 6px; }
.ep-pn-hero-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--ep-primary-500), var(--ep-primary-700)); border-radius: 100px; transition: width .4s ease; }
.ep-pn-hero-pct { font-size: 11.5px; color: var(--ep-text-muted); font-weight: 500; }
.ep-pn-hero-rank { width: 110px; text-align: center; padding: 12px 8px; background: #fff; border-radius: 12px; border: 1px solid var(--ep-primary-200); box-shadow: 0 2px 6px rgba(28,61,117,0.08); }
.ep-pn-hero-rank-ic { width: 44px; height: 44px; margin: 0 auto 4px; border-radius: 50%; background: linear-gradient(135deg, #fef3c7, #fde047); color: #b45309; display: grid; place-items: center; font-size: 22px; }
.ep-pn-hero-rank-num { font-size: 26px; font-weight: 800; color: var(--ep-primary); line-height: 1; }
.ep-pn-hero-rank-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ep-text-muted); margin-top: 4px; font-weight: 600; }

.ep-pn-cats-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--ep-text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.ep-pn-cats-title iconify-icon { color: var(--ep-primary); font-size: 14px; }
.ep-pn-cats { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ep-pn-cat { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--ep-surface); border: 1px solid var(--ep-border); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.ep-pn-cat:hover { box-shadow: 0 2px 8px rgba(15,23,42,0.05); }
.ep-pn-cat-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 20px; }
.ep-pn-cat.is-success .ep-pn-cat-ic { background: rgba(16,185,129,0.12); color: #047857; }
.ep-pn-cat.is-warning .ep-pn-cat-ic { background: rgba(245,158,11,0.12); color: #b45309; }
.ep-pn-cat.is-danger  .ep-pn-cat-ic { background: rgba(239,68,68,0.12);  color: #b91c1c; }
.ep-pn-cat-body { flex: 1; min-width: 0; }
.ep-pn-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.ep-pn-cat-head strong { font-size: 14px; color: var(--ep-text); }
.ep-pn-cat-score { display: inline-flex; align-items: baseline; gap: 4px; font-size: 13px; }
.ep-pn-cat-score .num { font-weight: 800; color: var(--ep-text); }
.ep-pn-cat-score .max { color: var(--ep-text-muted); font-weight: 500; }
.ep-pn-cat-score .pct { margin-left: 8px; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 700; }
.ep-pn-cat.is-success .ep-pn-cat-score .pct { background: rgba(16,185,129,0.12); color: #047857; }
.ep-pn-cat.is-warning .ep-pn-cat-score .pct { background: rgba(245,158,11,0.15); color: #b45309; }
.ep-pn-cat.is-danger  .ep-pn-cat-score .pct { background: rgba(239,68,68,0.12);  color: #b91c1c; }
.ep-pn-cat-bar { height: 6px; background: var(--ep-surface-2); border-radius: 100px; overflow: hidden; }
.ep-pn-cat-bar > span { display: block; height: 100%; border-radius: 100px; transition: width .4s ease; }
.ep-pn-cat.is-success .ep-pn-cat-bar > span { background: linear-gradient(90deg, #34d399, #059669); }
.ep-pn-cat.is-warning .ep-pn-cat-bar > span { background: linear-gradient(90deg, #fbbf24, #d97706); }
.ep-pn-cat.is-danger  .ep-pn-cat-bar > span { background: linear-gradient(90deg, #f87171, #dc2626); }

.ep-pn-catatan { background: var(--ep-primary-50); border-left: 3px solid var(--ep-primary); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.ep-pn-catatan-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--ep-primary-700); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.ep-pn-catatan p { margin: 0; font-size: 13px; color: var(--ep-text); line-height: 1.55; }

/* ============================================================
   Modern status history timeline (Sejarah Status)
   ============================================================ */
.ep-history-timeline { position: relative; padding-left: 8px; isolation: isolate; }
.ep-history-timeline::before {
    content: ''; position: absolute;
    left: 23px; top: 12px; bottom: 12px; width: 2px;
    background: linear-gradient(to bottom, var(--ep-primary) 0%, var(--ep-border) 100%);
    border-radius: 1px; z-index: 0;
}
.ep-history-item { position: relative; display: flex; gap: 16px; padding: 4px 0 18px; }
.ep-history-item:last-child { padding-bottom: 0; }
.ep-history-dot {
    position: relative;
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: #fff;
    border: 2px solid var(--ep-border);
    z-index: 2;
    box-shadow: 0 0 0 4px var(--ep-surface), 0 2px 6px rgba(0,0,0,0.06);
}
.ep-history-dot iconify-icon { font-size: 18px; color: var(--ep-text-muted); }
.ep-history-primary .ep-history-dot { border-color: var(--ep-primary); background: var(--ep-primary-50); }
.ep-history-primary .ep-history-dot iconify-icon { color: var(--ep-primary); }
.ep-history-info    .ep-history-dot { border-color: #0ea5e9; background: #e0f2fe; }
.ep-history-info    .ep-history-dot iconify-icon { color: #0284c7; }
.ep-history-success .ep-history-dot { border-color: #22c55e; background: #dcfce7; }
.ep-history-success .ep-history-dot iconify-icon { color: #15803d; }
.ep-history-warning .ep-history-dot { border-color: #f59e0b; background: #fef3c7; }
.ep-history-warning .ep-history-dot iconify-icon { color: #b45309; }
.ep-history-danger  .ep-history-dot { border-color: #ef4444; background: #fee2e2; }
.ep-history-danger  .ep-history-dot iconify-icon { color: #b91c1c; }
.ep-history-current .ep-history-dot {
    box-shadow:
        0 0 0 4px var(--ep-surface),
        0 0 0 8px rgba(28,61,117,0.18),
        0 2px 6px rgba(0,0,0,0.06);
    animation: epHistoryPulse 2s ease-in-out infinite;
}
@keyframes epHistoryPulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--ep-surface), 0 0 0 8px rgba(28,61,117,0.18), 0 2px 6px rgba(0,0,0,0.06); }
    50%      { box-shadow: 0 0 0 4px var(--ep-surface), 0 0 0 12px rgba(28,61,117,0.05), 0 2px 6px rgba(0,0,0,0.06); }
}
.ep-history-content { flex: 1; padding: 12px 16px; background: #fff; border: 1px solid var(--ep-border); border-radius: 10px; transition: all .15s ease; }
.ep-history-content:hover { border-color: var(--ep-primary-200); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.ep-history-current .ep-history-content { background: linear-gradient(135deg, var(--ep-primary-50), transparent); border-color: var(--ep-primary); }
.ep-history-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ep-history-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; }
.ep-history-time { font-size: 11.5px; color: var(--ep-text-muted); white-space: nowrap; }
.ep-history-msg { font-size: 13px; color: var(--ep-text); margin: 6px 0 4px; line-height: 1.5; }
.ep-history-meta { font-size: 11.5px; color: var(--ep-text-muted); display: flex; align-items: center; gap: 4px; }
.ep-history-meta iconify-icon { font-size: 13px; }

/* ============================================================
   Penilai detail modal — 3 metric cards (Skor / Kedudukan / Keputusan)
   ============================================================ */
.ep-pn-modal-hero {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
@media (max-width: 720px) { .ep-pn-modal-hero { grid-template-columns: 1fr; } }
.ep-pn-modal-card {
    position: relative;
    padding: 18px;
    background: var(--ep-surface);
    border: 1px solid var(--ep-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.ep-pn-modal-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px -8px rgba(15,23,42,0.12); }
.ep-pn-modal-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--ep-border-2);
}
.ep-pn-modal-card.is-primary { background: linear-gradient(135deg, var(--ep-primary-50), #fff); border-color: var(--ep-primary-200); }
.ep-pn-modal-card.is-primary::before { background: linear-gradient(90deg, var(--ep-primary-500), var(--ep-primary-700)); }
.ep-pn-modal-card.is-rank    { background: linear-gradient(135deg, #fffbeb, #fff); border-color: #fde68a; }
.ep-pn-modal-card.is-rank::before { background: linear-gradient(90deg, #fbbf24, #d97706); }
.ep-pn-modal-card.is-success { background: linear-gradient(135deg, #ecfdf5, #fff); border-color: #a7f3d0; }
.ep-pn-modal-card.is-success::before { background: linear-gradient(90deg, #34d399, #059669); }
.ep-pn-modal-card.is-info    { background: linear-gradient(135deg, #eff6ff, #fff); border-color: #bfdbfe; }
.ep-pn-modal-card.is-info::before    { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.ep-pn-modal-card.is-warning { background: linear-gradient(135deg, #fffbeb, #fff); border-color: #fde68a; }
.ep-pn-modal-card.is-warning::before { background: linear-gradient(90deg, #fbbf24, #d97706); }
.ep-pn-modal-card.is-danger  { background: linear-gradient(135deg, #fef2f2, #fff); border-color: #fecaca; }
.ep-pn-modal-card.is-danger::before  { background: linear-gradient(90deg, #f87171, #dc2626); }
.ep-pn-modal-card.is-muted   { background: var(--ep-surface-2); border-color: var(--ep-border); }
.ep-pn-modal-card.is-muted::before   { background: var(--ep-border-2); }

.ep-pn-modal-ic {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 22px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.65);
    color: var(--ep-primary);
    box-shadow: 0 2px 8px rgba(15,23,42,0.06);
}
.ep-pn-modal-ic.is-medal   { background: linear-gradient(135deg, #fef3c7, #fde047); color: #b45309; }
.ep-pn-modal-ic.is-success { color: #047857; }
.ep-pn-modal-ic.is-info    { color: #0369a1; }
.ep-pn-modal-ic.is-warning { color: #b45309; }
.ep-pn-modal-ic.is-danger  { color: #b91c1c; }
.ep-pn-modal-ic.is-muted   { color: #475569; }

.ep-pn-modal-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ep-text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 4px;
}
.ep-pn-modal-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--ep-primary);
    line-height: 1;
    letter-spacing: -.02em;
    margin-bottom: 10px;
}
.ep-pn-modal-card.is-rank .ep-pn-modal-value { color: #b45309; }
.ep-pn-modal-card.is-success .ep-pn-modal-value { color: #047857; }
.ep-pn-modal-card.is-info    .ep-pn-modal-value { color: #0369a1; }
.ep-pn-modal-card.is-warning .ep-pn-modal-value { color: #b45309; }
.ep-pn-modal-card.is-danger  .ep-pn-modal-value { color: #b91c1c; }
.ep-pn-modal-card.is-muted   .ep-pn-modal-value { color: var(--ep-text); }
.ep-pn-modal-max {
    font-size: 14px;
    font-weight: 600;
    color: var(--ep-text-muted);
    margin-left: 4px;
}
.ep-pn-modal-bar {
    height: 6px;
    background: rgba(15,23,42,0.08);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 6px;
}
.ep-pn-modal-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--ep-primary-500), var(--ep-primary-700));
    border-radius: 100px;
    transition: width .4s ease;
}
.ep-pn-modal-hint {
    font-size: 11.5px;
    color: var(--ep-text-muted);
    line-height: 1.45;
}

/* ============================================================
   Kod Bidang picker (form tender)
   ============================================================ */
.ep-kb-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--ep-surface-2);
    border-radius: var(--ep-radius-md);
    border: 1px solid var(--ep-border);
}
.ep-kb-search {
    flex: 1;
    min-width: 260px;
    position: relative;
    display: flex;
    align-items: center;
}
.ep-kb-search iconify-icon {
    position: absolute;
    left: 12px;
    color: var(--ep-text-muted);
    font-size: 16px;
    pointer-events: none;
}
.ep-kb-search input[type="search"] {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-sm);
    background: #fff;
    font-size: 13.5px;
    transition: border-color .2s, box-shadow .2s;
}
.ep-kb-search input[type="search"]:focus {
    outline: none;
    border-color: var(--ep-primary);
    box-shadow: 0 0 0 3px rgba(28, 61, 117, .12);
}
.ep-kb-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ep-kb-count {
    font-size: 13px;
    padding: 6px 12px;
    background: #fff;
    border-radius: 100px;
    border: 1px solid var(--ep-border);
}
.ep-kb-count strong { color: var(--ep-primary); font-size: 14px; }

.ep-kb-group {
    margin-bottom: 14px;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-md);
    overflow: hidden;
    background: #fff;
}
.ep-kb-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--ep-surface-2);
    border-bottom: 1px solid var(--ep-border);
}
.ep-kb-cat-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ep-text);
    margin: 0;
}
.ep-kb-cat-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--ep-primary);
}
.ep-kb-group-count {
    font-size: 12px;
    color: var(--ep-text-muted);
    font-variant-numeric: tabular-nums;
}
.ep-kb-group-count .ep-kb-group-selected {
    font-weight: 600;
    color: var(--ep-primary);
}
.ep-kb-group-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px;
}
@media (max-width: 1100px) { .ep-kb-group-body { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .ep-kb-group-body { grid-template-columns: 1fr; } }

.ep-kb-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-sm);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    margin: 0;
}
.ep-kb-item:hover {
    background: var(--ep-surface-2);
    border-color: var(--ep-primary-200, #cbd5e1);
}
.ep-kb-item.is-checked {
    background: rgba(28, 61, 117, 0.06);
    border-color: var(--ep-primary);
}
.ep-kb-item input[type="checkbox"] {
    margin-top: 3px;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--ep-primary);
}
.ep-kb-item-body {
    flex: 1;
    min-width: 0;
}
.ep-kb-item-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ep-primary);
    margin-bottom: 2px;
}
.ep-kb-item-name {
    font-size: 12px;
    color: var(--ep-text-muted);
    line-height: 1.4;
    word-break: break-word;
}
.ep-kb-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--ep-text-muted);
}
.ep-kb-empty iconify-icon {
    font-size: 40px;
    margin-bottom: 12px;
    color: var(--ep-text-muted);
}
.ep-kb-empty p { margin: 0; font-size: 13px; }

/* ============================================================
   Lampiran rows (form tender)
   ============================================================ */
.ep-lampiran-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-md);
    transition: border-color .15s, box-shadow .15s;
}
.ep-lampiran-row:hover {
    border-color: var(--ep-primary-200, #cbd5e1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.ep-lampiran-existing { background: var(--ep-surface-2); }
.ep-lampiran-new      { border-style: dashed; border-color: var(--ep-primary-200, #cbd5e1); background: rgba(28, 61, 117, 0.025); }
.ep-lampiran-row-main {
    flex: 1;
    min-width: 250px;
}
.ep-lampiran-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ep-lampiran-file-icon {
    font-size: 28px;
    color: var(--ep-primary);
    flex-shrink: 0;
}
.ep-lampiran-file-meta {
    flex: 1;
    min-width: 0;
}
.ep-lampiran-file-name {
    display: block;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ep-text);
    text-decoration: none;
    word-break: break-all;
    line-height: 1.4;
}
.ep-lampiran-file-name:hover { color: var(--ep-primary); text-decoration: underline; }
.ep-lampiran-file-sub {
    display: flex;
    gap: 6px;
    font-size: 11.5px;
    color: var(--ep-text-muted);
    margin-top: 3px;
}
.ep-lampiran-row-controls {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}
.ep-lampiran-row-controls .ep-form-group {
    margin: 0;
    min-width: 140px;
}
.ep-lampiran-empty {
    padding: 32px;
    text-align: center;
    color: var(--ep-text-muted);
    border: 2px dashed var(--ep-border);
    border-radius: var(--ep-radius-md);
    background: var(--ep-surface-2);
}
.ep-lampiran-empty iconify-icon {
    font-size: 36px;
    margin-bottom: 8px;
    color: var(--ep-text-muted);
    display: block;
}
.ep-lampiran-empty p { margin: 0; font-size: 13px; }

/* Small label + small select/input variants (shared) */
.ep-label-xs {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--ep-text-muted);
    margin-bottom: 4px;
}
.ep-select-sm, .ep-input-sm {
    padding: 6px 10px !important;
    font-size: 12.5px !important;
    min-height: 32px;
}
.ep-select-sm { padding-right: 28px !important; }

/* ============================================================
   Rich-content (CKEditor output) consistent typography
   ============================================================ */
.ep-rich-content { line-height: 1.65; font-size: 14px; color: var(--ep-text); }
.ep-rich-content h1, .ep-rich-content h2, .ep-rich-content h3, .ep-rich-content h4 {
    margin: 1.4em 0 0.5em;
    font-weight: 700;
    color: var(--ep-text);
}
.ep-rich-content h1 { font-size: 1.6em; }
.ep-rich-content h2 { font-size: 1.35em; }
.ep-rich-content h3 { font-size: 1.18em; }
.ep-rich-content h4 { font-size: 1.05em; }
.ep-rich-content p { margin: 0 0 1em; }
.ep-rich-content ul, .ep-rich-content ol { margin: 0 0 1em 1.4em; padding: 0; }
.ep-rich-content ul li, .ep-rich-content ol li { margin-bottom: 0.35em; }
.ep-rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}
.ep-rich-content th, .ep-rich-content td {
    border: 1px solid var(--ep-border);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}
.ep-rich-content th { background: var(--ep-surface-2); font-weight: 600; }
.ep-rich-content blockquote {
    border-left: 3px solid var(--ep-primary);
    padding: 6px 14px;
    margin: 1em 0;
    background: var(--ep-surface-2);
    color: var(--ep-text-muted);
    font-style: italic;
}
.ep-rich-content a { color: var(--ep-primary); text-decoration: underline; }
.ep-rich-content code {
    background: var(--ep-surface-2);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}
.ep-rich-content img { max-width: 100%; height: auto; border-radius: var(--ep-radius-sm); }

/* CKEditor container fit */
.ck-editor__editable { min-height: 320px !important; }
.ck.ck-editor { border-radius: var(--ep-radius-sm); }

/* ============================================================
   Lampiran Iklan (sidebar list on submit page)
   ============================================================ */
.ep-lampiran-iklan-list { display: flex; flex-direction: column; }
.ep-lampiran-iklan-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid var(--ep-border);
    transition: background .15s;
}
.ep-lampiran-iklan-item:first-child { border-top: 0; }
.ep-lampiran-iklan-item:hover { background: var(--ep-surface-2); }
.ep-lampiran-iklan-icon {
    flex-shrink: 0;
    font-size: 22px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
}
.ep-lampiran-iklan-meta {
    flex: 1;
    min-width: 0;
}
.ep-lampiran-iklan-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ep-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ep-lampiran-iklan-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 11px;
    color: var(--ep-text-muted);
    flex-wrap: wrap;
}
.ep-lampiran-iklan-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* ============================================================
   File preview modal (PDF / image / fallback)
   ============================================================ */
.ep-preview-body {
    padding: 0 !important;
    background: #1e293b;
    display: flex;
    flex-direction: column;
}
.ep-preview-frame-wrap {
    flex: 1;
    min-height: 65vh;
    width: 100%;
    background: #475569;
    display: flex;
}
.ep-preview-frame {
    flex: 1;
    width: 100%;
    border: 0;
    min-height: 65vh;
    background: #fff;
}
.ep-preview-img-wrap {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px;
    min-height: 65vh;
    overflow: auto;
    background:
        linear-gradient(45deg, #374151 25%, transparent 25%),
        linear-gradient(-45deg, #374151 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #374151 75%),
        linear-gradient(-45deg, transparent 75%, #374151 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-color: #1f2937;
}
.ep-preview-img {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    box-shadow: 0 12px 32px rgba(0,0,0,.5);
    background: #fff;
}
.ep-preview-fallback {
    padding: 60px 32px;
    text-align: center;
    background: var(--ep-surface);
    color: var(--ep-text);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

/* Make xxl preview modal stretch nicely on smaller screens */
@media (max-width: 720px) {
    .ep-modal.xxl { height: 96vh; max-width: 100%; border-radius: 0; }
    .ep-preview-frame-wrap, .ep-preview-img-wrap, .ep-preview-frame { min-height: 60vh; }
}

/* ============================================================
   Pembuka checklist table — handle long filenames + responsive
   ============================================================ */
.ep-checklist-table {
    table-layout: auto;
    min-width: 880px; /* trigger horizontal scroll on small screens */
}
.ep-checklist-table th,
.ep-checklist-table td {
    vertical-align: middle;
}
.ep-checklist-table td.ep-cell-strong {
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.35;
}
.ep-checklist-table .ep-badge {
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

/* ============================================================
   Vendor Accordion (JK Tertinggi non-recommended vendors)
   ============================================================ */
.ep-vendor-accordion {
    transition: border-color .15s, box-shadow .15s;
}
.ep-vendor-accordion[open] {
    border-color: var(--ep-primary-200, #cbd5e1);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.ep-vendor-summary {
    list-style: none !important;
    user-select: none;
    margin: 0;
    /* Match .ep-card-header padding so summary looks identical to card-header */
}
.ep-vendor-summary::-webkit-details-marker {
    display: none !important;
}
.ep-vendor-summary::marker {
    display: none !important;
    content: '';
}
.ep-vendor-summary:hover {
    background: rgba(28,61,117,0.06) !important;
}
.ep-vendor-accordion[open] .ep-accordion-chevron {
    transform: rotate(90deg);
}
.ep-vendor-accordion[open] .ep-vendor-summary {
    border-bottom: 1px solid var(--ep-border);
}

/* ============================================================
   Compare Cart — checkbox per row + floating action button
   ============================================================ */
.ep-cart-check {
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    margin: 0;
    padding: 4px;
    border-radius: var(--ep-radius-sm);
}
.ep-cart-check:hover { background: var(--ep-surface-2); }
.ep-cart-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--ep-primary);
    cursor: pointer;
}
.ep-cart-check input[type="checkbox"]:checked + * { color: var(--ep-primary); }

.ep-floating-cart {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    display: flex;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    border-radius: 100px;
    animation: ep-cart-pop .25s ease;
}
@keyframes ep-cart-pop {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
.ep-floating-cart-btn {
    background: var(--ep-primary);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: transform .15s, box-shadow .15s;
}
.ep-floating-cart-btn:hover {
    background: var(--ep-primary-700, var(--ep-primary));
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.22);
}
.ep-floating-cart-btn iconify-icon { font-size: 20px; }
.ep-floating-cart-count {
    background: #fff;
    color: var(--ep-primary);
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    border-radius: 100px;
    display: grid;
    place-items: center;
    font-size: 12px;
    padding: 0 8px;
}

/* ============================================================
   Side-by-side comparison table
   ============================================================ */
.ep-compare-wrap {
    overflow-x: auto;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-md);
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,.03);
}
.ep-compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.ep-compare-table thead th {
    background: var(--ep-surface-2);
    padding: 14px 12px;
    text-align: left;
    border-bottom: 2px solid var(--ep-border);
    vertical-align: top;
    position: sticky;
    top: 0;
    z-index: 5;
}
.ep-compare-label-col {
    width: 200px;
    min-width: 200px;
    background: #f8fafc !important;
    position: sticky;
    left: 0;
    z-index: 6 !important;
    border-right: 1px solid var(--ep-border);
}
.ep-compare-vendor-col {
    min-width: 240px;
}
.ep-compare-vendor-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ep-text);
    line-height: 1.3;
    margin-bottom: 2px;
}
.ep-compare-vendor-sub {
    font-size: 11.5px;
    color: var(--ep-text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 6px;
}
.ep-compare-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--ep-border);
    vertical-align: top;
}
.ep-compare-table tbody tr:hover td:not(.ep-compare-label-col) {
    background: rgba(28, 61, 117, 0.025);
}
.ep-compare-table tbody td:first-child {
    background: #f8fafc;
    font-weight: 500;
    color: var(--ep-text);
    position: sticky;
    left: 0;
    border-right: 1px solid var(--ep-border);
    z-index: 1;
}
.ep-compare-section td {
    background: var(--ep-primary) !important;
    color: #fff !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 8px 14px !important;
    border-bottom: 0 !important;
    position: sticky;
    left: 0;
    z-index: 4;
}
.ep-compare-section td iconify-icon {
    margin-right: 6px;
    font-size: 13px;
    vertical-align: middle;
}
.ep-compare-table details summary { list-style: none; }
.ep-compare-table details summary::-webkit-details-marker { display: none; }
.ep-compare-table details summary::before {
    content: '▶ ';
    font-size: 9px;
    margin-right: 4px;
    transition: transform .15s;
    display: inline-block;
}
.ep-compare-table details[open] summary::before {
    transform: rotate(90deg);
}

/* ============================================================
   Critical Findings — coloured badges per status
   ============================================================ */
.ep-findings-details {
    width: 100%;
}
.ep-findings-summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(220, 38, 38, 0.06);
    border-radius: var(--ep-radius-sm);
    font-size: 12.5px;
    user-select: none;
    list-style: none;
}
.ep-findings-summary::-webkit-details-marker { display: none; }
.ep-findings-summary::before {
    content: '▶';
    font-size: 9px;
    color: var(--ep-danger);
    transition: transform .15s;
    display: inline-block;
}
.ep-findings-details[open] .ep-findings-summary::before {
    transform: rotate(90deg);
}
.ep-findings-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ep-findings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--ep-radius-sm);
    border-left: 3px solid transparent;
    background: #fff;
    border: 1px solid var(--ep-border);
}
.ep-findings-row-danger  { border-left-color: var(--ep-danger);  background: rgba(220, 38, 38, 0.04); }
.ep-findings-row-warning { border-left-color: var(--ep-warning); background: rgba(234, 179, 8, 0.05); }
.ep-findings-row-info    { border-left-color: var(--ep-info);    background: rgba(59, 130, 246, 0.05); }
.ep-findings-row-muted   { border-left-color: var(--ep-text-muted); background: rgba(0,0,0,0.02); }
.ep-findings-row-success { border-left-color: var(--ep-success); background: rgba(34, 197, 94, 0.05); }
.ep-findings-badge {
    font-size: 10px !important;
    padding: 2px 7px !important;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
}
.ep-findings-item {
    flex: 1;
    min-width: 0;
}
.ep-findings-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ep-text);
    line-height: 1.35;
    word-break: break-word;
}
.ep-findings-note {
    font-size: 11px;
    color: var(--ep-text-muted);
    font-style: italic;
    margin-top: 2px;
}
