:root {
    --hk-primary: #3b82f6;
    --hk-primary-dark: #2563eb;
    --hk-accent: #a855f7;
    --hk-navy: #0b0e21;
    --hk-sidebar: #0b0e21;
    --hk-sidebar-width: 260px;
    --hk-navbar-height: 56px;
    --hk-body-bg: #f1f5f9;
    --hk-card-radius: 0.85rem;
    --hk-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --hk-content-max: 1320px;
    --hk-content-gutter: 1rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--hk-body-bg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.has-topnav {
    padding-top: 0;
    margin-left: 0 !important;
}

.navbar-search {
    width: 8.5rem;
    max-width: 8.5rem;
    flex-shrink: 0;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.58rem;
    padding: 0.18em 0.42em;
    border: 2px solid #121933;
}

@media (min-width: 1400px) {
    .navbar-search {
        width: 10rem;
        max-width: 10rem;
    }
}

.navbar-search .form-control {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 999px;
    padding-left: 2.25rem;
    font-size: 0.875rem;
}

.navbar-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.navbar-search .form-control:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--hk-primary);
    color: #fff;
    box-shadow: none;
}

.navbar-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

/* App shell — navbar + içerik hizası */
.main-content-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    min-height: calc(100vh - var(--hk-navbar-height));
}

.page-shell,
.main-content-wrapper .container,
.main-content-wrapper .container-fluid,
.main-content-wrapper .container-xl,
.main-content-wrapper .container-lg {
    width: 100%;
    max-width: var(--hk-content-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--hk-content-gutter);
    padding-right: var(--hk-content-gutter);
}

.main-content {
    width: 100%;
    margin: 0;
    padding: 0;
}

.page-shell {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

@media (min-width: 1200px) {
    :root {
        --hk-content-gutter: 1.5rem;
    }
}

/* Design system */
.card {
    border: none;
    border-radius: var(--hk-card-radius);
    box-shadow: var(--hk-shadow);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

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

.btn-primary:hover {
    background-color: var(--hk-primary-dark);
    border-color: var(--hk-primary-dark);
}

.stat-card {
    border: none;
    border-radius: var(--hk-card-radius);
    box-shadow: var(--hk-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
}

.page-header {
    margin-bottom: 1.25rem;
}

.page-header h1,
.page-header h2,
.page-header h4 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.quick-action-btn {
    min-width: 140px;
}

.dashboard-filter {
    background: #fff;
    border-radius: var(--hk-card-radius);
    box-shadow: var(--hk-shadow);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

#toastContainer {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1080;
    min-width: 280px;
}

/* Footer */
.custom-footer {
    background: #0b0e21;
    color: rgba(255, 255, 255, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 2rem !important;
}

.custom-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.custom-footer a:hover {
    color: var(--hk-primary);
}

.footer-bottom {
    padding: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
}

@media (max-width: 768px) {
    .footer-bottom {
        justify-content: center;
        text-align: center;
    }

    .navbar-search {
        max-width: 100%;
        margin: 0.5rem 0;
    }
}

/* Mobil UX */
@media (max-width: 991.98px) {
    body.has-topnav.has-mobile-nav {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    :root {
        --hk-content-gutter: 0.75rem;
    }

    .table-responsive {
        font-size: 0.85rem;
        -webkit-overflow-scrolling: touch;
    }

    .stat-card h3,
    .stat-card h4 {
        font-size: 1.15rem;
    }

    .quick-action-btn {
        min-width: auto;
        flex: 1 1 calc(50% - 0.5rem);
        font-size: 0.85rem;
        min-height: 44px;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 36px;
    }

    .dashboard-filter .btn {
        width: 100%;
    }

    .page-header h1,
    .page-header h2 {
        font-size: 1.25rem;
    }
}

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1045;
        background: #fff;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button.mobile-nav-menu {
        flex: 1;
        text-align: center;
        padding: 0.5rem 0.25rem;
        color: #6c757d;
        text-decoration: none;
        font-size: 0.68rem;
        line-height: 1.2;
        border: none;
        background: transparent;
        cursor: pointer;
    }

    .mobile-bottom-nav a i,
    .mobile-bottom-nav button.mobile-nav-menu i {
        display: block;
        font-size: 1.25rem;
        margin-bottom: 0.15rem;
    }

    .mobile-bottom-nav a.active,
    .mobile-bottom-nav button.mobile-nav-menu.active {
        color: var(--hk-primary);
        font-weight: 600;
    }

    .mobile-bottom-nav button.mobile-nav-menu {
        color: var(--hk-primary);
        font-weight: 600;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stat-card {
        transition: none;
    }
}
