/* Nexus CEO paneli — mevcut admin üzerine kimlik katmanı. */

html[data-theme="light"],
:root {
    --nx-primary: #421b35;
    --nx-bg: #f5f0ea;
    --nx-card: #ffffff;
    --nx-accent: #b58a32;
    --nx-success: #2f6b3c;
    --nx-warning: #c56a1a;
    --nx-danger: #a33b3b;
    --nx-muted: #7a6170;
    --nx-border: #e5d9cf;
    --nx-radius: 10px;
    --nx-shadow: 0 1px 2px rgba(66, 27, 53, 0.06);

    --primary: #421b35;
    --secondary: #421b35;
    --accent: #b58a32;
    --primary-fg: #fff;

    --body-fg: #421b35;
    --body-bg: #f5f0ea;
    --body-quiet-color: #7a6170;
    --body-medium-color: #3a1830;
    --body-loud-color: #2a1022;

    --header-color: #f5f0ea;
    --header-branding-color: #b58a32;
    --header-bg: #421b35;
    --header-link-color: #f5f0ea;

    --breadcrumbs-fg: #d8c8d0;
    --breadcrumbs-link-fg: #f5f0ea;
    --breadcrumbs-bg: #35162b;

    --link-fg: #8a6424;
    --link-hover-color: #421b35;
    --link-selected-fg: #b58a32;

    --hairline-color: #e5d9cf;
    --border-color: #d8c8bc;
    --error-fg: #a33b3b;

    --darkened-bg: #efe8e0;
    --selected-bg: #efe4d4;
    --selected-row: #f4ead8;

    --button-fg: #fff;
    --button-bg: #421b35;
    --button-hover-bg: #2a1022;
    --default-button-bg: #b58a32;
    --default-button-hover-bg: #8a6424;
    --close-button-bg: #7a6170;
    --close-button-hover-bg: #421b35;

    --font-family-primary:
        "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
    --nx-primary: #f5f0ea;
    --nx-bg: #1c1018;
    --nx-card: #2a1524;
    --nx-accent: #d4a85a;
    --body-fg: #eadfd6;
    --body-bg: #1c1018;
    --header-bg: #2a1524;
}

html {
    color-scheme: light;
}

body {
    background: var(--nx-bg);
    color: var(--nx-primary);
}

#header {
    background: var(--nx-primary);
    border-bottom: 1px solid #b58a32;
    padding: 0.7rem 1.25rem;
    align-items: center;
}

#branding h1,
#site-name a,
#site-name a:link,
#site-name a:visited {
    color: #b58a32 !important;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 1.05rem;
}

#user-tools {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.82rem;
    color: #f5f0ea;
}

#user-tools a,
#user-tools button {
    color: #f5f0ea;
    font-weight: 500;
}

.nx-user-name {
    font-weight: 600;
    color: #f5f0ea;
}

.nx-badge {
    display: inline-block;
    min-width: 1.1rem;
    padding: 0 0.35rem;
    margin-left: 0.25rem;
    border-radius: 8px;
    background: #b58a32;
    color: #421b35;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.nx-notify {
    position: relative;
}

.nx-notify summary {
    list-style: none;
    cursor: pointer;
}

.nx-notify summary::-webkit-details-marker {
    display: none;
}

.nx-notify-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 16.5rem;
    background: #fff;
    color: #421b35;
    border: 1px solid var(--nx-border);
    border-radius: 10px;
    box-shadow: var(--nx-shadow);
    padding: 0.75rem;
    z-index: 40;
}

.nx-notify-panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nx-notify-panel li {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--nx-border);
    font-size: 0.8rem;
}

.nx-notify-panel a {
    color: #421b35 !important;
}

.theme-toggle {
    display: none !important;
}

#nav-sidebar {
    background: #421b35;
    border-right: 0;
    color: #f5f0ea;
}

.nx-nav-brand {
    display: none;
}

.nx-nav-label {
    margin: 1rem 0 0.35rem;
    padding: 0 1rem;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: #b58a32;
    font-weight: 650;
}

#nav-sidebar table,
#nav-sidebar th,
#nav-sidebar td,
#nav-sidebar tr {
    border: 0 !important;
}

#nav-sidebar .module {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
    margin: 0 0 0.4rem;
}

#nav-sidebar .module th,
#nav-sidebar .module caption {
    background: transparent !important;
    padding: 0.35rem 0.6rem 0.35rem 1rem;
}

#nav-sidebar a,
#nav-sidebar a:link,
#nav-sidebar a:visited {
    color: #f3e8ee !important;
    font-weight: 500;
}

#nav-sidebar tr {
    background: transparent !important;
}

#nav-sidebar tr:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

#nav-sidebar .current-model {
    background: rgba(181, 138, 50, 0.2) !important;
}

#nav-sidebar .current-model a {
    color: #b58a32 !important;
    font-weight: 650;
}

#nav-filter {
    margin: 0.75rem 0.85rem;
    width: calc(100% - 1.7rem);
    border-radius: 8px;
    border: 1px solid #5c3a50;
    background: #35162b;
    color: #f5f0ea;
}

.toggle-nav-sidebar {
    background: #35162b;
    color: #b58a32;
    border-right-color: #35162b;
}

.breadcrumbs {
    background: #35162b;
}

#content {
    padding: 1.25rem 1.5rem 2.5rem;
}

#content h1,
#content h2,
.module caption,
.inline-group h2 {
    color: #421b35;
    font-weight: 650;
}

.module {
    background: #fff;
    border: 1px solid var(--nx-border);
    border-radius: 10px;
    box-shadow: var(--nx-shadow);
}

#changelist {
    background: transparent;
}

#changelist .results {
    background: #fff;
    border: 1px solid var(--nx-border);
    border-radius: 10px;
}

.object-tools a {
    border-radius: 8px;
}

input[type="submit"],
.submit-row input,
a.button {
    border-radius: 8px;
}

.login {
    background: #f5f0ea;
}

.login #header {
    background: #421b35;
}

.login #content {
    background: #fff;
    border: 1px solid var(--nx-border);
    border-radius: 12px;
    box-shadow: var(--nx-shadow);
}

/* Dashboard */

.nx-home {
    max-width: 1120px;
}

.nx-hero {
    margin: 0 0 1.4rem;
}

.nx-hero h1 {
    margin: 0;
    font-size: 1.65rem;
    letter-spacing: -0.02em;
    color: #421b35;
}

.nx-hero-sub {
    margin: 0.3rem 0 0;
    color: var(--nx-muted);
    font-size: 0.92rem;
}

.nx-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.4rem;
}

.nx-kpi {
    display: block;
    background: #fff;
    border: 1px solid var(--nx-border);
    border-radius: 10px;
    box-shadow: var(--nx-shadow);
    padding: 0.9rem 1rem 0.95rem;
    text-decoration: none !important;
    color: inherit;
}

.nx-kpi-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--nx-muted);
}

.nx-kpi-value {
    display: block;
    margin: 0.25rem 0 0.15rem;
    font-size: 1.55rem;
    line-height: 1.1;
    color: #421b35;
    font-weight: 700;
}

.nx-kpi-alt {
    display: block;
    font-size: 0.8rem;
    color: var(--nx-muted);
}

.nx-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.9fr);
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.nx-layout-bottom {
    grid-template-columns: minmax(0, 1.1fr) minmax(16rem, 0.9fr);
}

.nx-side {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.nx-panel {
    background: #fff;
    border: 1px solid var(--nx-border);
    border-radius: 10px;
    box-shadow: var(--nx-shadow);
    padding: 1.05rem 1.15rem 1.15rem;
}

.nx-panel h2 {
    margin: 0;
    font-size: 1rem;
}

.nx-panel-lead {
    margin: 0.2rem 0 0.85rem;
    color: var(--nx-muted);
    font-size: 0.85rem;
}

.nx-empty {
    margin: 0;
    color: var(--nx-muted);
    font-size: 0.9rem;
}

.nx-today {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nx-today li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    border-top: 1px solid var(--nx-border);
}

.nx-today li:first-child {
    border-top: 0;
    padding-top: 0;
}

.nx-today-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.nx-today-main strong {
    font-size: 0.95rem;
}

.nx-today-desc,
.nx-today-meta {
    font-size: 0.82rem;
    color: var(--nx-muted);
}

.nx-today-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex: 0 0 auto;
}

.nx-status {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 650;
    padding: 0.15rem 0.45rem;
    border-radius: 8px;
    background: #efe8e0;
    color: #421b35;
    white-space: nowrap;
}

.nx-status-success {
    background: #e6f1e8;
    color: #2f6b3c;
}

.nx-status-warning {
    background: #f8ecdc;
    color: #c56a1a;
}

.nx-status-danger {
    background: #f6e4e4;
    color: #a33b3b;
}

.nx-status-accent {
    background: #f4ead8;
    color: #8a6424;
}

.nx-btn {
    display: inline-block;
    padding: 0.28rem 0.7rem;
    border: 1px solid var(--nx-border);
    border-radius: 8px;
    background: #fff;
    color: #421b35 !important;
    text-decoration: none !important;
    font-size: 0.78rem;
    font-weight: 600;
}

.nx-btn:hover {
    border-color: #421b35;
}

.nx-btn-gold {
    background: #b58a32;
    border-color: #b58a32;
    color: #fff !important;
}

.nx-counts,
.nx-progress,
.nx-activity {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nx-counts li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.45rem 0;
    border-top: 1px solid var(--nx-border);
    font-size: 0.88rem;
}

.nx-counts li:first-child {
    border-top: 0;
}

.nx-counts em {
    font-style: normal;
    color: var(--nx-muted);
    font-size: 0.8rem;
}

.nx-progress li {
    margin-bottom: 0.7rem;
}

.nx-progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.nx-bar {
    height: 6px;
    background: #efe8e0;
    border-radius: 8px;
    overflow: hidden;
}

.nx-bar span {
    display: block;
    height: 100%;
    background: #b58a32;
    border-radius: 8px;
}

.nx-activity li {
    padding: 0.55rem 0 0.55rem 0.9rem;
    border-left: 2px solid #b58a32;
    margin: 0.15rem 0;
}

.nx-activity a {
    color: #421b35;
}

.nx-activity time {
    display: block;
    color: var(--nx-muted);
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.nx-ai-form {
    display: flex;
    gap: 0.5rem;
}

.nx-ai-form input[type="search"] {
    flex: 1;
    min-width: 0;
    border-radius: 8px;
    border: 1px solid var(--nx-border);
    padding: 0.5rem 0.7rem;
}

.nx-ai-answer {
    margin: 0.85rem 0 0;
    padding: 0.75rem 0.85rem;
    background: #f5f0ea;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.nx-proje-ozet {
    background: #fff;
    border: 1px solid var(--nx-border);
    border-radius: 10px;
    box-shadow: var(--nx-shadow);
    padding: 1.1rem 1.2rem 1.2rem;
    margin: 0 0 1.2rem;
}

.nx-proje-title {
    margin: 0 0 0.4rem !important;
    letter-spacing: 0.04em;
}

.nx-proje-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 0 0 1rem;
}

.nx-proje-meta dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nx-muted);
}

.nx-proje-meta dd {
    margin: 0.2rem 0 0;
    font-weight: 650;
}

.nx-proje-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--nx-border);
    border-bottom: 1px solid var(--nx-border);
}

.nx-proje-grid h3,
.nx-proje-lists h3 {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nx-muted);
}

.nx-proje-figure {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #421b35;
}

.nx-proje-grid p,
.nx-proje-lists p,
.nx-proje-lists li {
    margin: 0;
    font-size: 0.85rem;
    color: var(--nx-muted);
}

.nx-proje-lists {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}

.nx-proje-lists ul {
    margin: 0;
    padding-left: 1rem;
}

@media (max-width: 1100px) {
    .nx-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nx-layout,
    .nx-layout-bottom,
    .nx-proje-meta,
    .nx-proje-grid,
    .nx-proje-lists {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    #header {
        padding: 0.65rem 0.9rem 0.65rem 2.6rem;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    #user-tools {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        margin: 0;
    }

    #nav-sidebar,
    #toggle-nav-sidebar {
        display: flex;
    }

    #nav-sidebar {
        display: block !important;
        position: fixed !important;
        top: 0;
        left: 0;
        z-index: 45;
        width: min(84vw, 280px) !important;
        height: 100vh;
        max-height: 100vh;
        flex: none !important;
        margin: 0 !important;
        visibility: visible !important;
        transform: translateX(-105%);
        transition: transform 0.18s ease-out;
        box-shadow: 4px 0 24px rgba(66, 27, 53, 0.18);
        overflow: auto;
    }

    #nav-sidebar .module th {
        overflow-wrap: normal;
        white-space: nowrap;
    }

    #toggle-nav-sidebar {
        position: fixed;
        top: 0.65rem;
        left: 0;
        z-index: 50;
        height: 2.2rem;
        width: 2.2rem;
        flex-basis: 2.2rem;
        background: #421b35;
        color: #b58a32;
        border: 0;
    }

    .main.shifted > #nav-sidebar {
        transform: translateX(0);
        margin: 0 !important;
    }

    .main > #nav-sidebar + .content,
    .main.shifted > #nav-sidebar + .content {
        max-width: 100% !important;
        width: 100%;
    }

    .nx-kpis,
    .nx-today li,
    .nx-ai-form {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .nx-today-side {
        align-items: flex-start;
        flex-direction: row;
    }

    #content {
        padding: 1rem;
    }

    .nx-hero h1 {
        font-size: 1.35rem;
    }
}

#nx-offline-bar {
    padding: 0.55rem 1.5rem;
    font-size: 0.84rem;
    line-height: 1.4;
    border-bottom: 1px solid var(--nx-border);
}

#nx-offline-bar.nx-bar-offline {
    background: #f8ecdc;
    color: #421b35;
}

#nx-offline-bar.nx-bar-syncing {
    background: #efe4d4;
    color: #421b35;
}

#nx-offline-bar.nx-bar-synced {
    background: #e7efe6;
    color: #2f6b3c;
}

#nx-offline-bar.nx-bar-failed {
    background: #f6e4e4;
    color: #a33b3b;
}

#nx-offline-bar .nx-sync-code {
    letter-spacing: 0.02em;
}

#nx-offline-bar.nx-bar-online {
    background: #efe8e0;
    color: #421b35;
}

#nx-offline-bar a {
    color: #8a6424;
    font-weight: 650;
}
