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

:root {
    --bg-color: #f3f6fb;
    --bg-contrast: #e8eef8;
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-solid: #ffffff;
    --text-main: #0f172a;
    --text-soft: #475569;
    --text-muted: #94a3b8;
    --border-soft: rgba(148, 163, 184, 0.18);
    --primary: #1d4ed8;
    --primary-strong: #0f3fb9;
    --accent: #0f766e;
    --accent-soft: #d1fae5;
    --warning: #f59e0b;
    --danger: #dc2626;
    --sidebar-bg: #0a1220;
    --sidebar-surface: rgba(255, 255, 255, 0.06);
    --sidebar-muted: #8aa0bf;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 20px 50px rgba(15, 23, 42, 0.16);
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
    --surface-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.94) 100%);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08) 0%, transparent 30%),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08) 0%, transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

.sidebar-backdrop,
.mobile-bottom-nav,
.mobile-menu-btn,
.sidebar-close-btn {
    display: none;
}

.glass-card {
    background: var(--surface-gradient);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 1.15rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.1);
}

.btn-premium {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-premium:hover {
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.28);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 236px;
    height: 100vh;
    padding: 0.55rem 0.6rem 0.65rem;
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.18) 0%, transparent 24%),
        linear-gradient(180deg, #08111f 0%, #0b1526 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 20px 0 45px rgba(2, 6, 23, 0.28);
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.72rem 0.8rem;
    margin-bottom: 0.45rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
}

.sidebar-close-btn {
    margin-left: auto;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.sidebar-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9) 0%, rgba(15, 118, 110, 0.85) 100%);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.24);
}

.sidebar-brand-kicker {
    margin: 0 0 0.1rem;
    color: rgba(191, 219, 254, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.6rem;
}

.sidebar h4 {
    margin: 0;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.sidebar-section-title {
    margin: 0.45rem 0 0.15rem;
    padding: 0 0.6rem;
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.sidebar-section-spaced {
    margin-top: 0.45rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--sidebar-muted);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    margin-bottom: 0.2rem;
    transition: all 0.22s ease;
    font-size: 0.9rem;
}

.sidebar .nav-link i {
    width: 14px;
    text-align: center;
    color: #90a7c8;
    transition: inherit;
    font-size: 0.84rem;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(3px);
}

.sidebar .nav-link:hover i {
    color: #fff;
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(15, 118, 110, 0.92) 100%);
    box-shadow: 0 12px 22px rgba(37, 99, 235, 0.28);
}

.sidebar .nav-link.active i {
    color: #fff;
}

.main-content {
    margin-left: 236px;
    padding: 1rem 1.2rem 1.4rem;
}

.topbar-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.9rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.topbar-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.topbar-eyebrow {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.topbar-icon-btn,
.topbar-user-btn {
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.topbar-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-radius: 16px;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
}

.topbar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14) 0%, rgba(15, 118, 110, 0.14) 100%);
    color: var(--primary);
}

.topbar-user-meta {
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.topbar-user-meta strong {
    font-size: 0.84rem;
}

.topbar-user-meta small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.table-premium {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > table {
    min-width: 720px;
}

.form-control,
.form-select,
.select2-container .select2-selection {
    min-height: 44px;
}

.modal-content {
    max-height: calc(100dvh - 2rem);
}

.modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.table-premium th {
    border-bottom: 2px solid #e2e8f0;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    padding: 1rem 1.25rem;
    background-color: transparent;
}

.table-premium td {
    background: transparent;
    border-bottom: 1px solid #eef2f7;
    padding: 1rem 1.25rem;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #334155;
}
.table-premium tbody tr:hover td {
    background-color: rgba(248, 250, 252, 0.8);
}

.table-premium tbody tr:last-child td {
    border-bottom: none;
}

.table-premium .btn-outline-info,
.table-premium .btn-outline-primary,
.table-premium .btn-outline-warning,
.table-premium .btn-outline-danger,
.table-premium .btn-outline-success {
    border: none;
    background-color: transparent;
    box-shadow: none;
    padding: 0.35rem 0.5rem;
    font-size: 1rem;
    color: #64748b;
    transition: all 0.2s ease;
}

.table-premium .btn-outline-info:hover { background-color: #e0f2fe; color: #0284c7; }
.table-premium .btn-outline-primary:hover { background-color: #e0e7ff; color: #4f46e5; }
.table-premium .btn-outline-warning:hover { background-color: #fef3c7; color: #d97706; }
.table-premium .btn-outline-danger:hover { background-color: #fee2e2; color: #b91c1c; }
.table-premium .btn-outline-success:hover { background-color: #dcfce7; color: #15803d; }

.table-premium a:not(.btn) {
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
}

.table-premium a:not(.btn):hover {
    color: #1d4ed8;
}

.badge-aktif { background-color: #e6f8eb; color: #047857; }
.badge-pasif { background-color: #fee9eb; color: #dc2626; }
.badge-potansiyel { background-color: #eef2fa; color: #1d4ed8; }

.badge-premium {
    padding: 0.55em 1em;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.74rem;
}

/* Page Titles */
.main-content h3:has(> i:first-child) {
    font-size: 20px !important;
}

/* Utility Classes */
.mb-25 {
    margin-bottom: 25px !important;
}

@media (max-width: 1199.98px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        height: 100dvh;
        padding-top: max(0.7rem, env(safe-area-inset-top));
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 1045;
    }

    .sidebar-open {
        overflow: hidden;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: inline-flex;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(2, 6, 23, 0.58);
        opacity: 0;
        visibility: hidden;
        backdrop-filter: blur(3px);
        transition: opacity 0.24s ease, visibility 0.24s ease;
    }

    .sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem 1rem calc(6.3rem + env(safe-area-inset-bottom));
    }

    .topbar-copy {
        min-width: 0;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 0.65rem;
    }

    .mobile-menu-btn {
        display: inline-flex;
        grid-row: 1 / 3;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 0;
        border-radius: 13px;
        background: var(--primary-gradient);
        color: #fff;
        box-shadow: 0 9px 20px rgba(37, 99, 235, 0.22);
    }

    .mobile-bottom-nav {
        position: fixed;
        inset: auto 0 0;
        z-index: 1030;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
        padding: 0.45rem max(0.65rem, env(safe-area-inset-right))
            calc(0.45rem + env(safe-area-inset-bottom))
            max(0.65rem, env(safe-area-inset-left));
        background: rgba(255, 255, 255, 0.94);
        border-top: 1px solid rgba(148, 163, 184, 0.22);
        box-shadow: 0 -12px 35px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        min-width: 0;
        min-height: 54px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        border: 0;
        border-radius: 14px;
        background: transparent;
        color: #64748b;
        text-decoration: none;
        font-size: 0.67rem;
        font-weight: 700;
    }

    .mobile-bottom-nav i {
        font-size: 1.05rem;
    }

    .mobile-bottom-nav a.active {
        color: var(--primary);
        background: rgba(37, 99, 235, 0.09);
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: max(0.65rem, env(safe-area-inset-top)) 0.72rem
            calc(6rem + env(safe-area-inset-bottom));
    }

    .topbar-shell {
        position: sticky;
        top: max(0.4rem, env(safe-area-inset-top));
        z-index: 1020;
        flex-direction: row;
        align-items: center;
        min-height: 62px;
        margin-bottom: 1rem !important;
        padding: 0.55rem 0.65rem;
        border-radius: 17px;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .topbar-copy {
        min-width: 0;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 0.65rem;
        flex: 1;
    }

    .topbar-copy strong,
    .topbar-eyebrow {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-shell > .d-flex {
        gap: 0.45rem !important;
    }

    .topbar-icon-btn {
        width: 40px;
        height: 40px;
    }

    .topbar-user-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }

    .topbar-user-btn > .fa-chevron-down {
        display: none;
    }

    .topbar-user-avatar {
        width: 34px;
        height: 34px;
    }

    .dropdown-menu {
        max-width: calc(100vw - 1.5rem);
    }

    .glass-card {
        border-radius: 17px;
        padding: 1rem;
    }

    .glass-card:hover {
        transform: none;
    }

    .main-content > .d-flex.justify-content-between,
    .main-content > form > .d-flex.justify-content-between {
        align-items: stretch !important;
        flex-direction: column;
        gap: 0.75rem;
    }

    .main-content > .d-flex.justify-content-between .btn,
    .main-content > form > .d-flex.justify-content-between .btn {
        width: 100%;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-content h3 {
        font-size: 1.15rem !important;
        line-height: 1.35;
    }

    .row {
        --bs-gutter-x: 0.9rem;
    }

    .dashboard-metrics {
        --bs-gutter-y: 0.75rem;
        margin-bottom: 0.75rem !important;
    }

    .dashboard-metrics > [class*="col-"] {
        width: 50%;
    }

    .dashboard-metrics .glass-card {
        min-height: 138px;
        height: 100%;
        padding: 1rem 0.65rem !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .dashboard-metrics .fa-2x {
        font-size: 1.35rem;
    }

    .dashboard-metrics h6 {
        min-height: 2.2em;
        margin-bottom: 0.3rem;
        font-size: 0.76rem;
        line-height: 1.15;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dashboard-metrics h3 {
        font-size: 1rem !important;
        overflow-wrap: anywhere;
    }

    .form-control,
    .form-select,
    .btn {
        font-size: 16px;
    }

    textarea.form-control {
        min-height: 110px;
    }

    .btn-premium {
        min-height: 46px;
    }

    .table-responsive {
        overflow: visible;
        border-radius: inherit;
    }

    .table-responsive > table.mobile-data-table {
        min-width: 0;
    }

    .mobile-data-table,
    .mobile-data-table tbody {
        display: block;
        width: 100%;
    }

    .mobile-data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .mobile-data-table tbody {
        padding: 0.75rem;
    }

    .mobile-data-table tbody tr {
        display: block;
        width: 100%;
        margin-bottom: 0.75rem;
        padding: 0.25rem 0.8rem;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid #e2e8f0;
        border-radius: 15px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    }

    .mobile-data-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .mobile-data-table tbody td {
        position: static !important;
        width: 100% !important;
        min-height: 42px;
        padding: 0.65rem 0 !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        border: 0;
        border-bottom: 1px solid #edf2f7;
        background: transparent !important;
        box-shadow: none !important;
        text-align: right !important;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .mobile-data-table tbody td::before {
        content: attr(data-label);
        max-width: 45%;
        flex: 0 0 42%;
        color: #64748b;
        font-size: 0.66rem;
        font-weight: 800;
        line-height: 1.25;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: 0.045em;
    }

    .mobile-data-table tbody td:last-child {
        border-bottom: 0;
    }

    .mobile-data-table tbody td > .d-flex,
    .mobile-data-table tbody td > .btn-group {
        justify-content: flex-end;
    }

    .mobile-data-table tbody .mobile-empty-cell {
        min-height: 150px;
        display: flex;
        justify-content: center;
        text-align: center !important;
    }

    .mobile-data-table tbody .mobile-empty-cell::before {
        display: none;
    }

    .mobile-data-table tbody .mobile-empty-cell > * {
        max-width: 100%;
    }

    .modal {
        padding: 0 !important;
    }

    .modal-dialog {
        width: 100%;
        max-width: none;
        min-height: 100%;
        margin: 0;
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-height: 92dvh;
        border-radius: 24px 24px 0 0 !important;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-footer {
        flex-wrap: nowrap;
    }

    .modal-footer .btn {
        flex: 1;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .alert.d-flex {
        align-items: stretch !important;
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 374.98px) {
    .topbar-eyebrow {
        display: none;
    }

    .topbar-copy {
        grid-template-rows: 1fr;
    }

    .topbar-copy strong {
        align-self: center;
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        font-size: 0.61rem;
    }

    .dashboard-metrics > [class*="col-"] {
        width: 100%;
    }
}
