/* Aynı yetkili bağlantılar: solda akordeon, üstte açılır menü. */
.sidebar details.nav-group {
    display: block;
    padding: 7px 0;
}
.sidebar details.nav-group:first-child {
    padding-top: 0;
}
.sidebar summary.nav-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    margin: 0;
    padding: 12px 10px;
    font-size: 10px;
    letter-spacing: 0.6px;
    border-radius: 8px;
    user-select: none;
}
.sidebar summary::-webkit-details-marker {
    display: none;
}
.sidebar summary:hover,
.sidebar details:has([aria-current='page']) > summary {
    background: #edf4f2;
    color: #276458;
}
.nav-chevron {
    font-size: 16px;
    transition: transform 0.15s;
}
details[open] > summary .nav-chevron {
    transform: rotate(180deg);
}
.sidebar .nav-links {
    padding: 6px 0 0;
}
.sidebar details:not([open]) > .nav-links {
    display: none;
}
.navigation-settings {
    max-width: 850px;
}
.navigation-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 22px 0;
}
.navigation-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 22px;
    border: 1px solid #dce7e3;
    border-radius: 12px;
    cursor: pointer;
}
.navigation-option:has(input:checked) {
    border-color: #27816c;
    background: #edf6f2;
    box-shadow: 0 0 0 1px #27816c;
}
.navigation-option input {
    width: 18px;
    min-height: 18px;
    margin: 3px 0;
    accent-color: #27816c;
}
.navigation-option strong,
.navigation-option small {
    display: block;
}
.navigation-option small {
    font-weight: 400;
    line-height: 1.6;
    color: #647c75;
    margin-top: 8px;
}
@media (min-width: 801px) {
    .nav-topbar .sidebar {
        position: relative;
        inset: auto;
        width: 100%;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 24px;
        padding: 16px 28px;
        border-right: 0;
        border-bottom: 1px solid #e5edeb;
        z-index: 40;
    }
    .nav-topbar .panel-brand {
        font-size: 20px;
        white-space: nowrap;
        padding: 0;
    }
    .nav-topbar .panel-brand small {
        margin: 4px 0 0;
        font-size: 7px;
    }
    .nav-topbar .brand-symbol {
        width: 32px;
        height: 32px;
        font-size: 22px;
    }
    .nav-topbar .sidebar nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        order: 3;
        width: 100%;
        border-top: 1px solid #edf1ef;
        padding-top: 10px;
    }
    .nav-topbar .sidebar details.nav-group {
        position: relative;
        border: 0;
        padding: 0;
    }
    .nav-topbar .sidebar summary.nav-label {
        min-height: 42px;
        padding: 10px 14px;
        font-size: 11px;
    }
    .nav-topbar .sidebar .nav-links {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        min-width: 225px;
        max-height: 70vh;
        overflow: auto;
        padding: 8px;
        background: #fff;
        border: 1px solid #e0e9e5;
        border-radius: 12px;
        box-shadow: 0 16px 40px #183b3526;
        z-index: 50;
    }
    .nav-topbar .sidebar .sidebar-bottom {
        display: block;
        margin: 0 0 0 auto;
        padding: 0;
    }
    .nav-topbar .workspace-note {
        display: none;
    }
    .nav-topbar .logout {
        padding: 10px;
    }
    .nav-topbar .workspace {
        margin-left: 0;
    }
}
@media (max-width: 800px) {
    .navigation-options {
        grid-template-columns: 1fr;
    }
    .sidebar {
        max-width: calc(100vw - 48px);
    }
    .sidebar .nav-links {
        position: static;
    }
    .navigation-option {
        padding: 16px;
    }
}

/* Sol menü: koyu petrol paleti, sade tipografi ve çizgi ikonlar. */
.nav-group-icon {
    display: none;
}
.nav-group-name {
    flex: 1;
}
.sidebar .nav-icon {
    display: block;
    flex-shrink: 0;
}
.sidebar nav a > .nav-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex: 0 0 20px;
    line-height: 1;
}
.sidebar nav a > .nav-link-label {
    width: auto;
    flex: 1;
    text-align: left;
    font: inherit;
    line-height: 1.4;
}
.sidebar .nav-chevron {
    flex-shrink: 0;
}
.nav-sidebar .sidebar {
    background: #172e32;
    border-right: 1px solid #25444a;
    box-shadow: 5px 0 22px #10292d0d;
    scrollbar-color: #456067 #172e32;
    padding: 24px 14px 16px;
    font-family: var(--app-font);
    -webkit-font-smoothing: antialiased;
}
.nav-sidebar .sidebar .panel-brand {
    font-family: inherit;
    font-style: normal;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.6px;
    color: #f1faf8;
    padding: 0 10px;
}
.nav-sidebar .sidebar .panel-brand small {
    color: #94b4b8;
    font-family: inherit;
    font-size: 9px;
    letter-spacing: 0.7px;
    font-weight: 500;
    margin: 8px 0 32px;
}
.nav-sidebar .sidebar .brand-symbol {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #2d716d;
    color: #edfffa !important;
    border: 1px solid #3b7f79;
    box-shadow: 0 1px 2px #18253406;
    margin-right: 7px;
    vertical-align: middle;
}
.nav-sidebar .sidebar nav {
    gap: 8px;
}
.nav-sidebar .sidebar details.nav-group {
    padding: 3px 0;
    border: 0;
}
.nav-sidebar .sidebar summary.nav-label {
    padding: 8px 11px;
    min-height: 34px;
    color: #aac3c5;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    border-radius: 7px;
    gap: 8px;
}
.nav-sidebar .sidebar details:has([aria-current='page']) > summary {
    background: #24484c;
    color: #f2fffc;
}
.nav-sidebar .sidebar summary.nav-label:hover {
    background: #24484c;
    color: #f2fffc;
}
.nav-sidebar .sidebar .nav-links {
    padding: 3px 0 0;
}
.nav-sidebar .sidebar nav a {
    padding: 9px 11px;
    min-height: 40px;
    margin-bottom: 2px;
    border-radius: 7px;
    gap: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
    font-weight: 400;
    color: #c3d4d6;
    transition:
        background 0.14s,
        color 0.14s;
}
.nav-sidebar .sidebar nav a .nav-link-icon {
    color: #93b2b5;
}
.nav-sidebar .sidebar nav a:hover {
    background: #25444a;
    color: #fff;
}
.nav-sidebar .sidebar nav a[aria-current='page'] {
    background: #32645f;
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 #8bd3bd;
}
.nav-sidebar .sidebar nav a[aria-current='page'] .nav-link-icon {
    color: #b5e7d9;
}
.nav-sidebar .sidebar :focus-visible {
    outline: 2px solid #9ce5cf;
    outline-offset: 2px;
}
.nav-sidebar .sidebar .sidebar-bottom {
    margin-top: auto;
    padding: 18px 7px 0;
}
.sidebar-resize {
    display: none;
    border: 1px solid #dce7e3;
    background: #f0f5f3;
    color: #315e57;
    border-radius: 9px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-resize:hover {
    background: #e0eee8;
}
.topbar .admin-label {
    margin-left: auto;
}
@media (min-width: 801px) {
    .nav-sidebar .sidebar-resize {
        display: inline-flex;
    }
    .nav-sidebar .sidebar,
    .nav-sidebar .workspace {
        transition:
            width 0.2s,
            margin-left 0.2s;
    }
    .nav-sidebar.sidebar-compact .sidebar {
        width: 76px;
        padding: 24px 10px;
        overflow-x: hidden;
    }
    .nav-sidebar.sidebar-compact .workspace {
        margin-left: 76px;
    }
    .nav-sidebar.sidebar-compact .panel-brand {
        padding: 0;
        display: flex;
        justify-content: center;
        margin-bottom: 28px;
    }
    .nav-sidebar.sidebar-compact .brand-symbol {
        margin: 0;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    .nav-sidebar.sidebar-compact .brand-name,
    .nav-sidebar.sidebar-compact .panel-brand small,
    .nav-sidebar.sidebar-compact .nav-group-name,
    .nav-sidebar.sidebar-compact .nav-chevron,
    .nav-sidebar.sidebar-compact .nav-links,
    .nav-sidebar.sidebar-compact .workspace-note,
    .nav-sidebar.sidebar-compact .logout-label {
        display: none !important;
    }
    .nav-sidebar.sidebar-compact .sidebar summary.nav-label {
        padding: 10px;
        justify-content: center;
        min-height: 44px;
    }
    .nav-sidebar.sidebar-compact .nav-group-icon {
        display: block;
        font-size: 23px;
        line-height: 1;
        letter-spacing: 0;
    }
    .nav-sidebar.sidebar-compact .sidebar-bottom {
        padding: 16px 0 0;
        margin-top: auto;
    }
    .nav-sidebar.sidebar-compact .logout {
        width: 100%;
        font-size: 24px;
        text-align: center;
        padding: 10px 0;
    }
    .nav-sidebar.sidebar-compact .sidebar-resize svg {
        transform: rotate(180deg);
    }
}

/* Oturum kapatma: açık, koyu ve dar menüde ortak görünüm. */
.sidebar .sidebar-bottom form {
    margin: 0;
}
.sidebar .logout {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #d6e5df;
    border-radius: 11px;
    background: #f1f7f4;
    color: #315e57;
    font: 600 13px/1.3 var(--app-font);
    text-align: left;
    cursor: pointer;
    transition:
        background 0.16s,
        border-color 0.16s,
        color 0.16s;
}
.sidebar .logout-icon {
    flex-shrink: 0;
}
.sidebar .logout-label {
    flex: 1;
    white-space: nowrap;
}
.sidebar .logout-chevron {
    font-size: 21px;
    line-height: 1;
    opacity: 0.55;
}
.sidebar .logout:hover {
    background: #e3f0ea;
    border-color: #afcfc2;
    color: #20564b;
}
.sidebar .logout:active {
    background: #d8eae1;
}
.nav-sidebar .sidebar .logout {
    background: #ffffff80;
    border-color: #dce0e6;
    color: #626975;
    font-family: inherit;
    font-weight: 500;
    font-size: 12px;
    min-height: 42px;
    border-radius: 9px;
}
.nav-sidebar .sidebar .logout:hover {
    background: #fff;
    border-color: #d4d8df;
    color: #bf4949;
}
.nav-sidebar .sidebar .logout:active {
    background: #f5eaea;
}
@media (min-width: 801px) {
    .nav-topbar .sidebar .logout {
        width: auto;
    }
    .nav-sidebar.sidebar-compact .sidebar .logout {
        justify-content: center;
        padding: 11px 0;
        min-height: 46px;
    }
    .nav-sidebar.sidebar-compact .logout-chevron {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar .logout {
        transition: none;
    }
}

@media (min-width: 801px) {
    .nav-sidebar.sidebar-compact .sidebar .panel-brand {
        padding: 0;
    }
    .nav-sidebar.sidebar-compact .sidebar .brand-symbol {
        width: 36px;
        height: 36px;
        margin: 0;
    }
    .nav-sidebar.sidebar-compact .sidebar .nav-group-icon {
        color: #aac3c5;
    }
    .nav-sidebar.sidebar-compact .sidebar details:has([aria-current='page']) > summary {
        background: #32645f;
    }
    .nav-sidebar.sidebar-compact .sidebar details:has([aria-current='page']) .nav-group-icon {
        color: #b5e7d9;
    }
}
@media (max-width: 800px) {
    .nav-sidebar .sidebar .panel-brand small {
        margin-bottom: 24px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .nav-sidebar .sidebar nav a {
        transition: none;
    }
}

/* Üst çubukta oturum kapatma. */
.topbar-logout-form {
    margin: 0;
    flex-shrink: 0;
}
.topbar .topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #dce7e3;
    border-radius: 9px;
    background: #f5f8f7;
    color: #3e655f;
    font: 500 12px/1.3 var(--app-font);
    cursor: pointer;
}
.topbar .topbar-logout:hover {
    background: #e7efec;
    border-color: #bfd2ca;
    color: #244f46;
}
.topbar .topbar-logout svg {
    flex-shrink: 0;
}
.topbar-logout-label {
    white-space: nowrap;
}
@media (max-width: 800px) {
    .topbar .topbar-logout {
        width: 36px;
        min-height: 36px;
        padding: 7px;
    }
    .topbar-logout-label {
        display: none;
    }
}

/* Hesap kısayolları: yerel details ile klavyeden de açılır. */
.sidebar nav a > .nav-link-label {
    min-width: 0;
    overflow-wrap: anywhere;
}
.topbar {
    position: relative;
    z-index: 20;
}
.topbar .topbar-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-menu {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}
.topbar .account-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: 0;
    min-width: 210px;
    max-width: 260px;
    min-height: 42px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    list-style: none;
    color: #294a46;
    user-select: none;
}
.account-toggle::-webkit-details-marker {
    display: none;
}
.account-toggle:hover,
.account-menu[open] > .account-toggle {
    background: #edf4f1;
    border-color: #dce7e2;
}
.account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    border-radius: 50%;
    background: #e0eee7;
    color: #356553;
    font-size: 13px;
    font-weight: 600;
}
.account-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    text-align: left;
}
.account-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 175px;
}
.account-role {
    font-size: 10.5px;
    color: #7a8a84;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 175px;
}
.account-caret {
    flex-shrink: 0;
    color: #83948d;
    transition: transform 0.15s;
}
.account-menu[open] .account-caret {
    transform: rotate(180deg);
}
.account-menu:not([open]) > .account-menu-links {
    display: none;
}
.account-menu-links {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 80;
    width: 310px;
    max-width: calc(100vw - 24px);
    padding: 7px;
    background: #fff;
    border: 1px solid #e0e8e3;
    border-radius: 13px;
    box-shadow: 0 14px 42px #1b3e3524;
}
.account-menu-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 11px 13px;
    margin-bottom: 5px;
    border-bottom: 1px solid #edf1ee;
}
.account-menu-heading strong {
    font-size: 13px;
    color: #28413a;
    overflow-wrap: anywhere;
}
.account-menu-heading span {
    font-size: 12px;
    color: #7d8c85;
    overflow-wrap: anywhere;
}
.account-menu-links a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    min-height: 40px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.4;
    color: #465d53;
    text-decoration: none;
}
.account-menu-links a:hover {
    background: #edf5f0;
    color: #22604a;
}
.account-menu-links svg {
    flex-shrink: 0;
    color: #6d8e7c;
}
.account-section {
    scroll-margin-top: 24px;
}
.account-form-error {
    padding: 12px;
    border-radius: 8px;
    background: #fff0f0;
    color: #a23838;
    font-size: 13px;
    line-height: 1.5;
}
@media (max-width: 1000px) {
    .topbar {
        gap: 10px;
    }
    .topbar .account-toggle {
        min-width: 0;
    }
    .account-name,
    .account-role {
        max-width: 105px;
    }
}
@media (max-width: 600px) {
    .topbar .account-toggle {
        min-width: 0;
        padding: 4px;
        gap: 4px;
    }
    .account-identity {
        display: none;
    }
    .account-menu-links {
        position: fixed;
        top: 62px;
        right: 12px;
        width: 310px;
    }
    .topbar .topbar-title {
        flex: 1;
    }
    .account-avatar {
        width: 29px;
        height: 29px;
        flex-basis: 29px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .account-caret {
        transition: none;
    }
}
