:root {
    --sidebar-width: 260px;
    --app-bg: #f4f6f9;
    --sidebar-bg: #111827;
    --sidebar-text: #d1d5db;
    --sidebar-active: #2563eb;
}

body {
    background: var(--app-bg);
    color: #111827;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 20px 16px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-icon,
.login-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
}

.login-logo {
    margin-bottom: 12px;
}

.brand-title {
    color: #fff;
    font-weight: 700;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    border-radius: 10px;
    padding: 11px 12px;
    margin-bottom: 4px;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
}

.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 18px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.content-area {
    padding: 26px;
}

.stat-card {
    border-radius: 16px;
}

.stat-number {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
}

.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: 0;
    border-radius: 18px;
}

.btn-group form {
    display: inline-flex;
}

pre {
    white-space: pre-wrap;
}

.class-select-card {
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.class-select-card:hover {
    box-shadow: 0 .25rem .75rem rgba(17, 24, 39, .08);
}

@media print {
    body {
        background: #fff !important;
        font-size: 12px;
    }

    .sidebar,
    .topbar,
    .no-print,
    .btn,
    .alert .btn-close {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .content-area {
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #111 !important;
        break-inside: avoid;
    }

    .room-print-card {
        page-break-inside: avoid;
    }

    .table th,
    .table td {
        padding: 4px 6px !important;
    }
}

/* Salon listesi işlem butonları */
.rooms-action-buttons .btn,
.table td .btn.btn-sm {
    border-radius: .45rem;
}

.table td form.d-inline-flex {
    vertical-align: middle;
}

/* Sınav listesi işlem butonları */
.exam-actions-cell {
    min-width: 560px;
}

.exam-action-buttons .btn {
    border-radius: .45rem;
    font-weight: 600;
    white-space: nowrap;
    padding: .5rem .85rem;
    line-height: 1.2;
}

.exam-action-buttons form {
    margin: 0;
}

@media (max-width: 1200px) {
    .exam-actions-cell {
        min-width: 420px;
    }
}

/* Mobil uyumlu ana menü */
.sidebar-backdrop {
    display: none;
}

.topbar-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title-text {
    min-width: 0;
}

.mobile-menu-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.mobile-menu-icon {
    font-size: 22px;
    line-height: 1;
}

.sidebar-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 24px;
    line-height: 1;
}

@media (min-width: 992px) {
    .sidebar .brand {
        justify-content: flex-start;
    }

    .sidebar-backdrop,
    .mobile-menu-toggle,
    .sidebar-close {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(84vw, 320px) !important;
        min-height: 100vh !important;
        height: 100vh;
        z-index: 1050;
        transform: translateX(-110%);
        transition: transform .22s ease;
        box-shadow: 0 18px 40px rgba(15, 23, 42, .28);
        overflow-y: auto;
        padding: 18px 14px;
        visibility: hidden;
    }

    body.sidebar-open {
        overflow: hidden;
    }

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

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        display: block;
        background: rgba(15, 23, 42, .48);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .22s ease, visibility .22s ease;
        z-index: 1040;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar .brand {
        justify-content: space-between;
        margin-bottom: 18px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .sidebar-nav .nav-link {
        padding: 13px 12px;
        margin-bottom: 6px;
        font-size: 15px;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 1020;
        padding: 12px 14px;
        gap: 10px;
        align-items: flex-start;
    }

    .topbar-title-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-title-text {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-page-title {
        font-size: 1.25rem;
    }

    .topbar-context {
        max-width: none;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.28;
        margin-top: 2px;
    }

    .user-menu-dropdown .btn {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .content-area {
        padding: 16px 12px;
    }
}

@media (max-width: 520px) {
    .topbar {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .topbar-title-wrap {
        align-items: flex-start;
        flex: 1 1 100%;
        width: 100%;
    }

    .topbar-page-title {
        font-size: 1.12rem;
        line-height: 1.18;
    }

    .topbar-context {
        max-width: none;
        width: 100%;
        font-size: .82rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .user-menu-dropdown {
        margin-left: 56px;
        margin-top: 4px;
    }

    .user-menu-dropdown .btn {
        max-width: calc(100vw - 90px);
        padding-left: .7rem;
        padding-right: .7rem;
    }
}

/* v70 - Mobil üst başlıkta kullanıcı adı başlığın yanında gösterilir */
.topbar-title-wrap {
    width: 100%;
}

.topbar-heading-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
}

.topbar-heading-row .topbar-page-title {
    min-width: 0;
}

.topbar-heading-row .user-menu-dropdown {
    margin-left: auto;
    flex: 0 0 auto;
}

@media (max-width: 991.98px) {
    .topbar {
        justify-content: flex-start;
    }

    .topbar-heading-row {
        gap: 10px;
    }

    .topbar-heading-row .user-menu-dropdown .btn {
        max-width: 160px;
    }
}

@media (max-width: 520px) {
    .topbar {
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    .topbar-title-wrap {
        align-items: flex-start;
        flex: 1 1 auto;
        width: 100%;
    }

    .topbar-title-text {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-heading-row {
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
    }

    .topbar-heading-row .topbar-page-title {
        flex: 0 1 auto;
        max-width: calc(100vw - 210px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-heading-row .user-menu-dropdown {
        margin-left: 0;
        margin-top: 0;
        flex: 0 0 auto;
    }

    .topbar-heading-row .user-menu-dropdown .btn {
        max-width: 135px;
        padding-left: .65rem;
        padding-right: .65rem;
    }

    .topbar-context {
        margin-top: 3px;
        width: 100%;
        max-width: none;
    }
}

/* v71 - Mobil üst başlıkta kullanıcı adını sağa hizala */
@media (max-width: 520px) {
    .topbar-heading-row {
        justify-content: space-between;
        width: 100%;
    }

    .topbar-heading-row .topbar-page-title {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-heading-row .user-menu-dropdown {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .topbar-heading-row .user-menu-dropdown .btn {
        max-width: 132px;
    }
}

/* v72 - Masaüstü üst başlıkta kullanıcı adını sağa hizala */
.topbar-title-wrap {
    width: 100%;
    flex: 1 1 auto;
}

.topbar-title-text {
    width: 100%;
    flex: 1 1 auto;
}

.topbar-heading-row {
    width: 100%;
    justify-content: space-between;
}

.topbar-heading-row .topbar-page-title {
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-heading-row .user-menu-dropdown {
    margin-left: auto;
    flex: 0 0 auto;
}

@media (min-width: 992px) {
    .topbar {
        justify-content: flex-start;
    }

    .topbar-title-wrap,
    .topbar-title-text,
    .topbar-heading-row {
        width: 100%;
    }
}

/* v5 sınav paneli sadeleştirme */
.exam-list-table .exam-actions-cell {
    min-width: 260px;
}

.exam-list-table .exam-action-buttons .btn {
    padding: .42rem .7rem;
}

.exam-list-table .dropdown-menu form {
    margin: 0;
}

.exam-list-table .dropdown-menu form .dropdown-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
}

@media (max-width: 1200px) {
    .exam-list-table .exam-actions-cell {
        min-width: 240px;
    }
}


.exam-dropdown-menu-floating {
    box-shadow: 0 .75rem 1.8rem rgba(15, 23, 42, .18);
}

/* v9 - Logo kullanımı */
.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.brand-link:hover {
    color: inherit;
}

.brand-logo-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    padding: 5px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
    overflow: hidden;
}

.brand-logo-mark {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.login-logo-img {
    display: block;
    width: min(292px, 100%);
    height: auto;
}

@media (max-width: 991.98px) {
    .brand-logo-box {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }
}
