:root {
    --bg: #0b1221;
    --surface: #111a2e;
    --surface-2: #15203a;
    --border: #1f2a44;
    --text: #e8ecf5;
    --muted: #9aa7c5;
    --primary: #4c82ff;
    --success: #42c38b;
    --warning: #f7c266;
    --danger: #ff7d7d;
    --shadow: 0 18px 60px rgba(5, 11, 26, 0.35);
}

[data-theme="light"] {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f0f2f7;
    --border: #dde2ec;
    --text: #0b1221;
    --muted: #66728f;
    --primary: #2d6cf0;
    --success: #198754;
    --warning: #c18c02;
    --danger: #d9534f;
    --shadow: 0 14px 40px rgba(15, 27, 49, 0.12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
}

    a:hover {
        color: #7aa5ff;
    }

.app-shell {
    display: grid;
    grid-template-columns: auto 1fr;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    border-right: 1px solid var(--border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 260px;
    transition: width 0.3s ease, padding 0.3s ease;
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .sidebar-toggle:hover {
        background: rgba(76, 130, 255, 0.1);
        color: var(--primary);
    }

    .sidebar-toggle i {
        transition: transform 0.3s ease;
        font-size: 12px;
    }

/* Collapsed Sidebar */
.sidebar.collapsed,
html.sidebar-collapsed #sidebar {
    width: 72px;
    padding: 24px 12px;
}

    .sidebar.collapsed .sidebar-toggle i,
    html.sidebar-collapsed #sidebar .sidebar-toggle i {
        transform: rotate(180deg);
    }

    .sidebar.collapsed .brand-text,
    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .toggle .label,
    .sidebar.collapsed .nav-group-title,
    html.sidebar-collapsed #sidebar .brand-text,
    html.sidebar-collapsed #sidebar .nav-text,
    html.sidebar-collapsed #sidebar .toggle .label,
    html.sidebar-collapsed #sidebar .nav-group-title {
        display: none;
    }

    .sidebar.collapsed .sidebar-header,
    html.sidebar-collapsed #sidebar .sidebar-header {
        flex-direction: column;
        gap: 16px;
    }

    .sidebar.collapsed .brand,
    html.sidebar-collapsed #sidebar .brand {
        justify-content: center;
    }

    .sidebar.collapsed .nav-link,
    html.sidebar-collapsed #sidebar .nav-link {
        justify-content: center;
        padding: 12px;
    }

        .sidebar.collapsed .nav-link.active::before,
        html.sidebar-collapsed #sidebar .nav-link.active::before {
            display: none;
        }

    .sidebar.collapsed .sidebar-footer,
    html.sidebar-collapsed #sidebar .sidebar-footer {
        align-items: center;
    }

    .sidebar.collapsed .toggle,
    html.sidebar-collapsed #sidebar .toggle {
        justify-content: center;
        padding: 8px;
    }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #7b5dff);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
}

.auth-brand .brand-mark {
    width: 52px;
    height: 52px;
    font-size: 16px;
}

.brand-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.brand-text .small {
    font-size: 11px;
    opacity: 0.7;
}

.auth-brand .brand-title {
    font-size: 18px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

/* Nav Groups */
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 12px 12px 6px;
    opacity: 0.7;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text);
    background: transparent;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    position: relative;
}

    .sidebar .nav-link .nav-icon {
        width: 18px;
        height: 18px;
        font-size: 15px;
        opacity: 0.75;
        transition: all 0.2s ease;
    }

    .sidebar .nav-link:hover {
        background: rgba(76, 130, 255, 0.08);
        color: var(--primary);
    }

        .sidebar .nav-link:hover .nav-icon {
            opacity: 1;
            color: var(--primary);
        }

    .sidebar .nav-link.active {
        background: linear-gradient(135deg, rgba(76, 130, 255, 0.15), rgba(45, 108, 240, 0.1));
        color: var(--primary);
        font-weight: 600;
    }

        .sidebar .nav-link.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 60%;
            background: var(--primary);
            border-radius: 0 3px 3px 0;
        }

        .sidebar .nav-link.active .nav-icon {
            opacity: 1;
            color: var(--primary);
        }

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

    .toggle:hover {
        background: rgba(76, 130, 255, 0.05);
    }

    .toggle input {
        display: none;
    }

    .toggle .slider {
        position: relative;
        width: 42px;
        height: 22px;
        background: var(--border);
        border-radius: 30px;
        transition: background 0.2s ease;
    }

        .toggle .slider::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #fff;
            transition: transform 0.2s ease;
            box-shadow: 0 2px 4px rgba(0,0,0,0.15);
        }

    .toggle input:checked + .slider {
        background: var(--primary);
    }

        .toggle input:checked + .slider::after {
            transform: translateX(20px);
        }

    .toggle .label {
        color: var(--muted);
        font-size: 13px;
        font-weight: 500;
    }

.workspace {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.topbar-title {
    font-weight: 700;
    font-size: 18px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 10px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .user-chip:hover {
        background: var(--surface);
        border-color: var(--primary);
    }

.user-info {
    text-align: left;
    color: var(--text);
}

.dropdown-arrow {
    font-size: 12px;
    color: var(--muted);
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.user-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

    .dropdown-item:hover {
        background: var(--surface-2);
        color: var(--text);
    }

    .dropdown-item i {
        width: 16px;
        color: var(--muted);
    }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.dropdown-form {
    margin: 0;
}

.logout-btn {
    color: var(--danger);
}

    .logout-btn:hover {
        background: rgba(255, 125, 125, 0.1);
    }

    .logout-btn i {
        color: var(--danger);
    }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #4c82ff, #7b5dff);
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name {
    font-weight: 700;
    color: var(--text);
}

.user-username {
    font-size: 13px;
    color: var(--muted);
}

.content {
    padding: 25px;
    flex: 1;
    background: radial-gradient(circle at 20% 20%, rgba(76,130,255,0.08), transparent 35%), radial-gradient(circle at 80% 10%, rgba(123,93,255,0.08), transparent 30%), var(--bg);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 4px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn.primary {
        background: linear-gradient(135deg, #4c82ff, #2d6cf0);
        color: #fff;
        box-shadow: var(--shadow);
    }

        .btn.primary:hover {
            filter: brightness(1.05);
        }

    .btn.ghost {
        border-color: var(--border);
        color: var(--text);
        background: var(--surface-2);
    }

.settings-grid {
    display: grid;
    gap: 22px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 10px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.panel-body {
    margin-top: 10px;
}

.form-grid {
    display: grid;
    gap: 16px 20px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .form-group.full {
        grid-column: 1 / -1;
    }

    .form-group label {
        color: var(--muted);
        font-weight: 600;
        font-size: 14px;
    }

.form-control {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 12px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

    .form-control:focus {
        border-color: var(--primary);
        outline: none;
        box-shadow: 0 0 0 3px rgba(76, 130, 255, 0.25);
    }

/* Input with icon (password toggle etc.) */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

    .input-with-icon .form-control {
        padding-right: 44px;
        width: 100%;
    }

.input-icon-btn {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .input-icon-btn:hover {
        background: var(--surface);
        color: var(--primary);
    }

.form-tip {
    border: 1px dashed var(--border);
    padding: 12px;
    border-radius: 12px;
    color: var(--muted);
    background: var(--surface-2);
    display: flex;
    gap: 10px;
    align-items: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.01em;
}

    .pill.success {
        background: rgba(66, 195, 139, 0.12);
        color: #42c38b;
    }

    .pill.warning {
        background: rgba(247, 194, 102, 0.15);
        color: #f7c266;
    }

    .pill.danger {
        background: rgba(255, 125, 125, 0.16);
        color: #ff9b9b;
    }

    .pill.neutral {
        background: rgba(154, 167, 197, 0.16);
        color: var(--muted);
    }

    .pill.info {
        background: rgba(76, 130, 255, 0.15);
        color: #9db9ff;
    }

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
    background: var(--surface);
}

    .alert.success {
        border-color: rgba(66, 195, 139, 0.3);
        background: rgba(66, 195, 139, 0.08);
        color: #42c38b;
    }

[data-theme="light"] .alert.success {
    border-color: rgba(25, 135, 84, 0.3);
    background: rgba(25, 135, 84, 0.1);
    color: #146c43;
}

code {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 2px 6px;
    color: var(--text);
}

.log-table .table {
    color: var(--text);
    border-color: var(--border);
}

.table thead {
    color: var(--muted);
}

.table > :not(caption) > * > * {
    border-color: var(--border);
    background: var(--surface);
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

    .footer a {
        color: var(--muted);
    }

.footer-links {
    display: flex;
    gap: 14px;
}

/* Auth Page Styles */
body.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.auth-wrapper {
    display: grid;
    place-items: center;
    min-height: auto;
}

.auth-card.panel {
    max-width: 560px; /* slightly narrower for compact layout */
    width: min(600px, 100%);
    padding: 36px 40px !important;
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
}

    .auth-form .form-group {
        gap: 10px;
    }

        .auth-form .form-group label {
            font-size: 15px;
        }

    .auth-form .form-control {
        padding: 16px 18px !important;
        font-size: 16px;
        border-radius: 12px;
    }

    .auth-form .btn {
        padding: 16px 24px;
        font-size: 16px;
        margin-top: 12px;
        border-radius: 14px;
    }

.auth-brand {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

    .auth-brand .brand-mark {
        width: 56px;
        height: 56px;
        font-size: 18px;
        border-radius: 14px;
    }

    .auth-brand .brand-title {
        font-size: 20px;
    }

    .auth-brand .small {
        font-size: 14px;
    }

.info-block {
    padding: 10px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    background: var(--surface-2);
}

.w-100 {
    width: 100%;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 72px;
        padding: 20px 12px;
    }

        .sidebar .brand-text,
        .sidebar .nav-text,
        .sidebar .toggle .label,
        .sidebar .nav-group-title {
            display: none;
        }

        .sidebar .sidebar-header {
            flex-direction: column;
            gap: 16px;
        }

        .sidebar .brand {
            justify-content: center;
        }

        .sidebar .nav-link {
            justify-content: center;
            padding: 12px;
        }

            .sidebar .nav-link.active::before {
                display: none;
            }

        .sidebar .sidebar-footer {
            align-items: center;
        }

        .sidebar .toggle {
            justify-content: center;
        }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .content {
        padding: 18px;
    }
}

/* Tabs */
.tabs-container {
    padding: 0;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

    .tab-btn:hover {
        color: var(--text);
        background: var(--surface);
    }

    .tab-btn.active {
        color: var(--primary);
        background: var(--surface);
        border-bottom-color: var(--primary);
    }

.tab-content {
    display: none;
    padding: 20px;
}

    .tab-content.active {
        display: block;
    }

/* Settings Sections */
.settings-section {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

    .settings-section:last-child {
        margin-bottom: 0;
    }

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.section-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(76, 130, 255, 0.15), rgba(123, 93, 255, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.section-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.section-info p {
    margin: 0;
}

/* Checkbox */
.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--muted);
    font-size: 14px;
}

    .checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: var(--primary);
        cursor: pointer;
    }

/* Irsaliye Page */
.irsaliye-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    height: calc(100vh - 180px);
    min-height: 0;
}

.irsaliye-grid-panel {
    overflow: hidden;
}

    .irsaliye-grid-panel .panel {
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .irsaliye-grid-panel #irsaliyeGrid {
        flex: 1;
        min-height: 0;
    }

    .irsaliye-grid-panel .panel-header {
        flex-shrink: 0;
    }

.irsaliye-detail-panel .panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.irsaliye-detail-panel .panel-header {
    flex-shrink: 0;
}

.irsaliye-detail-panel .panel-body {
    flex: 1;
    overflow-y: auto;
}

/* Status badges for irsaliye */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-success {
    background: rgba(66, 195, 139, 0.15);
    color: #42c38b;
}

.status-danger {
    background: rgba(255, 125, 125, 0.15);
    color: #ff7d7d;
}

.status-warning {
    background: rgba(247, 194, 102, 0.15);
    color: #f7c266;
}

.status-info {
    background: rgba(76, 130, 255, 0.15);
    color: #4c82ff;
}

.status-default {
    background: rgba(154, 167, 197, 0.12);
    color: var(--muted);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sofor cards */
.sofor-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sofor-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.sofor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.sofor-index {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.sofor-name {
    font-weight: 700;
    color: var(--text);
}

.sofor-details {
    padding: 12px 14px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}

    .detail-row:last-child {
        border-bottom: none;
    }

.detail-label {
    font-size: 13px;
    color: var(--muted);
}

.detail-value {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

/* DevExtreme overrides for dark theme */
.dx-datagrid {
    background: var(--surface) !important;
    color: var(--text) !important;
}

.dx-datagrid-headers {
    background: var(--surface-2) !important;
    color: var(--muted) !important;
}

.dx-datagrid-rowsview .dx-row {
    background: var(--surface) !important;
}

.dx-datagrid-rowsview .dx-row-alt {
    background: var(--surface-2) !important;
}

.dx-datagrid-rowsview .dx-row:hover {
    background: rgba(76, 130, 255, 0.1) !important;
}

.dx-datagrid-rowsview .dx-selection.dx-row {
    background: rgba(76, 130, 255, 0.2) !important;
}

.dx-datagrid-borders > .dx-datagrid-headers,
.dx-datagrid-borders > .dx-datagrid-rowsview {
    border-color: var(--border) !important;
}

.dx-datagrid-headers .dx-datagrid-table .dx-row > td {
    border-color: var(--border) !important;
}

.dx-datagrid-rowsview .dx-row > td {
    border-color: var(--border) !important;
}

.dx-datagrid .dx-editor-cell .dx-texteditor,
.dx-datagrid .dx-editor-cell .dx-texteditor-input {
    line-height: 1.2;
}

.dx-texteditor-input {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

.dx-datagrid-pager {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: var(--surface);
}

.dx-texteditor-buttons-container {
    display: inline-flex;
    align-items: center;
}

.dx-texteditor-button {
    height: 28px;
}

.dx-toolbar {
    background: var(--surface) !important;
}

.dx-texteditor-input {
    color: var(--text) !important;
}

@media (max-width: 1200px) {
    .irsaliye-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 300px;
    }
}

/* Bootstrap Modal Dark Theme Override */
.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.modal-header {
    border-bottom-color: var(--border);
}

.modal-footer {
    border-top-color: var(--border);
}

/* Detay Table */
.detay-table-wrapper {
    overflow-x: auto;
}

.detay-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .detay-table th,
    .detay-table td {
        padding: 12px 14px;
        text-align: left;
        border-bottom: 1px solid var(--border);
    }

    .detay-table th {
        background: var(--surface-2);
        color: var(--muted);
        font-weight: 600;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .detay-table tbody tr:hover {
        background: rgba(76, 130, 255, 0.05);
    }

    .detay-table tfoot td {
        background: var(--surface-2);
        font-weight: 700;
        border-top: 2px solid var(--border);
    }

    .detay-table .text-right {
        text-align: right;
    }

    .detay-table code {
        font-size: 12px;
    }

/* Yukato Result Dialog */
.yukato-result {
    min-width: 400px;
}

.result-summary {
    display: flex;
    gap: 20px;
    padding: 16px;
    background: var(--surface-2);
    border-radius: 12px;
    margin-bottom: 16px;
}

    .result-summary .success-count,
    .result-summary .fail-count {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 700;
        font-size: 16px;
    }

    .result-summary .success-count {
        color: var(--success);
    }

    .result-summary .fail-count {
        color: var(--danger);
    }

.result-details {
    max-height: 300px;
    overflow-y: auto;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .result-table th,
    .result-table td {
        padding: 10px 12px;
        text-align: left;
        border-bottom: 1px solid var(--border);
    }

    .result-table th {
        background: var(--surface-2);
        color: var(--muted);
        font-weight: 600;
        font-size: 12px;
        text-transform: uppercase;
        position: sticky;
        top: 0;
    }

    .result-table tbody tr:hover {
        background: rgba(76, 130, 255, 0.05);
    }

/* DevExtreme Success Button */
.dx-button.dx-button-success {
    background: linear-gradient(135deg, #42c38b, #2d9d6b) !important;
    border-color: transparent !important;
}

    .dx-button.dx-button-success:hover {
        filter: brightness(1.1);
    }

/* Global Spinner Overlay */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 18, 33, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

    .spinner-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 60px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-message {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* Gonderim detay stili */
.gonderim-detay {
    min-width: 350px;
}

    .gonderim-detay .info-block {
        padding: 16px;
    }

    .gonderim-detay .detail-row {
        padding: 10px 0;
    }

/* Cari Selection Box */
.cari-selection-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
}

    .cari-selection-box .cari-info {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 15px;
    }

        .cari-selection-box .cari-info i {
            font-size: 18px;
            color: var(--primary);
        }

        .cari-selection-box .cari-info .text-warning {
            color: var(--warning);
        }

/* Logs Grid Mesaj Cell */
.mesaj-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

/* Panel overflow fix */
.panel {
    max-width: 100%;
    overflow-x: auto;
}

/* Bulk Send Modal (SignalR progress) */
#bulkSendModal .progress {
    background: var(--surface-2);
}

#bulkSendModal .progress-bar {
    background: linear-gradient(135deg, var(--primary), #7b5dff);
    font-weight: 700;
    font-size: 12px;
}

/* Dashboard */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.metric-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow);
}

.metric-icon-users {
    background: linear-gradient(135deg, #4c82ff, #2d6cf0);
}

.metric-icon-sent {
    background: linear-gradient(135deg, #28a745, #1e8f38);
}

.metric-icon-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.metric-icon-today {
    background: linear-gradient(135deg, #7b5dff, #5b47d6);
}

.metric-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-label {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
}

.metric-sub {
    color: var(--muted);
    font-size: 12px;
}

.metric-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
    line-height: 1.1;
}

/* Tıklanabilir Metric Kartları */
.metric-card-clickable {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.metric-card-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 130, 255, 0.15);
    border-color: var(--primary);
}

.metric-card-clickable:active {
    transform: translateY(-1px);
}

.metric-action {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--muted);
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    font-size: 12px;
}

.metric-card-clickable:hover .metric-action {
    opacity: 1;
    color: var(--primary);
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    min-height: 340px;
    display: flex;
    flex-direction: column;
}

.chart-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text);
}

.chart-body {
    flex: 1;
    min-height: 260px;
}

.dashboard-filters {
    gap: 12px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

/* ============================================
   SPLIT LOGIN PAGE STYLES
   ============================================ */

.login-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.login-visual {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.visual-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px;
}

.visual-brand {
    margin-bottom: 48px;
}

    .visual-brand .brand-icon {
        width: 80px;
        height: 80px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 24px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

        .visual-brand .brand-icon i {
            font-size: 36px;
            color: white;
        }

    .visual-brand .login-brand-logo {
        width: 100px;
        height: 100px;
        object-fit: contain;
        margin: 0 auto 24px;
        display: block;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.1);
        padding: 12px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .visual-brand h1 {
        font-size: 32px;
        font-weight: 800;
        margin: 0 0 8px 0;
        text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    }

    .visual-brand p {
        font-size: 18px;
        opacity: 0.9;
        margin: 0;
        font-weight: 500;
    }

.visual-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 14px 24px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, background 0.3s ease;
    width: 260px;
}

    .feature-item:hover {
        transform: translateX(8px);
        background: rgba(255, 255, 255, 0.25);
    }

    .feature-item i {
        font-size: 18px;
        color: #90EE90;
        width: 20px;
        flex-shrink: 0;
    }

    .feature-item span {
        font-size: 15px;
        font-weight: 500;
    }

.visual-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.deco-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.deco-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation: float 8s ease-in-out infinite;
}

.deco-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    right: -50px;
    animation: float 10s ease-in-out infinite reverse;
}

.deco-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 60%;
    animation: float 6s ease-in-out infinite 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.login-form-side {
    flex: 0 0 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 40px;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-header {
    margin-bottom: 36px;
}

    .login-header h2 {
        font-size: 32px;
        font-weight: 800;
        color: var(--text);
        margin: 0 0 8px 0;
    }

    .login-header p {
        font-size: 16px;
        margin: 0;
    }

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

    .login-form .form-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

        .login-form .form-group label {
            font-size: 14px;
            font-weight: 600;
            color: var(--muted);
            display: flex;
            align-items: center;
            gap: 8px;
        }

            .login-form .form-group label i {
                font-size: 14px;
                opacity: 0.7;
            }

    .login-form .form-control {
        padding: 16px 18px !important;
        font-size: 16px;
        border-radius: 12px;
        border: 2px solid var(--border);
        background: var(--surface);
        transition: all 0.2s ease;
    }

        .login-form .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
        }

        .login-form .form-control::placeholder {
            color: var(--muted);
            opacity: 0.6;
        }

.login-btn {
    padding: 18px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 14px !important;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

    .login-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4) !important;
    }

    .login-btn:active {
        transform: translateY(0);
    }

.login-footer {
    margin-top: 40px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .login-split {
        flex-direction: column;
    }

    .login-visual {
        flex: 0 0 auto;
        min-height: 280px;
        padding: 40px 20px;
    }

    .visual-brand h1 {
        font-size: 24px;
    }

    .visual-brand p {
        font-size: 14px;
    }

    .visual-brand {
        margin-bottom: 24px;
    }

    .visual-features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .feature-item {
        padding: 10px 16px;
        font-size: 13px;
    }

    .login-form-side {
        flex: 1;
        padding: 32px 24px;
    }

    .login-header h2 {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .visual-features {
        display: none;
    }

    .login-visual {
        min-height: 200px;
    }

    .login-form-side {
        padding: 24px 16px;
    }
}
