/* Custom styles for Fatto CRM */

/* Avatar circles */
.avatar-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

/* Card shadows */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Form improvements */
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Button improvements */
.btn {
    border-radius: 0.375rem;
}

.btn-group .btn {
    border-radius: 0.375rem !important;
}

/* Small spacing between adjacent buttons inside a button group */
.btn-group .btn + .btn {
    margin-left: 0.25rem;
}

/* Apply spacing specifically for small/action buttons in tables and small btn groups.
   Use higher specificity to override Bootstrap's negative-margin button-group styles. */
.table .btn-group .btn + .btn,
.btn-group .btn-sm + .btn-sm {
    margin-left: 0.25rem !important;
}

/* Table improvements */
.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* Badge improvements */
.badge {
    font-size: 0.75em;
}

/* Navigation improvements */
.navbar-brand {
    font-weight: 700;
}

/* Logo sizing: make logo 25% smaller and ensure aspect ratio */
.navbar-brand .brand-logo {
    height: 23px;
    width: auto;
    display: block;
}

/* Sidebar improvements */
.sidebar .card {
    margin-bottom: 1rem;
}

/* Dashboard metrics */
.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Authentication pages: lighter gradient background and centered card */

.auth-bg {
    /* Light blue gradient (slightly bluer but still soft) */
    background: linear-gradient(0deg, #bccbdc 0%, #3982c2 60%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Translucent, rounded login card with smooth backdrop blur */
.auth-bg .card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    /* slightly more translucent so background color shows through */
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px) saturate(120%);
}

.auth-logo {
    /* Use intrinsic SVG sizing, but limit max height to the original size */
    height: auto;
    max-height: 56px;
    width: auto;
    display: block;
    padding: 0;
    margin: 1.5rem auto 3.0rem auto; /* bottom spacing between logo and heading */
    /* ensure the SVG scales and remains visible on the light background */
    filter: drop-shadow(0 6px 18px rgba(33,37,41,0.06));
    background: transparent;
}

.auth-bg .card-body {
    background: transparent;
}

/* Slightly reduce contrast for muted text on the translucent card */
.auth-bg .text-muted {
    color: rgba(33,37,41,0.6) !important;
}

/* Ensure form labels and important inline labels remain readable (avoid white-on-white glitches) */
.form-label,
.card-body p strong,
.card-body dt,
.card-body dd {
    color: #212529 !important;
}