/* =========================
   CRM Modern UI Override
   ========================= */

:root {
    --crm-bg: #f4f7fb;
    --crm-surface: #ffffff;
    --crm-surface-2: #f8fafc;
    --crm-sidebar: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    --crm-primary: #2563eb;
    --crm-primary-2: #3b82f6;
    --crm-accent: #06b6d4;
    --crm-text: #0f172a;
    --crm-text-soft: #64748b;
    --crm-border: rgba(148, 163, 184, 0.18);
    --crm-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --crm-shadow-hover: 0 18px 40px rgba(15, 23, 42, 0.14);
    --crm-radius-xl: 24px;
    --crm-radius-lg: 18px;
    --crm-radius-md: 14px;
    --crm-transition: all 0.25s ease;
}

/* Genel */
body {
    background: var(--crm-bg);
    color: var(--crm-text);
}

.layout-container {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.08), transparent 22%),
        var(--crm-bg);
}

/* Sidebar */
.sidebar-container {
    background: transparent;
}

.sidebar {
    background: var(--crm-sidebar);
    border-right: 1px solid rgba(255,255,255,0.06);
    box-shadow: 8px 0 30px rgba(2, 6, 23, 0.18);
    padding: 18px 14px;
}

.sidebar .logo {
    margin-bottom: 18px;
}

.sidebar .logo img {
    display: block;
    margin: 0 auto;
}

/* Sidebar kullanıcı kartı */
.sidebar-user {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 16px;
    backdrop-filter: blur(10px);
    margin-bottom: 18px;
    transition: var(--crm-transition);
}

.sidebar-user:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.11);
}

.sidebar-user-image img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.22);
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

.sidebar-user-name {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    margin-top: 10px;
}

.sidebar-user-email {
    color: rgba(255,255,255,0.65);
    font-size: 12px;
    margin-top: 4px;
    word-break: break-word;
}

.sidebar-user-links {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.sidebar-user-links .link {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    transition: var(--crm-transition);
}

.sidebar-user-links .link:hover {
    background: rgba(37, 99, 235, 0.28);
    color: #fff;
    transform: translateX(4px);
}

.sidebar-user-links .icon {
    width: 18px;
    height: 18px;
}

/* Menü alanı */
.menu-list {
    margin-top: 8px;
}

.menu-list .item,
.menu-list .dropdown-item .item {
    margin-bottom: 8px;
}

.menu-list .link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 12px 14px;
    border-radius: 16px;
    text-decoration: none;
    transition: var(--crm-transition);
    position: relative;
}

.menu-list .item .link {
    color: rgba(255,255,255,0.82);
}

.menu-list .item .link:hover,
.menu-list .dropdown-item .link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateX(4px);
}

.menu-list .icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-list .item .icon,
.menu-list .dropdown-item .icon {
    color: rgba(255,255,255,0.88);
}

.menu-list .title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.menu-list .item.active > .link,
.menu-list .dropdown.open > .dropdown-item .item > .link {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(6, 182, 212, 0.90));
    color: #fff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.menu-list .item.active > .link .icon,
.menu-list .dropdown.open > .dropdown-item .item > .link .icon {
    color: #fff;
}

.menu-list .dropdown-container {
    margin-top: 8px;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
}

.menu-list .dropdown-menu-list .item .link {
    min-height: 46px;
    padding: 10px 12px 10px 14px;
    border-radius: 14px;
    color: rgba(255,255,255,0.76);
}

.menu-list .dropdown-menu-list .item.active .link {
    background: rgba(255,255,255,0.12);
    color: #fff;
    box-shadow: none;
}

.menu-list .action-icon {
    margin-left: auto;
    transition: transform 0.25s ease;
    opacity: 0.9;
}

.menu-list .dropdown.open .action-icon {
    transform: rotate(90deg);
}

/* Sidebar alt alan */
.sidebar-footer,
.sidebar_footer,
.sidebar-container .sidebar-footer {
    background: transparent;
    border-top: none;
}

/* Sayfa container */
.page-container {
    background: transparent;
    padding: 20px;
}

/* Top bar */
.page-top-bar {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: var(--crm-shadow);
    border-radius: 22px;
    padding: 14px 18px;
    margin-bottom: 18px;
}

.page-top-bar .left-side,
.page-top-bar .right-side {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-top-bar .icon-container {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--crm-border);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    transition: var(--crm-transition);
    cursor: pointer;
}

.page-top-bar .icon-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--crm-shadow-hover);
    border-color: rgba(37, 99, 235, 0.25);
}

.page-top-bar .icon {
    width: 20px;
    height: 20px;
    color: var(--crm-text);
}

.page-top-bar .import-page:hover .icon {
    color: var(--crm-primary);
}

/* Topbar içindeki avatar aynı partial kullandığı için kontrollü düzeltme */
.page-top-bar .sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    margin: 0;
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 16px;
    box-shadow: none;
}

.page-top-bar .sidebar-user:hover {
    transform: none;
    background: #fff;
}

.page-top-bar .sidebar-user-image img {
    width: 42px;
    height: 42px;
    border: 2px solid rgba(37, 99, 235, 0.15);
    box-shadow: none;
}

.page-top-bar .sidebar-user-name {
    color: var(--crm-text);
    margin-top: 0;
    font-size: 14px;
}

.page-top-bar .sidebar-user-email {
    color: var(--crm-text-soft);
    font-size: 12px;
}

.page-top-bar .sidebar-user-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
}

.page-top-bar .sidebar-user-links .link {
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--crm-surface-2);
    color: var(--crm-text);
}

.page-top-bar .sidebar-user-links .link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--crm-primary);
    transform: none;
}

/* Header */
.page-header {
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 24px;
    padding: 24px 26px;
    box-shadow: var(--crm-shadow);
    margin-bottom: 18px;
}

.page-info h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--crm-text);
    margin: 0;
}

.page-info .info {
    color: var(--crm-text-soft);
    margin-top: 8px;
}

/* Sayfa içerik alanı */
.page-section,
.page-content,
.js-ak-page-content {
    background: transparent;
}

/* Kartlar / kutular / tablolar için genel his */
.card,
.table-container,
.form-container,
.content-card,
.main-card,
.box,
.ak-card {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-xl);
    box-shadow: var(--crm-shadow);
}

/* Form elemanları */
input,
select,
textarea {
    border-radius: 14px !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    box-shadow: none !important;
    transition: var(--crm-transition) !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(37, 99, 235, 0.45) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10) !important;
}

/* Butonlar */
button,
.btn,
a.btn {
    border-radius: 14px !important;
    transition: var(--crm-transition) !important;
}

button:hover,
.btn:hover,
a.btn:hover {
    transform: translateY(-1px);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.45);
}

/* Responsive */
@media (max-width: 992px) {
    .page-container {
        padding: 14px;
    }

    .page-header {
        padding: 18px;
        border-radius: 20px;
    }

    .page-top-bar {
        padding: 12px 14px;
        border-radius: 18px;
    }

    .page-top-bar .sidebar-user {
        flex-wrap: wrap;
    }
}

/* =========================
   BRAND / LOGO SYSTEM
   ========================= */

.brand-logo-box {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96)) !important;
    border-radius: 22px;
    padding: 16px 14px !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.16);
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
}

.brand-logo-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at left center, rgba(59, 130, 246, 0.10), transparent 30%),
        radial-gradient(circle at right center, rgba(234, 179, 8, 0.10), transparent 28%);
    pointer-events: none;
}

.brand-logo-link {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

.brand-logo-image {
    display: block;
    width: 100%;
    max-width: 235px;
    max-height: 92px;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.10));
    transition: transform 0.28s ease, filter 0.28s ease;
}

.brand-logo-link:hover .brand-logo-image {
    transform: scale(1.025);
    filter: drop-shadow(0 14px 24px rgba(37, 99, 235, 0.14));
}

/* Sidebar dar görünüm veya küçük alanlar */
@media (max-width: 1200px) {
    .brand-logo-image {
        max-width: 210px;
        max-height: 84px;
    }

    .brand-logo-link {
        min-height: 84px;
    }
}

@media (max-width: 992px) {
    .brand-logo-box {
        border-radius: 18px;
        padding: 12px !important;
    }

    .brand-logo-image {
        max-width: 190px;
        max-height: 72px;
    }

    .brand-logo-link {
        min-height: 72px;
    }
}

/* LOGIN PAGE */
.public-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 28%),
        radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.10), transparent 24%),
        #f4f7fb;
}

.public-content {
    width: 100%;
    max-width: 520px;
    background: rgba(255,255,255,0.90);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.75);
    border-radius: 28px;
    padding: 34px 30px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.login-logo-box {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 26px;
}

.login-logo-image {
    width: 100%;
    max-width: 320px;
    max-height: 96px;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.12));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.login-logo-image:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 14px 26px rgba(37, 99, 235, 0.14));
}

.auth-container h2 {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 24px;
}

.auth-container .input-container {
    margin-bottom: 18px;
}

.auth-container .form-input {
    min-height: 52px;
    border-radius: 14px !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    background: #fff;
}

.auth-container .form-input:focus {
    border-color: rgba(37, 99, 235, 0.45) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10) !important;
}

.auth-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 22px;
    flex-wrap: wrap;
}

.auth-submit .button,
.auth-submit .primary-button {
    width: 100%;
    min-height: 52px;
    border-radius: 14px !important;
    font-weight: 700;
    letter-spacing: 0.2px;
}

@media (max-width: 576px) {
    .public-content {
        padding: 24px 18px;
        border-radius: 22px;
    }

    .login-logo-image {
        max-width: 260px;
        max-height: 80px;
    }

    .auth-container h2 {
        font-size: 24px;
    }
}