/* ============================================================
   Corex UI V2 — shell aliases.
   site.css no longer owns independent design values; every shell
   variable resolves from the single token source (corex.tokens.css),
   so palette, dark mode and dimensions propagate here automatically.
   ============================================================ */
:root {
    --bg: var(--cx-color-background);
    --surface: var(--cx-color-surface);
    --surface-hover: var(--cx-color-surface-muted);
    --border: var(--cx-color-border);
    --border-strong: var(--cx-color-border-strong);
    --text: var(--cx-color-text);
    --text-secondary: var(--cx-color-text-muted);
    --primary: var(--cx-color-primary);
    --primary-hover: var(--cx-color-primary-hover);
    --primary-soft: var(--cx-color-primary-soft);
    --success: var(--cx-color-success);
    --success-soft: var(--cx-color-success-soft);
    --warning: var(--cx-color-warning);
    --warning-soft: var(--cx-color-warning-soft);
    --danger: var(--cx-color-danger);
    --danger-soft: var(--cx-color-danger-soft);
    --sidebar-width: var(--cx-sidebar-width);
    --header-height: var(--cx-header-height);
    --radius-sm: var(--cx-radius-sm);
    --radius-md: var(--cx-radius-md);
    --radius-lg: var(--cx-radius-lg);
    --shadow-sm: var(--cx-shadow-sm);
    --shadow-md: var(--cx-shadow-md);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

html {
    font-size: 15px;
}

body {
    background: var(--cx-color-background);
    color: var(--cx-color-text);
    font-family: var(--cx-font-family);
    font-size: 13px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv05" 1;
}

a {
    color: inherit;
}

.settings-hub h1 {
    margin-top: 0;
    margin-bottom: 8px;
}

.settings-hub > p {
    margin-bottom: 28px;
    color: var(--text-secondary);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    max-width: 900px;
}

.settings-card {
    min-height: 110px;
    display: flex;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .settings-card:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.settings-card-title {
    font-size: 15px;
    font-weight: 650;
}


.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

.header-user-name {
    font-size: 13px;
    font-weight: 600;
}

.header-user-avatar {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

/* ------------------------------------------------ */
/* GLOBAL APP SHELL */
/* ------------------------------------------------ */

.app-content {
    min-height: 100vh;
}

.app-main {
    min-height: calc( 100vh - var(--header-height) );
}

/* ------------------------------------------------ */
/* APP LAUNCHER */
/* ------------------------------------------------ */

.launcher-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 48px;
}

.launcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

    .launcher-header h1 {
        margin: 0;
        font-size: 28px;
        line-height: 1.2;
    }

.launcher-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .launcher-actions a {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
        padding: 0 14px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
        color: var(--text);
        text-decoration: none;
        font-weight: 500;
        transition: background 0.15s ease, border-color 0.15s ease;
    }

        .launcher-actions a:hover {
            background: var(--surface-hover);
            border-color: var(--border-strong);
        }

.app-launcher {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax(150px, 180px) );
    gap: 18px;
}

.app-card {
    min-height: 150px;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

    .app-card:hover {
        transform: translateY(-2px);
        border-color: var(--border-strong);
        box-shadow: var(--shadow-md);
    }

.app-card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 14px;
    background: var(--primary-soft);
    font-size: 28px;
}

.app-card-title {
    font-size: 15px;
    font-weight: 650;
    text-align: center;
}

/* ------------------------------------------------ */
/* MODULE + SETTINGS SHELL */
/* ------------------------------------------------ */

.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
}

.application-card {
    min-height: 250px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.application-card-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 14px;
    background: var(--primary-soft);
    font-size: 26px;
}

.application-card-title {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.application-card-id {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.application-card-version {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
}

.application-card-state {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
}

.application-card-actions {
    width: 100%;
    margin-top: auto;
    padding-top: 18px;
}

    .application-card-actions form {
        margin: 0;
    }

    .application-card-actions button {
        width: 100%;
        min-height: 38px;
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-sm);
        background: var(--surface);
        font-family: inherit;
        font-weight: 600;
        cursor: pointer;
    }

        .application-card-actions button:hover {
            background: var(--surface-hover);
        }

/* Navigation appearance (.module-navigation / .module-navigation-item)
   is owned solely by corex.module-navigation.css under Corex UI V2.
   site.css keeps only shell structure below. */

.module-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    font-size: 15px;
    font-weight: 650;
}

/* ------------------------------------------------ */
/* APPLICATION MANAGEMENT */
/* ------------------------------------------------ */

.applications-page {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px 32px;
}

/* Categories on the left (code-defined ModuleCategory), search + grouped cards on the right. */
.applications-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--cx-space-6);
    align-items: start;
}

.applications-tabs {
    position: sticky;
    /* TR: Sabit üst çubuğun altında kalmasın. EN: Stay below the fixed top bar. */
    top: calc(var(--cx-header-height, 56px) + var(--cx-space-4));
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Same weight as the module sidebar title ("Ürünler", "Satış"). */
.applications-tabs-title {
    margin: 0 0 var(--cx-space-3);
    padding-inline: var(--cx-space-3);
    font-size: var(--cx-font-size-md, 15px);
    font-weight: 600;
    color: var(--cx-color-text);
}

.applications-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cx-space-2);
    min-height: 36px;
    padding: 0 var(--cx-space-3);
    color: var(--cx-color-text-muted);
    font-size: var(--cx-font-size-sm);
    text-decoration: none;
    border-radius: var(--cx-radius-md);
    border-inline-start: 2px solid transparent;
}

.applications-tab:hover {
    color: var(--cx-color-text);
    background: var(--cx-color-surface-muted);
}

.applications-tab--active {
    color: var(--cx-color-text);
    font-weight: var(--cx-font-weight-medium);
    background: var(--cx-color-primary-soft);
    border-inline-start-color: var(--cx-color-primary);
}

.applications-tab-count {
    color: var(--cx-color-text-subtle);
    font-size: var(--cx-font-size-xs);
    font-weight: var(--cx-font-weight-medium);
    font-variant-numeric: tabular-nums;
}

.applications-content {
    display: flex;
    flex-direction: column;
    gap: var(--cx-space-5);
    min-width: 0;
}

/* The corex list search sits on the page itself here, not in a full-height list workspace; the toolbar keeps its standard centered layout. */
.applications-search.cx-list-view {
    min-height: 0;
    background: transparent;
}

.applications-search .cx-list-toolbar {
    padding: 0;
    background: transparent;
    border: 0;
}

/* TR: Bu yerleşimde corex.list-view.js yüklü değil; arama, standart üç sütunlu araç çubuğunun orta sütununa doğrudan yerleşir.
   EN: corex.list-view.js is not loaded on this layout; the search goes straight into the middle column of the standard three-column toolbar. */
.applications-search .cx-list-toolbar > .cx-list-search {
    grid-column: 2;
}


.applications-group[hidden],
.applications-group .cx-card[hidden] {
    display: none;
}

.applications-group-title {
    display: flex;
    align-items: baseline;
    gap: var(--cx-space-2);
    margin: 0 0 var(--cx-space-3);
    color: var(--cx-color-text);
    font-size: var(--cx-font-size-md);
    font-weight: var(--cx-font-weight-semibold);
}

.applications-empty {
    margin: 0;
    color: var(--cx-color-text-muted);
    font-size: var(--cx-font-size-sm);
}

@media (max-width: 768px) {
    .applications-page { padding: 16px; }
    .applications-layout { grid-template-columns: 1fr; gap: var(--cx-space-4); }
    .applications-tabs { position: static; flex-direction: row; overflow-x: auto; }
    .applications-tabs-title { display: none; }
    .applications-tab { flex: none; border-inline-start: 0; }
}

.applications-header {
    margin-bottom: 28px;
}

    .applications-header > a {
        display: inline-block;
        margin-bottom: 16px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 13px;
    }

        .applications-header > a:hover {
            color: var(--text);
        }

    .applications-header h1 {
        margin: 0;
        font-size: 28px;
    }

    .application-management-card strong {
        display: block;
        margin-bottom: 3px;
        font-size: 15px;
    }

    .application-management-card small {
        color: var(--text-secondary);
    }

.application-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .application-actions form {
        margin: 0;
    }

    .application-actions button {
        min-height: 36px;
        padding: 0 14px;
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-sm);
        background: var(--surface);
        color: var(--text);
        font-family: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.12s ease, border-color 0.12s ease;
    }

        .application-actions button:hover {
            background: var(--surface-hover);
        }

/* ------------------------------------------------ */
/* COMMON CONTENT */
/* ------------------------------------------------ */

.module-main h1,
.applications-page h1,
.launcher-page h1 {
    letter-spacing: -0.025em;
}

.module-main h1 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 26px;
}

.module-main p {
    color: var(--text-secondary);
}

/* ------------------------------------------------ */
/* RESPONSIVE */
/* ------------------------------------------------ */

@media (max-width: 768px) {

    .launcher-page,
    .applications-page {
        padding: 24px 18px;
    }

    .launcher-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-launcher {
        grid-template-columns: repeat( 2, minmax(0, 1fr) );
    }

    .application-management-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

.company-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 900px;
    margin-top: 24px;
}

.company-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.company-list-meta {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
}

.company-select-button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

    .company-select-button:hover {
        background: var(--surface-hover);
    }

.company-active-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--success-soft);
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.header-company {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    margin-left: 6px;
    border-radius: var(--radius-md);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

    .header-company:hover {
        background: var(--surface-hover);
    }

.header-company-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-branch {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    margin-left: 4px;
}

.header-branch-label {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: default;
}

.header-branch:hover .header-branch-label {
    background: var(--surface-hover);
}

.header-branch-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 100;
    min-width: 200px;
    display: none;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.header-branch:hover .header-branch-menu {
    display: block;
}

.header-branch-menu form {
    margin: 0;
}

.header-branch-option {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

    .header-branch-option:hover {
        background: var(--surface-hover);
    }

    .header-branch-option.active {
        background: var(--primary-soft);
        color: var(--primary);
        font-weight: 650;
    }

    .header-branch-option.clear {
        margin-top: 4px;
        border-top: 1px solid var(--border);
        color: var(--text-secondary);
    }


.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: #f5f6f8;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    background: #ffffff;
    border: 1px solid #e2e5e9;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.06);
}

.auth-header {
    margin-bottom: 28px;
}

    .auth-header h1 {
        margin: 0 0 8px;
        font-size: 26px;
    }

    .auth-header p {
        margin: 0;
        color: #6b7280;
    }

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}

    .auth-field label {
        font-size: 13px;
        font-weight: 600;
    }

    .auth-field input {
        min-height: 44px;
        padding: 0 12px;
        border: 1px solid #d6d9de;
        border-radius: 9px;
        font: inherit;
    }

        .auth-field input:focus {
            outline: none;
            border-color: #8b8f97;
            box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
        }

.auth-primary-button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: #202124;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

    .auth-primary-button:disabled {
        opacity: 0.6;
        cursor: default;
    }

.auth-footer {
    margin-top: 22px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

    .auth-footer a {
        color: #202124;
        font-weight: 600;
        text-decoration: none;
    }

.auth-error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff1f1;
    color: #b42318;
    font-size: 13px;
}
.tenant-selection-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tenant-selection-item {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #ffffff;
    border: 1px solid #e2e5e9;
    border-radius: 10px;
    font: inherit;
    cursor: pointer;
}

    .tenant-selection-item:hover {
        background: #f8f9fa;
    }

.tenant-selection-name {
    font-weight: 600;
}

.tenant-selection-arrow {
    color: #6b7280;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: #f5f6f8;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    background: #ffffff;
    border: 1px solid #e2e5e9;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.06);
}

.auth-header {
    margin-bottom: 28px;
}

    .auth-header h1 {
        margin: 0 0 8px;
        font-size: 26px;
    }

    .auth-header p {
        margin: 0;
        color: #6b7280;
    }

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}

    .auth-field label {
        font-size: 13px;
        font-weight: 600;
    }

    .auth-field input {
        min-height: 44px;
        padding: 0 12px;
        border: 1px solid #d6d9de;
        border-radius: 9px;
        font: inherit;
    }

.auth-primary-button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: #202124;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.onboarding-card {
    max-width: 460px;
}

.auth-field-help {
    margin-top: -2px;
    color: #8a8f98;
    font-size: 12px;
    line-height: 1.5;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.topbar-user-name {
    font-size: 13px;
    font-weight: 600;
}

.topbar-user-email {
    margin-top: 2px;
    color: #8a8f98;
    font-size: 11px;
}

.topbar-user-avatar {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ece8ee;
    color: #4f4653;
    font-size: 13px;
    font-weight: 600;
}

.topbar-logout-form {
    margin: 0;
}

.topbar-logout-button {
    border: 0;
    background: transparent;
    color: #6b7280;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

    .topbar-logout-button:hover {
        color: #111827;
    }


.platform-empty-state {
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.platform-empty-state-content {
    width: 100%;
    max-width: 560px;
    text-align: center;
}

.platform-empty-state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e5e9;
    border-radius: 16px;
    background: #ffffff;
    font-size: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.platform-empty-state-content h1 {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 650;
}

.platform-empty-state-content p {
    max-width: 500px;
    margin: 0 auto 24px;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.7;
}

.platform-empty-state-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 9px;
    background: #202124;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

    .platform-empty-state-button:hover {
        background: #111214;
        color: #ffffff;
    }

.platform-empty-state-note {
    margin-top: 16px;
    color: #9ca3af;
    font-size: 12px;
}

.platform-app-launcher {
    min-height: calc(100vh - 68px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 70px 40px;
    background: linear-gradient( 135deg, #efeff6 0%, #e7e6ef 55%, #f1eff5 100% );
}

.platform-app-launcher-grid {
    width: 100%;
    max-width: 1050px;
    display: grid;
    grid-template-columns: repeat(6, 120px);
    justify-content: center;
    column-gap: 42px;
    row-gap: 38px;
}
.platform-app-launcher-item {
    width: 120px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 10px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 10px;
    color: #111827;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .platform-app-launcher-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    }

.platform-app-launcher-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    /* Art�k ikonun kendi beyaz kutusu yok */
    background: transparent;
    border: 0;
    box-shadow: none;
}

.platform-app-launcher-title {
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: #111827;
}

@media (max-width: 1100px) {
    .platform-app-launcher-grid {
        grid-template-columns: repeat(5, 120px);
    }
}

@media (max-width: 850px) {
    .platform-app-launcher-grid {
        grid-template-columns: repeat(4, 120px);
    }
}

@media (max-width: 650px) {
    .platform-app-launcher {
        padding: 40px 20px;
    }

    .platform-app-launcher-grid {
        grid-template-columns: repeat(3, 100px);
        column-gap: 20px;
    }

    .platform-app-launcher-item {
        width: 100px;
    }

    .platform-app-launcher-icon {
        width: 72px;
        height: 72px;
    }

    .platform-app-launcher-title {
        width: 100px;
    }
}}

.app-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    font-size: 17px;
    font-weight: 700;
}

.app-brand-icon {
    width: 28px;
    height: 28px;
    display: block;
    border-radius: 8px;
}

.settings-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid #e5e7eb;
}

.settings-tab {
    padding: 0 0 12px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

    .settings-tab:hover {
        color: #111827;
    }

    .settings-tab.active {
        color: #111827;
        border-bottom-color: #312e81;
    }

.branch-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.branch-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.branch-list-name {
    font-weight: 600;
}

.branch-list-meta {
    color: #9ca3af;
    font-size: 12px;
}

/* ============================================================
   AUTH / TENANT / ONBOARDING — Corex tasarım sistemi (navy) hizası
   Not: Bu blok yukarıdaki eski, sabit-renkli .auth-* kurallarını
   cascade'de geçersiz kılar; hepsi artık token üzerinden.
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--cx-space-8);
    color: var(--cx-color-text);
    background: var(--cx-color-background);
    font-family: var(--cx-font-family);
}

.auth-card,
.onboarding-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 25rem;
    padding: var(--cx-space-8);
    background: var(--cx-color-surface);
    border: 1px solid var(--cx-color-border);
    border-radius: var(--cx-radius-lg);
    box-shadow: var(--cx-shadow-md);
}

.onboarding-card {
    max-width: 28rem;
}

.auth-header {
    margin-bottom: var(--cx-space-6);
}

.auth-header h1 {
    margin: 0 0 var(--cx-space-2);
    color: var(--cx-color-text);
    font-size: var(--cx-font-size-2xl);
    font-weight: var(--cx-font-weight-semibold);
    letter-spacing: -0.02em;
}

.auth-header p {
    margin: 0;
    color: var(--cx-color-text-muted);
    font-size: var(--cx-font-size-sm);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--cx-space-2);
    margin-bottom: var(--cx-space-4);
}

.auth-field label {
    color: var(--cx-color-text);
    font-size: var(--cx-font-size-sm);
    font-weight: var(--cx-font-weight-medium);
}

.auth-field input {
    box-sizing: border-box;
    min-height: var(--cx-space-10);
    padding: var(--cx-space-2) var(--cx-space-3);
    color: var(--cx-color-text);
    background: var(--cx-color-surface);
    border: 1px solid var(--cx-color-border-strong);
    border-radius: var(--cx-radius-md);
    font: inherit;
    font-size: var(--cx-font-size-sm);
}

.auth-field input::placeholder {
    color: var(--cx-color-text-subtle);
}

.auth-field input:hover {
    border-color: var(--cx-color-text-subtle);
}

.auth-field input:focus {
    outline: none;
    border-color: var(--cx-color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-color-primary) 16%, transparent);
}

.auth-field-help {
    margin-top: calc(var(--cx-space-1) * -1);
    color: var(--cx-color-text-muted);
    font-size: var(--cx-font-size-xs);
    line-height: 1.5;
}

.auth-primary-button {
    box-sizing: border-box;
    width: 100%;
    min-height: var(--cx-space-10);
    margin-top: var(--cx-space-2);
    color: var(--cx-color-text-inverse);
    background: var(--cx-gradient-brand);
    border: 1px solid transparent;
    border-radius: var(--cx-radius-md);
    font: inherit;
    font-size: var(--cx-font-size-sm);
    font-weight: var(--cx-font-weight-semibold);
    cursor: pointer;
    transition: filter 120ms ease;
}

.auth-primary-button:not(:disabled):hover {
    filter: brightness(0.95);
}

.auth-primary-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-color-primary) 24%, transparent);
}

.auth-primary-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.auth-footer {
    margin-top: var(--cx-space-5);
    color: var(--cx-color-text-muted);
    font-size: var(--cx-font-size-sm);
    text-align: center;
}

.auth-footer a {
    color: var(--cx-color-primary);
    font-weight: var(--cx-font-weight-semibold);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-error {
    margin-bottom: var(--cx-space-4);
    padding: var(--cx-space-2) var(--cx-space-3);
    color: var(--cx-color-danger);
    background: color-mix(in srgb, var(--cx-color-danger) 10%, var(--cx-color-surface));
    border: 1px solid color-mix(in srgb, var(--cx-color-danger) 30%, var(--cx-color-surface));
    border-radius: var(--cx-radius-md);
    font-size: var(--cx-font-size-sm);
}

.tenant-selection-list {
    display: flex;
    flex-direction: column;
    gap: var(--cx-space-2);
}

.tenant-selection-item {
    box-sizing: border-box;
    width: 100%;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--cx-space-4);
    color: var(--cx-color-text);
    background: var(--cx-color-surface);
    border: 1px solid var(--cx-color-border);
    border-radius: var(--cx-radius-md);
    font: inherit;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.tenant-selection-item:hover {
    background: var(--cx-color-surface-muted);
    border-color: var(--cx-color-border-strong);
}

.tenant-selection-item:focus-visible {
    outline: none;
    border-color: var(--cx-color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-color-primary) 16%, transparent);
}

.tenant-selection-name {
    font-weight: var(--cx-font-weight-semibold);
}

.tenant-selection-arrow {
    color: var(--cx-color-text-subtle);
}

/* ============================================================
   PLATFORM ANA SAYFA — %50 uygulamalar / %50 hızlı aksiyon
   ============================================================ */
.platform-home {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(30rem, 1fr);
    min-height: calc(100vh - var(--cx-header-height));
    overflow-x: clip;
    background: var(--cx-color-background);
    font-family: var(--cx-font-family);
    transition: grid-template-columns 220ms ease;
}

.platform-home.is-quick-collapsed {
    grid-template-columns: minmax(0, 1fr) 4.25rem;
}

.platform-home > * {
    position: relative;
    z-index: 1;
}

.platform-home-apps {
    min-width: 0;
    padding: var(--cx-space-8);
}

/* Sağ: hızlı aksiyon paneli (ekranın sağını kaplar) */
.platform-quick {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--cx-space-8);
    background: var(--cx-color-surface);
    border-inline-start: 1px solid var(--cx-color-border);
    overflow: hidden;
    transition: padding 220ms ease;
}

.platform-quick-toggle {
    position: absolute;
    z-index: 3;
    inset-block-start: var(--cx-space-5);
    inset-inline-end: var(--cx-space-5);
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    place-items: center;
    color: var(--cx-color-primary);
    background: var(--cx-color-primary-soft);
    border: 1px solid color-mix(in srgb, var(--cx-color-primary) 18%, var(--cx-color-border));
    border-radius: var(--cx-radius-lg);
    cursor: pointer;
    transition: color 120ms ease, background-color 120ms ease, inset-inline-end 220ms ease;
}

.platform-quick-toggle:hover {
    color: var(--cx-color-text-inverse);
    background: var(--cx-color-primary);
}

.platform-quick-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-color-primary) 18%, transparent);
}

.platform-quick-toggle svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.platform-quick-toggle__close,
.platform-home:not(.is-quick-collapsed) .platform-quick-toggle__bell,
.platform-home:not(.is-quick-collapsed) .platform-quick-toggle__badge {
    display: none;
}

.platform-home:not(.is-quick-collapsed) .platform-quick-toggle__close {
    display: block;
}

.platform-quick-toggle__badge {
    position: absolute;
    inset-block-start: -0.35rem;
    inset-inline-end: -0.35rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding-inline: 0.25rem;
    color: var(--cx-color-text-inverse);
    background: var(--cx-color-danger);
    border: 2px solid var(--cx-color-surface);
    border-radius: var(--cx-radius-round);
    font-size: 0.625rem;
    font-weight: var(--cx-font-weight-bold);
    line-height: 0.95rem;
}

.platform-quick-content {
    min-width: 28rem;
    opacity: 1;
    transition: opacity 130ms ease 90ms;
}

.platform-home.is-quick-collapsed .platform-quick {
    padding-inline: 0;
}

.platform-home.is-quick-collapsed .platform-quick-toggle {
    inset-inline-end: 0.875rem;
}

.platform-home.is-quick-collapsed .platform-quick-content {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition-delay: 0ms;
}

/* Üst: hızlı-filtre kutuları */
.platform-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cx-space-2);
    margin-block-end: var(--cx-space-5);
}

.platform-qf {
    display: inline-flex;
    align-items: center;
    gap: var(--cx-space-2);
    padding: var(--cx-space-2) var(--cx-space-3);
    color: var(--cx-color-text);
    background: var(--cx-color-surface);
    border: 1px solid var(--cx-color-border);
    border-radius: var(--cx-radius-lg);
    font: inherit;
    font-size: var(--cx-font-size-sm);
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.platform-qf:hover {
    border-color: var(--cx-color-border-strong);
}

.platform-qf:focus-visible {
    outline: none;
    border-color: var(--cx-color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-color-primary) 16%, transparent);
}

.platform-qf-name {
    font-weight: var(--cx-font-weight-semibold);
}

.platform-qf-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding-inline: var(--cx-space-2);
    color: var(--cx-color-text-muted);
    background: var(--cx-color-surface-muted);
    border-radius: var(--cx-radius-round);
    font-size: var(--cx-font-size-xs);
    font-weight: var(--cx-font-weight-bold);
    font-variant-numeric: tabular-nums;
}

.platform-qf.is-active {
    color: var(--cx-color-text-inverse);
    background: var(--cx-color-primary);
    border-color: var(--cx-color-primary);
}

.platform-qf.is-active .platform-qf-count {
    color: var(--cx-color-text-inverse);
    background: rgb(255 255 255 / 20%);
}

/* Alt: işler */
.platform-works {
    display: flex;
    flex-direction: column;
    gap: var(--cx-space-2);
    min-height: 0;
    overflow-y: auto;
}

.platform-work {
    display: flex;
    align-items: center;
    gap: var(--cx-space-3);
    padding: var(--cx-space-3) var(--cx-space-4);
    color: var(--cx-color-text);
    background: var(--cx-color-surface);
    border: 1px solid var(--cx-color-border);
    border-radius: var(--cx-radius-lg);
    box-shadow: var(--cx-shadow-sm);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 130ms ease, box-shadow 130ms ease;
}

.platform-work:hover {
    border-color: var(--cx-color-border-strong);
    box-shadow: var(--cx-shadow-md);
}

.platform-work[hidden] {
    display: none;
}

.platform-work-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    border-radius: var(--cx-radius-lg);
}

.platform-work-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.platform-work-icon--danger {
    color: var(--cx-color-danger);
    background: color-mix(in srgb, var(--cx-color-danger) 12%, var(--cx-color-surface));
}

.platform-work-icon--warning {
    color: var(--cx-color-warning);
    background: color-mix(in srgb, var(--cx-color-warning) 14%, var(--cx-color-surface));
}

.platform-work-icon--info {
    color: var(--cx-color-info);
    background: color-mix(in srgb, var(--cx-color-info) 12%, var(--cx-color-surface));
}

.platform-work-body {
    flex: 1;
    min-width: 0;
}

.platform-work-title {
    color: var(--cx-color-text);
    font-size: var(--cx-font-size-sm);
    font-weight: var(--cx-font-weight-semibold);
    letter-spacing: -0.01em;
}

.platform-work-meta {
    margin-block-start: 2px;
    color: var(--cx-color-text-subtle);
    font-size: var(--cx-font-size-xs);
}

.platform-work-right {
    display: flex;
    align-items: center;
    gap: var(--cx-space-3);
    flex: none;
}

.platform-work-count {
    color: var(--cx-color-text);
    font-size: var(--cx-font-size-md);
    font-weight: var(--cx-font-weight-bold);
    font-variant-numeric: tabular-nums;
}

.platform-work-count--danger {
    color: var(--cx-color-danger);
}

.platform-work-go {
    display: grid;
    place-items: center;
    width: 1.875rem;
    height: 1.875rem;
    flex: none;
    color: var(--cx-color-text-muted);
    background: var(--cx-color-surface-muted);
    border-radius: var(--cx-radius-sm);
    opacity: 0;
    transition: opacity 120ms ease;
}

.platform-work:hover .platform-work-go {
    opacity: 1;
}

.platform-work-go svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 60rem) {
    .platform-home {
        grid-template-columns: minmax(0, 1fr) minmax(22rem, 70vw);
    }

    .platform-home.is-quick-collapsed { grid-template-columns: minmax(0, 1fr) 4.25rem; }

    .platform-home::before {
        opacity: 0.72;
    }

    .platform-quick {
        border-inline-start: 1px solid var(--cx-color-border);
    }
}

/* TR: Dar ekranda (telefon) "hızlı aksiyon" paneli artık ikinci bir grid sütunu olarak ayrılmaz — kapalıyken bile
   4.25rem'lik boş/beyaz bir şerit bırakıyordu (zil orada asılı kalıyordu). Arvo AI çekmecesiyle aynı desen: tam genişlik
   overlay, sağdan kayarak açılır/kapanır; toggle buton sabit (fixed) konuma alınır. EN: On narrow (phone) viewports the
   quick-action panel no longer reserves a second grid column — even collapsed it left a blank/white 4.25rem strip (with
   the bell stranded in it). Same pattern as the Arvo AI drawer: full-width overlay, slides in/out from the right; the
   toggle button becomes fixed-positioned. */
@media (max-width: 40rem) {
    .platform-home,
    .platform-home.is-quick-collapsed {
        grid-template-columns: minmax(0, 1fr);
    }

    .platform-quick-toggle {
        position: fixed;
        inset-block-start: auto;
        inset-block-end: var(--cx-space-5);
        inset-inline-end: var(--cx-space-5);
        z-index: 4;
        box-shadow: var(--cx-shadow-lg);
    }

    /* TR: transform yerine inset-inline-end ile kaydırılır — .platform-quick-toggle bu elemanın İÇİNDE bir position:fixed
       çocuğu olduğundan, bir transform burada yeni bir containing block yaratıp toggle'ı viewport'tan koparır (asıl bug
       buydu). EN: Slides via inset-inline-end, not transform — .platform-quick-toggle is a position:fixed CHILD of this
       element, so a transform here would create a new containing block and detach the toggle from the viewport (this was
       the actual bug). */
    .platform-quick {
        position: fixed;
        inset-block: var(--cx-header-height) 0;
        inset-inline-end: min(-100vw, -26rem);
        z-index: 3;
        width: min(100vw, 26rem);
        padding: var(--cx-space-6) !important;
        box-shadow: var(--cx-shadow-lg);
        transition: inset-inline-end 220ms ease;
    }

    .platform-home:not(.is-quick-collapsed) .platform-quick {
        inset-inline-end: 0;
    }

    .platform-quick-content {
        min-width: 0;
    }
}

/* Boş durum — token/navy hizası */
.platform-empty-state-icon {
    color: var(--cx-color-text-muted);
    background: var(--cx-color-surface);
    border-color: var(--cx-color-border);
}

.platform-empty-state-content h1 {
    color: var(--cx-color-text);
}

.platform-empty-state-content p {
    color: var(--cx-color-text-muted);
}

.platform-empty-state-button {
    background: var(--cx-gradient-brand);
    color: var(--cx-color-text-inverse);
}

.platform-empty-state-button:hover {
    filter: brightness(0.95);
    color: var(--cx-color-text-inverse);
}

.platform-empty-state-note {
    color: var(--cx-color-text-subtle);
}

/* Sağ panel — corex-tabs bileşenini tam yükseklikte doldur */
.platform-quick .cx-tabs {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.platform-quick .cx-tab-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding-block: var(--cx-space-4) 0;
}

.platform-quick .cx-tab-panel[hidden] {
    display: none;
}

.platform-quick .platform-works {
    flex: 1 1 auto;
}

/* Arvo AI — sohbet ekranı */
.platform-ai {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.platform-ai-messages {
    display: flex;
    flex-direction: column;
    gap: var(--cx-space-4);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-block-end: var(--cx-space-4);
}

.ai-msg {
    display: flex;
    gap: var(--cx-space-3);
    max-width: 100%;
}

.ai-msg-avatar {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: none;
    color: var(--cx-color-text-inverse);
    background: var(--cx-color-primary);
    border-radius: var(--cx-radius-md);
    font-size: var(--cx-font-size-xs);
    font-weight: var(--cx-font-weight-bold);
}

.ai-msg-content {
    min-width: 0;
}

.ai-msg-bubble {
    padding: var(--cx-space-3) var(--cx-space-4);
    color: var(--cx-color-text);
    background: var(--cx-color-surface-muted);
    border-radius: var(--cx-radius-lg);
    font-size: var(--cx-font-size-sm);
    line-height: 1.55;
}

.ai-msg--user {
    flex-direction: row-reverse;
}

.ai-msg--user .ai-msg-avatar {
    color: var(--cx-color-primary);
    background: var(--cx-color-primary-soft);
}

.ai-msg--user .ai-msg-bubble {
    color: var(--cx-color-text-inverse);
    background: var(--cx-color-primary);
}

.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cx-space-2);
    margin-block-start: var(--cx-space-2);
}

.ai-suggestion {
    padding: var(--cx-space-2) var(--cx-space-3);
    color: var(--cx-color-text-muted);
    background: var(--cx-color-surface);
    border: 1px solid var(--cx-color-border);
    border-radius: var(--cx-radius-round);
    font: inherit;
    font-size: var(--cx-font-size-xs);
    cursor: pointer;
    transition: border-color 120ms ease, color 120ms ease;
}

.ai-suggestion:hover {
    color: var(--cx-color-text);
    border-color: var(--cx-color-border-strong);
}

.platform-ai-input {
    display: flex;
    align-items: flex-end;
    gap: var(--cx-space-2);
    padding-block-start: var(--cx-space-3);
    border-block-start: 1px solid var(--cx-color-border);
}

.platform-ai-input textarea {
    box-sizing: border-box;
    flex: 1;
    min-height: 2.5rem;
    max-height: 8rem;
    padding: var(--cx-space-2) var(--cx-space-3);
    color: var(--cx-color-text);
    background: var(--cx-color-surface);
    border: 1px solid var(--cx-color-border-strong);
    border-radius: var(--cx-radius-md);
    font: inherit;
    font-size: var(--cx-font-size-sm);
    line-height: 1.45;
    resize: none;
}

.platform-ai-input textarea:focus {
    outline: none;
    border-color: var(--cx-color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-color-primary) 16%, transparent);
}

.platform-ai-send {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    color: var(--cx-color-text-inverse);
    background: var(--cx-gradient-brand);
    border: 0;
    border-radius: var(--cx-radius-md);
    cursor: pointer;
    transition: filter 120ms ease;
}

.platform-ai-send:hover {
    filter: brightness(0.95);
}

.platform-ai-send svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-password-control {
    position: relative;
}

.auth-password-control input {
    width: 100%;
    padding-inline-end: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0.375rem;
    display: inline-grid;
    width: 2.25rem;
    padding: 0;
    place-items: center;
    color: var(--cx-color-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--cx-radius-sm);
    cursor: pointer;
}

.auth-password-toggle:hover {
    color: var(--cx-color-text);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--cx-color-primary);
    outline-offset: -2px;
}

.auth-password-icon {
    width: 1.125rem;
    height: 1.125rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.75;
}

.auth-password-icon[hidden] {
    display: none;
}

/* ============================================================
   COREX UI V2 — SHELL (exact Lovable dimensions).
   site.css owns the global topbar and module content gutter;
   Corex.UI owns the module grid, sidebar and navigation.
   ============================================================ */
/* Topbar — 44px */
.app-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: var(--cx-z-header);
    align-items: center;
    justify-content: space-between;
    height: var(--cx-header-height);
    min-height: var(--cx-header-height);
    padding: 0 12px;
    gap: 8px;
    background: var(--cx-shell);
    border-bottom: 1px solid var(--cx-shell-border);
    font-size: 12.5px;
    font-weight: 400;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--cx-radius-sm);
    color: var(--cx-shell-muted);
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}

    .header-icon-button:hover {
        background: var(--cx-color-surface-muted);
        color: var(--cx-shell-foreground);
    }

    .header-icon-button svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.header-company,
.header-branch-label {
    min-height: 28px;
    font-size: 12.5px;
    border-radius: var(--cx-radius-sm);
}

/* TR: Global görünüm (tema) anahtarı — topbar sağ kontrol grubu.
   EN: Global appearance (theme) switcher — topbar right-side control group. */
.topbar-theme {
    position: relative;
    display: inline-flex;
}

.topbar-theme-trigger {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.topbar-theme .cx-theme-ic {
    display: none;
}

.topbar-theme[data-current="light"] .cx-theme-ic--sun,
.topbar-theme[data-current="dark"] .cx-theme-ic--moon,
.topbar-theme[data-current="system"] .cx-theme-ic--sys,
.topbar-theme:not([data-current]) .cx-theme-ic--sys {
    display: block;
}

.topbar-theme-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: var(--cx-z-dropdown);
    min-width: 168px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--cx-space-1);
    background: var(--cx-color-surface);
    border: 1px solid var(--cx-color-border);
    border-radius: var(--cx-radius-md);
    box-shadow: var(--cx-shadow-lg);
}

.topbar-theme-menu[hidden] {
    display: none;
}

.topbar-theme-option {
    display: flex;
    align-items: center;
    gap: var(--cx-space-2);
    width: 100%;
    min-height: 32px;
    padding: 0 var(--cx-space-2);
    border: 0;
    border-radius: var(--cx-radius-sm);
    background: transparent;
    color: var(--cx-color-text);
    font-family: inherit;
    font-size: var(--cx-font-size-sm);
    text-align: left;
    cursor: pointer;
}

.topbar-theme-option:hover {
    background: var(--cx-color-surface-muted);
}

.topbar-theme-option:focus-visible {
    outline: 2px solid var(--cx-color-primary);
    outline-offset: -2px;
}

.topbar-theme-option svg {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--cx-color-text-muted);
}

.topbar-theme-option > span {
    flex: 1 1 auto;
}

.topbar-theme-option[aria-checked="true"] {
    color: var(--cx-color-primary);
    font-weight: var(--cx-font-weight-medium);
}

.topbar-theme-option[aria-checked="true"] svg {
    color: var(--cx-color-primary);
}

.topbar-theme-option[aria-checked="true"]::after {
    content: "✓";
    margin-left: auto;
    color: var(--cx-color-primary);
}

.topbar-user {
    gap: 8px;
}

.topbar-user-name {
    font-size: 12.5px;
}

.topbar-user-email {
    font-size: 11px;
    color: var(--cx-shell-muted);
}

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    background: var(--cx-color-primary-soft);
    color: var(--cx-color-accent-foreground);
    font-size: 12px;
}

.topbar-logout-button {
    font-size: 11.5px;
    color: var(--cx-shell-muted);
}

    .topbar-logout-button:hover {
        color: var(--cx-shell-foreground);
    }

/* Main — full width, dense gutter, no central cap */
.module-content {
    background: var(--cx-color-background);
}

.module-main {
    max-width: none;
    padding: 16px;
    margin: 0;
}

.cx-chat-notifications {
    position: fixed;
    z-index: 2000;
    inset-inline-end: 20px;
    inset-block-end: 20px;
    display: grid;
    width: min(360px, calc(100vw - 40px));
    gap: 8px;
}

.cx-chat-notifications[hidden] {
    display: none !important;
}

.cx-chat-notification {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 34px 12px 38px;
    color: var(--cx-color-text);
    background: var(--cx-color-surface);
    border: 1px solid var(--cx-color-border);
    border-radius: var(--cx-radius-lg);
    box-shadow: var(--cx-shadow-lg);
    text-decoration: none;
}

.cx-chat-notification__avatar {
    position: relative;
    overflow: hidden;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--cx-color-accent-foreground);
    background: var(--cx-color-primary);
    border-radius: var(--cx-radius-round);
    font-weight: 700;
}

.cx-chat-notification__avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cx-chat-notification__body {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.cx-chat-notification__body strong,
.cx-chat-notification__body small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-chat-notification__body small {
    color: var(--cx-color-text-muted);
}

.cx-chat-notification__count {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-end: 8px;
    display: grid;
    min-width: 20px;
    height: 20px;
    padding-inline: 4px;
    place-items: center;
    color: #fff;
    background: #dc2626;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.cx-chat-notification__close {
    position: absolute;
    inset-block-start: 7px;
    inset-inline-start: 10px;
    color: var(--cx-color-text-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.cx-chat-notification__close .cx-icon {
    width: 16px;
    height: 16px;
}

.cx-chat-notification__close:hover {
    color: var(--cx-color-text);
}

.cx-chat-new-button {
    width: 34px;
    min-width: 34px;
    padding-inline: 0;
    text-align: center;
    font-size: 20px;
    line-height: 1;
}

    .module-main h1 {
        font-size: 17px;
        font-weight: 600;
        letter-spacing: -0.01em;
        margin: 0 0 8px;
    }

@media (max-width: 768px) {
    .module-main {
        padding: 12px;
    }
}

/* Settings hub — align to V2 tokens */
.settings-tabs {
    gap: 20px;
    border-bottom-color: var(--cx-color-border);
}

.settings-tab {
    font-size: 12.5px;
    color: var(--cx-color-text-muted);
}

    .settings-tab:hover {
        color: var(--cx-color-text);
    }

    .settings-tab.active {
        color: var(--cx-color-primary);
        border-bottom-color: var(--cx-color-primary);
    }

.settings-card-title,
.app-card-title,
.application-card-title {
    font-size: 13px;
    font-weight: 600;
}

.cx-company-record-identity {
    width: min(100%, 56rem);
}

.cx-company-record-identity > div {
    flex: 1 1 auto;
    min-width: 0;
}

.cx-company-record-identity .cx-record-title .cx-field-control {
    width: 100%;
}
