/* Admin shell — Kopernik galaksi teması */
:root {
    --bg-page: #060814;
    --bg-elevated: rgba(18, 22, 36, 0.92);
    --bg-card: #1a1f2b;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --text: #f4f6fb;
    --text-muted: #9aa3b2;
    --accent: #6366f1;
    --accent-dim: rgba(99, 102, 241, 0.15);
    --topbar-h: 56px;
    --radius: 10px;
    --font: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.admin-body {
    position: relative;
    isolation: isolate;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(ellipse 120% 80% at 50% 100%, rgba(40, 25, 90, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 80% 50% at 15% 20%, rgba(30, 58, 120, 0.2) 0%, transparent 45%),
        radial-gradient(ellipse 60% 40% at 85% 30%, rgba(90, 40, 100, 0.15) 0%, transparent 40%),
        linear-gradient(165deg, #030510 0%, #0a0e1f 35%, #0d1228 70%, #080c18 100%);
    background-attachment: fixed;
}

/* İçerik galaksi katmanlarının üstünde — header burada OLMAMALI; aksi halde z-index:1,
   .topbar’daki z-index:100’ü ezer ve main ile aynı seviyede kalır; main DOM’da sonra
   geldiği için açılır menünün üzerine biner, menüye tıklanamaz. */
body.admin-body>main,
body.admin-body>.auth-shell {
    position: relative;
    z-index: 1;
}

/* Katman 1: ince yıldız alanı (SVG döşeme) */
body.admin-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Crect fill='%23030810' width='240' height='240'/%3E%3Ccircle cx='12' cy='18' r='0.6' fill='%23ffffff' opacity='0.55'/%3E%3Ccircle cx='44' cy='62' r='0.45' fill='%23e0e7ff' opacity='0.45'/%3E%3Ccircle cx='88' cy='31' r='0.5' fill='%23ffffff' opacity='0.7'/%3E%3Ccircle cx='120' cy='95' r='0.35' fill='%23c7d2fe' opacity='0.4'/%3E%3Ccircle cx='156' cy='44' r='0.65' fill='%23ffffff' opacity='0.65'/%3E%3Ccircle cx='198' cy='78' r='0.4' fill='%23a5b4fc' opacity='0.5'/%3E%3Ccircle cx='28' cy='112' r='0.5' fill='%23ffffff' opacity='0.5'/%3E%3Ccircle cx='72' cy='140' r='0.35' fill='%23e0e7ff' opacity='0.45'/%3E%3Ccircle cx='132' cy='168' r='0.55' fill='%23ffffff' opacity='0.6'/%3E%3Ccircle cx='182' cy='128' r='0.4' fill='%23c4b5fd' opacity='0.45'/%3E%3Ccircle cx='214' cy='190' r='0.5' fill='%23ffffff' opacity='0.55'/%3E%3Ccircle cx='38' cy='188' r='0.35' fill='%2393c5fd' opacity='0.4'/%3E%3Ccircle cx='96' cy='210' r='0.45' fill='%23ffffff' opacity='0.5'/%3E%3Ccircle cx='168' cy='22' r='0.5' fill='%23ddd6fe' opacity='0.5'/%3E%3Ccircle cx='220' cy='48' r='0.35' fill='%23ffffff' opacity='0.45'/%3E%3Ccircle cx='58' cy='88' r='0.65' fill='%23fef3c7' opacity='0.35'/%3E%3Ccircle cx='148' cy='118' r='0.4' fill='%23ffffff' opacity='0.55'/%3E%3Ccircle cx='200' cy='152' r='0.45' fill='%23a5b4fc' opacity='0.4'/%3E%3Ccircle cx='22' cy='152' r='0.4' fill='%23ffffff' opacity='0.48'/%3E%3Ccircle cx='110' cy='52' r='0.35' fill='%23e0e7ff' opacity='0.42'/%3E%3Ccircle cx='176' cy='200' r='0.5' fill='%23ffffff' opacity='0.52'/%3E%3Ccircle cx='8' cy='96' r='0.4' fill='%2393c5fd' opacity='0.38'/%3E%3Ccircle cx='232' cy='112' r='0.45' fill='%23ffffff' opacity='0.5'/%3E%3Ccircle cx='124' cy='8' r='0.35' fill='%23c7d2fe' opacity='0.45'/%3E%3Ccircle cx='66' cy='176' r='0.55' fill='%23ffffff' opacity='0.58'/%3E%3Ccircle cx='190' cy='96' r='0.35' fill='%23a78bfa' opacity='0.4'/%3E%3C/svg%3E");
    background-size: 240px 240px;
    opacity: 0.9;
    animation: galaxy-twinkle-a 7s ease-in-out infinite alternate;
}

/* Katman 2: daha seyrek, büyük yıldızlar + nebula parıltısı */
body.admin-body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1.2px 1.2px at 8% 12%, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(1px 1px at 22% 38%, rgba(200, 220, 255, 0.7), transparent),
        radial-gradient(1.5px 1.5px at 45% 8%, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1px 1px at 62% 42%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.2px 1.2px at 78% 18%, rgba(196, 181, 253, 0.65), transparent),
        radial-gradient(1px 1px at 92% 55%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.4px 1.4px at 35% 72%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 55% 88%, rgba(147, 197, 253, 0.55), transparent),
        radial-gradient(1.2px 1.2px at 18% 65%, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(1px 1px at 88% 78%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(ellipse 50% 35% at 50% 45%, rgba(99, 102, 241, 0.07) 0%, transparent 70%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    opacity: 0.85;
    animation: galaxy-twinkle-b 11s ease-in-out infinite alternate;
}

@keyframes galaxy-twinkle-a {
    0% {
        opacity: 0.72;
    }

    100% {
        opacity: 0.98;
    }
}

@keyframes galaxy-twinkle-b {
    0% {
        opacity: 0.65;
    }

    100% {
        opacity: 0.92;
    }
}

@media (prefers-reduced-motion: reduce) {

    body.admin-body::before,
    body.admin-body::after {
        animation: none;
        opacity: 0.85;
    }
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* ——— Üst çubuk (GitHub benzeri yatay menü) ——— */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    background: var(--bg-elevated);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.topbar__inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    font-weight: 700;
    font-size: 1rem;
}

.topbar__logo:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Orta menü — overflow scroll kullanılmaz; aksi halde absolute dropdown içeride kesilir */
.topnav {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.topnav__list {
    display: flex;
    align-items: stretch;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    height: var(--topbar-h);
}

.topnav__item {
    position: relative;
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}

.topnav__item--dropdown.is-open {
    z-index: 20;
}

.topnav__link,
.topnav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    white-space: nowrap;
    transition: color 0.12s ease, background 0.12s ease;
}

.topnav__link:hover,
.topnav__trigger:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.topnav__item--dropdown.is-open .topnav__trigger,
.topnav__item--dropdown.is-open .topnav__link {
    color: var(--text);
    background: rgba(99, 102, 241, 0.12);
}

.topnav__chev {
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.topnav__item--dropdown.is-open .topnav__chev {
    transform: rotate(180deg);
}

/* Mega dropdown */
.mega {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    min-width: 280px;
    max-width: min(360px, 92vw);
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s;
}

.mega--sm {
    min-width: 260px;
}

.topnav__item--dropdown.is-open .mega {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mega__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: inherit;
    transition: background 0.12s ease;
}

.mega__row:hover {
    background: var(--accent-dim);
}

.mega__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

/* Üst menü: ikon + metin */
.topnav__link--icon {
    gap: 6px;
}

.topnav__link-ic {
    flex-shrink: 0;
    opacity: 0.85;
}

/* Dropdown ikon renkleri */
.mega__icon--crm {
    background: rgba(59, 130, 246, 0.14);
    color: #3b82f6;
}

.mega__icon--lock {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
}

.mega__icon--pool {
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
}

.mega__icon--content {
    background: rgba(236, 72, 153, 0.14);
    color: #ec4899;
}

.mega__icon--chart {
    background: rgba(139, 92, 246, 0.14);
    color: #8b5cf6;
}

.mega__icon--domain {
    background: rgba(6, 182, 212, 0.14);
    color: #06b6d4;
}

.mega__icon--brief {
    background: rgba(99, 102, 241, 0.16);
    color: #818cf8;
}

.mega__icon--contract {
    background: rgba(249, 115, 22, 0.14);
    color: #f97316;
}

.mega__icon--finance {
    background: rgba(34, 197, 94, 0.14);
    color: #22c55e;
}

.mega__icon--pdf {
    background: rgba(14, 165, 233, 0.14);
    color: #0ea5e9;
}

.mega__icon--price {
    background: rgba(244, 63, 94, 0.14);
    color: #f43f5e;
}

.mega__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mega__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.mega__desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Sağ araçlar */
.topbar__tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar__search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 10px 0 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    min-width: 0;
    max-width: 220px;
}

.topbar__search-icon {
    flex-shrink: 0;
    opacity: 0.55;
    color: var(--text-muted);
}

.topbar__search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.8125rem;
    outline: none;
}

.topbar__search-input::placeholder {
    color: var(--text-muted);
}

/* Profil açılır menü */
.profile-dd {
    position: relative;
    flex-shrink: 0;
    align-self: center;
}

.profile-dd.is-open {
    z-index: 25;
}

.user-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 260px;
    max-width: min(300px, 92vw);
    padding: 0;
    overflow: hidden;
    background: #151a24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s;
}

.profile-dd.is-open .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.user-menu__head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-menu__name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #f4f6fb;
    letter-spacing: -0.01em;
}

.user-menu__email {
    margin-top: 2px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    word-break: break-all;
}

.user-menu__body {
    padding: 8px;
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: 8px;
    color: var(--text);
    transition: background 0.12s ease;
}

.user-menu__item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.user-menu__icon-wrap {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.user-menu__icon-wrap--profile {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.user-menu__item--profile .user-menu__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #e8ecf4;
}

.user-menu__sep {
    height: 1px;
    margin: 6px 4px;
    background: rgba(255, 255, 255, 0.08);
}

.user-menu__icon-wrap--logout {
    background: rgba(220, 38, 38, 0.16);
    color: #fca5a5;
}

.user-menu__item--logout .user-menu__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #f87171;
}

.user-menu__item--logout:hover {
    background: rgba(220, 38, 38, 0.1);
}

.user-menu__item--logout:hover .user-menu__label {
    color: #fca5a5;
}

.user-menu__form-logout {
    margin: 0;
}

button.user-menu__item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
}

.avatar:hover {
    filter: brightness(1.08);
}

/* Ana içerik alanı */
.main-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    min-height: calc(100vh - var(--topbar-h));
}

@media (max-width: 1024px) {
    .topbar__search {
        display: none;
    }
}

@media (max-width: 640px) {
    .topbar__inner {
        padding: 0 12px;
    }
}

/* ——— Giriş sayfası (guest) ——— */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-shell {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: #151a24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 28px 24px 32px;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.auth-card__brand {
    text-align: center;
    margin-bottom: 24px;
}

.auth-card__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    font-weight: 700;
    font-size: 1.125rem;
    color: #fff;
}

.auth-card__title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.auth-card__subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
}

.auth-input {
    height: 42px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-input--error {
    border-color: rgba(248, 113, 113, 0.6);
}

.auth-error {
    margin: 0;
    font-size: 0.8125rem;
    color: #f87171;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.auth-submit {
    margin-top: 4px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(145deg, #6366f1, #4f46e5);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.auth-submit:hover {
    filter: brightness(1.06);
}

.auth-submit:active {
    transform: translateY(1px);
}

/* ——— Genel uyarı bileşeni (x-alert) ——— */
.alert-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alert-stack:empty {
    display: none;
    margin: 0;
}

.auth-shell .alert-stack {
    margin-bottom: 1rem;
    width: 100%;
}

.app-alert {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 2.5rem 0.75rem 0.85rem;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.app-alert__content {
    flex: 1;
    min-width: 0;
}

.app-alert__text {
    margin: 0;
}

.app-alert__list {
    margin: 0;
    padding-left: 1.15rem;
}

.app-alert__list li {
    margin-bottom: 0.25rem;
}

.app-alert__list li:last-child {
    margin-bottom: 0;
}

.app-alert__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    cursor: pointer;
    opacity: 0.85;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.app-alert__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.14);
}

.app-alert--success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
    color: #86efac;
}

.app-alert--danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

.app-alert--warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fcd34d;
}

.app-alert--info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.35);
    color: #93c5fd;
}
