/* ==========================================================================
   Encyklomedia CMS Admin Theme
   Colors: Primary (#1846A3), Blue (#2563EB), White (#FFFFFF), Red (#DC3545)
   ========================================================================== */

:root {
    --ek-green: #1846A3;
    --ek-green-dark: #123581;
    --ek-green-light: #E8EEFA;
    --ek-blue: #2563EB;
    --ek-blue-light: #EBF1FF;
    --ek-red: #DC3545;
    --ek-red-light: #FDECEE;
    --ek-white: #FFFFFF;
    --ek-gray-50: #F8F9FA;
    --ek-gray-100: #F1F3F5;
    --ek-gray-200: #E9ECEF;
    --ek-gray-300: #DEE2E6;
    --ek-gray-500: #ADB5BD;
    --ek-gray-700: #495057;
    --ek-gray-900: #212529;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
}

/* === Global === */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--ek-gray-100);
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

/* === Sidebar === */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #123581 0%, #1846A3 50%, #0E2B67 100%);
    color: #fff;
    z-index: 1040;
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.admin-sidebar::-webkit-scrollbar {
    width: 5px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    gap: 12px;
    min-height: 60px;
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.sidebar-brand span {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sidebar-nav {
    padding: 12px 0;
}

.sidebar-section {
    padding: 8px 20px 4px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.45);
    margin-top: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255,255,255,0.75);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    gap: 12px;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left-color: rgba(255,255,255,0.3);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(255,255,255,0.14);
    border-left-color: #fff;
    font-weight: 600;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link .link-text {
    white-space: nowrap;
}

/* === Topbar === */
.admin-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--ek-white);
    border-bottom: 1px solid var(--ek-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1030;
    transition: left 0.3s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-left h5 {
    margin: 0;
    font-weight: 700;
    color: var(--ek-gray-900);
    font-size: 1.05rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right .btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ek-gray-200);
    background: var(--ek-gray-50);
    color: var(--ek-gray-700);
    transition: all 0.2s;
    font-size: 1rem;
}

.topbar-right .btn-icon:hover {
    background: var(--ek-green-light);
    border-color: var(--ek-green);
    color: var(--ek-green);
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ek-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

#sidebarToggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--ek-gray-700);
    cursor: pointer;
    display: none;
}

/* === Main Content === */
.admin-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.3s ease;
}

/* === Dashboard KPI Cards === */
.kpi-card {
    background: var(--ek-white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--ek-gray-200);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.kpi-card .kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.kpi-icon.green { background: var(--ek-green-light); color: var(--ek-green); }
.kpi-icon.blue { background: var(--ek-blue-light); color: var(--ek-blue); }
.kpi-icon.red { background: var(--ek-red-light); color: var(--ek-red); }

.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ek-gray-900);
    line-height: 1;
    margin-top: 12px;
}

.kpi-card .kpi-label {
    font-size: 0.8rem;
    color: var(--ek-gray-500);
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Cards / Panels === */
.admin-card {
    background: var(--ek-white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--ek-gray-200);
    margin-bottom: 24px;
}

.admin-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--ek-gray-200);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-card .card-header h6 {
    margin: 0;
    font-weight: 700;
    color: var(--ek-gray-900);
    font-size: 0.95rem;
}

.admin-card .card-body {
    padding: 20px;
}

/* === Tables === */
.admin-table {
    width: 100%;
    margin-bottom: 0;
}

.admin-table thead th {
    background: var(--ek-gray-50);
    border-bottom: 2px solid var(--ek-gray-200) !important;
    color: var(--ek-gray-700);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--ek-gray-100);
    font-size: 0.875rem;
    color: var(--ek-gray-700);
}

.admin-table tbody tr:hover {
    background: var(--ek-gray-50);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* === Badges === */
.badge-active {
    background: var(--ek-green-light);
    color: var(--ek-green);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-inactive {
    background: var(--ek-red-light);
    color: var(--ek-red);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-pending {
    background: #FFF3CD;
    color: #856404;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-info {
    background: var(--ek-blue-light) !important;
    color: var(--ek-blue) !important;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}

/* === Buttons === */
.btn-ek-green {
    background: var(--ek-green);
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-ek-green:hover {
    background: var(--ek-green-dark);
    color: #fff;
}

.btn-ek-blue {
    background: var(--ek-blue);
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-ek-blue:hover {
    background: #1D4FD8;
    color: #fff;
}

.btn-ek-outline {
    background: transparent;
    border: 1px solid var(--ek-gray-300);
    color: var(--ek-gray-700);
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-ek-outline.btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
    line-height: 1.4;
}

.btn-ek-outline:hover {
    border-color: var(--ek-green);
    color: var(--ek-green);
    background: var(--ek-green-light);
}

/* === Search / Filter Bar === */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-bar .form-control,
.filter-bar .form-select {
    border-radius: 8px;
    border: 1px solid var(--ek-gray-300);
    font-size: 0.875rem;
    padding: 8px 14px;
}

.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
    border-color: var(--ek-green);
    box-shadow: 0 0 0 3px rgba(24, 70, 163, 0.12);
}

/* === Page Header === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--ek-gray-900);
}

.breadcrumb-custom {
    font-size: 0.82rem;
    margin: 0;
    padding: 0;
    background: transparent;
}

.breadcrumb-custom .breadcrumb-item a {
    color: var(--ek-green);
}

.breadcrumb-custom .breadcrumb-item.active {
    color: var(--ek-gray-500);
}

/* === Chart container === */
.chart-container {
    position: relative;
    height: 300px;
}

/* === Activity List === */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ek-gray-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-dot.green { background: var(--ek-green); }
.activity-dot.blue { background: var(--ek-blue); }
.activity-dot.red { background: var(--ek-red); }

.activity-text {
    font-size: 0.85rem;
    color: var(--ek-gray-700);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--ek-gray-500);
}

/* === Profile Type Badges === */
.profile-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    margin: 1px 2px;
}

.profile-badge.professional { background: #DBEAFE; color: #1E40AF; }
.profile-badge.talent { background: #FCE7F3; color: #9D174D; }
.profile-badge.agency { background: #E0E7FF; color: #3730A3; }
.profile-badge.studio { background: #D1FAE5; color: #065F46; }
.profile-badge.vendor { background: #FEF3C7; color: #92400E; }
.profile-badge.production { background: #EDE9FE; color: #5B21B6; }
.profile-badge.other { background: var(--ek-gray-200); color: var(--ek-gray-700); }

/* === Detail View === */
.detail-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ek-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--ek-gray-900);
    margin-bottom: 16px;
}

/* === Pagination === */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid var(--ek-gray-200);
    color: var(--ek-gray-700);
    font-size: 0.85rem;
}

.pagination .page-item.active .page-link {
    background: var(--ek-green);
    border-color: var(--ek-green);
    color: #fff;
}

/* === Responsive === */
@media (max-width: 991.98px) {
    #sidebarToggle {
        display: block;
    }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-topbar {
        left: 0;
    }

    .admin-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1035;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--ek-gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* === Scrollbar for main content === */
.admin-content::-webkit-scrollbar {
    width: 6px;
}

.admin-content::-webkit-scrollbar-thumb {
    background: var(--ek-gray-300);
    border-radius: 3px;
}

/* === Inline Action Buttons === */
.action-btns {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-action {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ek-gray-200);
    background: var(--ek-white);
    color: var(--ek-gray-700);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.btn-action:hover {
    border-color: var(--ek-blue);
    color: var(--ek-blue);
    background: var(--ek-blue-light);
}

.btn-action.btn-action-delete:hover {
    border-color: var(--ek-red);
    color: var(--ek-red);
    background: var(--ek-red-light);
}

.btn-action.btn-action-toggle:hover {
    border-color: var(--ek-green);
    color: var(--ek-green);
    background: var(--ek-green-light);
}

/* ==========================================================================
   Login Page
   ========================================================================== */

.login-body {
    background: var(--ek-gray-100);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left Brand Panel */
.login-brand-panel {
    flex: 0 0 45%;
    background: linear-gradient(135deg, #123581 0%, #1846A3 40%, #0E2B67 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(37,99,235,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    max-width: 400px;
}

.login-logo-large {
    max-width: 220px;
    height: auto;
    margin-bottom: 32px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.login-brand-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.login-brand-content p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.6;
    margin-bottom: 32px;
}

.login-brand-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
}

.login-feature i {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
}

/* Right Form Panel */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--ek-white);
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.login-favicon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(24, 70, 163, 0.18);
    margin-bottom: 20px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ek-gray-900);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 0.88rem;
    color: var(--ek-gray-500);
    margin-bottom: 0;
}

.login-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ek-gray-700);
    margin-bottom: 6px;
    display: block;
}

.login-input-group {
    position: relative;
}

.login-input-group > i:first-child {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ek-gray-500);
    font-size: 1rem;
    pointer-events: none;
}

.login-input {
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--ek-gray-200);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: var(--ek-gray-50);
}

.login-input:focus {
    border-color: var(--ek-green);
    box-shadow: 0 0 0 4px rgba(24, 70, 163, 0.1);
    background: var(--ek-white);
}

.login-input::placeholder {
    color: var(--ek-gray-500);
    font-size: 0.85rem;
}

.login-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--ek-gray-500);
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    transition: color 0.2s;
}

.login-toggle-password:hover {
    color: var(--ek-green);
}

.login-remember {
    font-size: 0.85rem;
    color: var(--ek-gray-700);
}

.login-btn {
    background: linear-gradient(135deg, #1846A3 0%, #123581 100%);
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(24, 70, 163, 0.25);
}

.login-btn:hover {
    background: linear-gradient(135deg, #123581 0%, #0E2B67 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(24, 70, 163, 0.35);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    display: block;
    color: var(--ek-red);
    font-size: 0.78rem;
    margin-top: 4px;
    font-weight: 500;
}

.login-alert {
    background: var(--ek-red-light);
    color: var(--ek-red);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.login-alert:empty {
    display: none;
}

.field-validation-valid {
    display: none;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--ek-gray-200);
}

.login-footer p {
    font-size: 0.78rem;
    color: var(--ek-gray-500);
    margin: 0;
}

.form-check-input:checked {
    background-color: var(--ek-green);
    border-color: var(--ek-green);
}

/* Login Responsive */
@media (max-width: 991.98px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-brand-panel {
        flex: 0 0 auto;
        padding: 32px 24px;
        min-height: auto;
    }

    .login-logo-large {
        max-width: 160px;
        margin-bottom: 20px;
    }

    .login-brand-content h2 {
        font-size: 1.4rem;
    }

    .login-brand-content p {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }

    .login-brand-features {
        gap: 8px;
    }

    .login-form-panel {
        padding: 32px 24px;
    }
}

@media (max-width: 575.98px) {
    .login-brand-features {
        grid-template-columns: 1fr;
    }

    .login-form-container {
        max-width: 100%;
    }
}

/* ==========================================================================
   Navigation Tabs & Outline Tabs
   ========================================================================== */
.card-outline-tabs {
    border-top: 3px solid var(--ek-green) !important;
}

.card-outline-tabs > .card-header {
    background-color: var(--ek-gray-50);
    border-bottom: 2px solid var(--ek-gray-200);
    padding: 0 16px 0 16px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.nav-tabs {
    border-bottom: 2px solid var(--ek-gray-200);
}

.card-outline-tabs .nav-tabs {
    border-bottom: none;
    margin-bottom: -2px;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    color: var(--ek-gray-700);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 13px 22px;
    border: 2px solid transparent;
    border-bottom: 2px solid transparent;
    background: transparent;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.nav-tabs .nav-link i {
    color: var(--ek-gray-500);
    font-size: 1rem;
    transition: color 0.2s ease-in-out;
}

.nav-tabs .nav-link:hover {
    color: var(--ek-green);
    background-color: var(--ek-green-light);
    border-color: transparent;
}

.nav-tabs .nav-link:hover i {
    color: var(--ek-green);
}

/* Active Tab Highlight */
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--ek-green) !important;
    background-color: var(--ek-white) !important;
    border-color: var(--ek-gray-200) var(--ek-gray-200) var(--ek-white) var(--ek-gray-200) !important;
    border-top: 3px solid var(--ek-green) !important;
    border-bottom: 2px solid var(--ek-white) !important;
    font-weight: 700 !important;
    box-shadow: 0 -2px 6px rgba(24, 70, 163, 0.06);
}

.nav-tabs .nav-link.active i,
.nav-tabs .nav-item.show .nav-link i {
    color: var(--ek-green) !important;
}
