:root {
    --sd-sidebar: #0f172a;
    --sd-primary: #2563eb;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Sidebar */
.sidebar,
.sidebar-offcanvas {
    width: 260px;
    background: var(--sd-sidebar);
}
.sidebar .nav-link.active {
    background: rgba(37, 99, 235, 0.25);
    color: #fff !important;
}
.sidebar .nav-link.text-white-50:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff !important;
}
.sidebar-section-label {
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45);
    padding: .25rem .75rem .5rem;
}
.sidebar-hint {
    line-height: 1.45;
    border-left: 2px solid rgba(255, 255, 255, .15);
}

.client-context-bar {
    position: sticky;
    top: 0;
    z-index: 1020;
}
.client-context-select {
    flex: 1 1 220px;
    max-width: 420px;
}

.brand-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--sd-primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: .9rem;
}
.avatar-sm-sm { width: 32px; height: 32px; font-size: .8rem; }

/* Auth */
.auth-page {
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #dbeafe 100%);
}
.auth-side {
    background: linear-gradient(160deg, #0f172a 0%, #1e40af 100%);
}
.letter-spacing-code { letter-spacing: .35em; font-weight: 700; }

/* Page elements */
.page-icon,
.section-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    background: #eff6ff;
    color: var(--sd-primary);
}
.section-icon-mail { background: #eff6ff; color: #2563eb; }
.section-icon-sage { background: #eff6ff; color: #2563eb; }
.section-icon-glpi { background: #f3e8ff; color: #7c3aed; }
.section-icon-whmcs { background: #fef3c7; color: #d97706; }

/* Module tabs + panel (Bootstrap nav-tabs) */
.sd-module-card {
    overflow: hidden;
}
.sd-tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sd-tabs-scroll .nav-tabs {
    flex-wrap: nowrap;
    border-bottom-color: #dee2e6;
    gap: .25rem;
}
.sd-tabs-scroll .nav-link {
    white-space: nowrap;
    font-weight: 500;
    color: #64748b;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: .75rem 1rem;
}
.sd-tabs-scroll .nav-link:hover {
    color: var(--sd-primary);
    border-color: transparent;
    isolation: isolate;
}
.sd-tabs-scroll .nav-link.active {
    color: var(--sd-primary);
    font-weight: 600;
    background: transparent;
    border-bottom-color: var(--sd-primary);
}
.sd-module-panel {
    background: #fff;
}

/* Permissions page */
.sd-perm-module {
    background: #fafbfc;
    transition: border-color .15s, box-shadow .15s;
}
.sd-perm-module:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.sd-perm-module-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    background: #eff6ff;
    color: var(--sd-primary);
    flex-shrink: 0;
}
.sd-perm-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid #eef2f6;
}
.sd-perm-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sd-perm-item .form-check-input {
    float: none;
    margin: .2rem 0 0;
    flex-shrink: 0;
}
.sd-perm-item .form-check-label {
    cursor: pointer;
    flex: 1;
    min-width: 0;
}
.dossier-panel-head {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e8edf3;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}
.dossier-panel-body {
    background: #fff;
}
.dossier-panel-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e8edf3;
    background: #fafbfc;
}
.dossier-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
}

.module-link:hover {
    border-color: var(--sd-primary) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}
.activity-info { background: #0284c7; }
.activity-ticket { background: #8b5cf6; }
.activity-invoice { background: #059669; }
.activity-license { background: #f59e0b; }

.card { border-radius: 12px; }
.btn-primary {
    --bs-btn-bg: var(--sd-primary);
    --bs-btn-border-color: var(--sd-primary);
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
}

.table > :not(caption) > * > * { padding: .85rem 1rem; }
