:root {
    --portal-primary: #0d6efd;
    --portal-brand-accent: #2e7bff;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.portal-brand-logo {
    display: block;
    width: 2.125rem;
    height: 2.125rem;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
    background: #0a0c10;
}

.navbar-brand .portal-brand-logo {
    width: 2.125rem;
    height: 2.125rem;
}

.portal-brand-product {
    letter-spacing: 0.06em;
    font-size: 1.05rem;
    line-height: 1;
}

.navbar-dark .portal-brand-product,
.navbar-brand .portal-brand-product {
    color: #fff;
}

.auth-brand .portal-brand-product {
    color: #111827;
    font-size: 1.25rem;
}

.auth-brand .portal-brand-logo {
    width: 2.5rem;
    height: 2.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.filter-card .accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.08);
    color: var(--portal-primary);
}

.crm-quick-search {
    max-width: 40rem;
}

.crm-quick-search__field {
    display: flex;
    align-items: center;
}

.crm-quick-search__icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    z-index: 2;
}

.crm-quick-search__input {
    padding-left: 2.35rem;
    padding-right: 2.5rem;
    border-radius: 0.65rem;
    border-color: #dbe3ef;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.crm-quick-search__input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.crm-quick-search__spinner {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.crm-quick-search__results {
    margin-top: 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.crm-quick-search__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.12s ease;
}

.crm-quick-search__item:last-child {
    border-bottom: 0;
}

.crm-quick-search__item:hover,
.crm-quick-search__item:focus-visible {
    background: #f8fafc;
    color: inherit;
}

.crm-quick-search__item-main {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.crm-quick-search__title {
    font-weight: 600;
    color: #0f172a;
}

.crm-quick-search__subtitle {
    font-size: 0.8125rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-quick-search__match {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #334155;
    background: #eef2f7;
    border-radius: 0.4rem;
    padding: 0.2rem 0.45rem;
    align-self: center;
}

.table-hover tbody tr {
    transition: background-color 0.15s ease;
}

.company-logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.company-logo-lg {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 0.75rem;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 0.15rem;
}

.detail-value {
    font-weight: 500;
    word-break: break-word;
}

.stat-badge {
    font-size: 0.85rem;
}

.dashboard-stat-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
}

.project-header-card {
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.project-header-card:hover,
.project-header-card:focus {
    box-shadow: 0 0.5rem 1.25rem rgba(13, 110, 253, 0.12) !important;
    outline: none;
}

.project-header-card:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.checklist-toggle-btn {
    line-height: 1;
    text-decoration: none !important;
}

.checklist-toggle-btn:hover i.bi-circle {
    color: var(--bs-success) !important;
}

.checklist-open-btn {
    color: inherit;
    word-break: break-word;
}

/* Navbar grouping */
.portal-navbar .nav-link {
    font-weight: 500;
    border-radius: 0.45rem;
    padding: 0.45rem 0.75rem;
}

.portal-navbar .navbar-nav .nav-link:hover,
.portal-navbar .navbar-nav .nav-link:focus {
    background: rgba(255, 255, 255, 0.12);
}

.portal-navbar .navbar-nav .nav-link.active,
.portal-navbar .nav-item.dropdown:has(.dropdown-item.active) > .nav-link {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.portal-nav-dropdown {
    border: 0;
    border-radius: 0.75rem;
    box-shadow: 0 0.75rem 1.75rem rgba(15, 23, 42, 0.16);
    padding: 0.4rem;
    min-width: 12.5rem;
}

.portal-nav-dropdown .dropdown-item {
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-weight: 500;
}

.portal-nav-dropdown .dropdown-item.active,
.portal-nav-dropdown .dropdown-item:active {
    background: rgba(13, 110, 253, 0.12);
    color: var(--portal-primary);
}

/* Alan içi alt menü (CRM / E-posta / Muhasebe / Ajanda) */
.portal-area-subnav {
    position: sticky;
    top: 56px;
    z-index: 1020;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.portal-area-subnav .nav-pills .nav-link {
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    padding: 0.4rem 0.85rem;
    border-radius: 2rem;
}

.portal-area-subnav .nav-pills .nav-link:hover {
    background: rgba(13, 110, 253, 0.08);
    color: var(--portal-primary);
}

.portal-area-subnav .nav-pills .nav-link.active {
    background: rgba(13, 110, 253, 0.12);
    color: var(--portal-primary);
}

.portal-nav-user {
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

@media (min-width: 992px) {
    .portal-nav-main {
        gap: 0.15rem;
    }

    .portal-nav-user {
        border-top: 0;
        margin-top: 0;
        padding-top: 0;
        border-left: 1px solid rgba(255, 255, 255, 0.22);
        padding-left: 0.75rem;
    }
}

/* Organization settings */
.org-settings-tabs .nav-link {
    border-radius: 999px;
    font-weight: 600;
    color: #495057;
    background: #fff;
    border: 1px solid #dee2e6;
}

.org-settings-tabs .nav-link.active {
    color: #fff;
    background: var(--portal-primary);
    border-color: var(--portal-primary);
}

.org-settings-logo-preview {
    max-height: 72px;
    max-width: 180px;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
    padding: 0.35rem;
    background: #fff;
}

.org-branch-card {
    background: #fff;
}

.org-branch-card.border-dashed {
    border-style: dashed !important;
    background: #fafbfc;
}

.org-settings-actions {
    background: linear-gradient(180deg, rgba(248, 249, 250, 0), #f8f9fa 35%);
}

/* Site-wide help tips (?) */
.help-tip-btn,
.field-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    margin-left: 0.2rem;
    vertical-align: middle;
    border: 1px solid #adb5bd;
    border-radius: 50%;
    background: #fff;
    color: #6c757d;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
}

.help-tip-btn:hover,
.help-tip-btn:focus,
.field-help-btn:hover,
.field-help-btn:focus {
    color: var(--portal-primary);
    border-color: var(--portal-primary);
    background: rgba(13, 110, 253, 0.06);
    outline: none;
}

.help-tip-btn:focus-visible,
.field-help-btn:focus-visible {
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}

.page-header .help-tip-btn,
.page-header .field-help-btn,
h1 .help-tip-btn,
h2 .help-tip-btn,
.h2 .help-tip-btn {
    width: 1.2rem;
    height: 1.2rem;
    font-size: 0.7rem;
    margin-left: 0.35rem;
    vertical-align: 0.15em;
}

th .help-tip-btn,
th .field-help-btn {
    width: 0.95rem;
    height: 0.95rem;
    font-size: 0.58rem;
    margin-left: 0.15rem;
}

.tooltip.help-tip-tooltip .tooltip-inner,
.tooltip.field-help-tooltip .tooltip-inner {
    max-width: 16rem;
    text-align: start;
    font-size: 0.8rem;
    background: #212529;
}

.portal-preloader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(1px);
}

.portal-preloader.d-none {
    display: none !important;
}

.portal-preloader__card {
    background: #fff;
    border-radius: 0.85rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    text-align: center;
    min-width: 10rem;
}

.portal-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2100;
    max-width: min(22rem, calc(100vw - 2rem));
}

.portal-toast {
    margin-bottom: 0.5rem;
}

.campaign-send-progress {
    max-width: 28rem;
}

.campaign-send-progress .progress {
    height: 1.35rem;
    border-radius: 999px;
    overflow: hidden;
    background: #e8eef6;
}

.campaign-send-progress .progress-bar {
    transition: width 0.35s ease;
}
