:root {
    --dashboard-header-offset: 48px;
    --supportpilot-theme: #203424;
    --supportpilot-theme-rgb: 32, 52, 36;
    --supportpilot-theme-contrast: #f7f3e7;
}

body,
body * {
    font-family: "IBM Plex Sans", sans-serif !important;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "IBM Plex Sans", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(199, 225, 201, 0.9), transparent 35%),
        linear-gradient(135deg, #f5f2e8 0%, #dfe7d1 48%, #b8c8a8 100%);
    color: #1f2a1e;
}

[x-cloak] {
    display: none !important;
}

.shell {
    min-height: 100vh;
    padding: 2rem 1rem;
}

.dashboard-shell {
    min-height: 100vh;
}

.shell > * {
    width: 100%;
}

.card#loginForm,
#loginForm.card {
    width: min(100%, 34rem);
    min-height: 300px;
    border: 0;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1.5rem 4rem rgba(31, 42, 30, 0.16);
}

.card-header {
    background: var(--supportpilot-theme);
    color: var(--supportpilot-theme-contrast);
    font-weight: 700;
    letter-spacing: 0.03em;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.app-brand__image {
    display: block;
    max-width: 100%;
    height: auto;
}

.app-brand__name {
    display: inline-block;
    min-width: 0;
}

.auth-brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.app-brand--auth .app-brand__image {
    max-height: 3rem;
}

.auth-brand-block__eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #6c757d;
}

.card-footer {
    border-top: 1px solid rgba(32, 52, 36, 0.08);
}

.btn-success {
    background: #2f5d3a;
    border-color: #2f5d3a;
}

.btn-success:hover,
.btn-success:focus {
    background: #264c2f;
    border-color: #264c2f;
}

.material-icons {
    font-size: 1.1rem;
    vertical-align: middle;
}

.admin-dashboard {
    min-height: 100vh;
    background: #f6f7fb;
}

.dashboard-header {
    z-index: 1030;
}

.dashboard-navbar {
    background: var(--supportpilot-theme);
}

.dashboard-navbar .navbar-brand {
    display: flex;
    align-items: center;
    min-height: 100%;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    background-color: rgba(var(--supportpilot-theme-rgb), 0.78);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.app-brand--navbar .app-brand__image {
    width: 1.95rem;
    height: 1.95rem;
    object-fit: contain;
}

.app-brand--navbar .app-brand__name {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--supportpilot-theme-contrast);
}

.dashboard-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.dashboard-navbar .form-control {
    padding: 0.5rem 1rem;
}

.form-control-dark {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.form-control-dark:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.16);
    border-color: transparent;
    box-shadow: none;
}

.dashboard-main {
    min-width: 0;
    padding-bottom: 2rem;
}

.dashboard-panel {
    border-radius: 0;
}

.sidebar .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-emphasis-color);
    border-radius: 0;
    padding: 0.65rem 1rem;
}

.sidebar .nav-link .bi {
    color: #6c757d;
}

.sidebar .nav-link.active {
    color: var(--bs-primary);
    background: rgba(13, 110, 253, 0.08);
}

.sidebar .nav-link.active .bi,
.sidebar .nav-link:hover .bi,
.sidebar .nav-link:focus .bi {
    color: inherit;
}

.sidebar-heading {
    font-size: 0.75rem;
}

.sidebar-brand-panel {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(32, 52, 36, 0.08);
}

.sidebar-intro__title {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4f6354;
}

.sidebar-intro__text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #314235;
}

.app-brand--sidebar-mobile .app-brand__image {
    width: 1.9rem;
    height: 1.9rem;
    object-fit: contain;
}

.app-brand--sidebar-mobile .app-brand__name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #203424;
}

.sidebar-user {
    background: rgba(255, 255, 255, 0.72);
}

.sidebar-user__label {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.45rem;
}

.sidebar-user__name {
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-user__meta {
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.stat-card {
    border-left: 0.25rem solid transparent;
    border-radius: 0;
}

.stat-card__icon {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.1rem;
}

.stat-card--primary {
    border-left-color: var(--bs-primary);
}

.stat-card--success {
    border-left-color: var(--bs-success);
}

.stat-card--warning {
    border-left-color: var(--bs-warning);
}

.stat-card--danger {
    border-left-color: var(--bs-danger);
}

.stat-card--info {
    border-left-color: var(--bs-info);
}

.dashboard-chart-header {
    background: #fff !important;
    color: #1f2a1e !important;
    font-weight: 600;
    letter-spacing: 0;
}

.dashboard-filter-form .form-control,
.dashboard-filter-form .form-select {
    min-height: 2.75rem;
}

.topbar-livewire-search .form-control,
.topbar-livewire-search .form-select {
    min-height: 2.5rem;
    border-color: rgba(255, 255, 255, 0.12);
}

.dashboard-navbar .livewire-search-dropdown .input-group-text {
    min-height: 2.5rem;
    color: #203424;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.16);
    min-width: 2.75rem;
    justify-content: center;
    font-size: 1rem;
}

.dashboard-navbar .livewire-search-dropdown .input-group-text .bi {
    line-height: 1;
}

.dashboard-navbar .livewire-search-dropdown .btn-outline-secondary {
    --bs-btn-color: rgba(255, 255, 255, 0.82);
    --bs-btn-border-color: rgba(255, 255, 255, 0.22);
    --bs-btn-hover-color: #111;
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: #fff;
}

.livewire-search-dropdown {
    min-width: 0;
}

.topbar-livewire-search {
    min-width: 0;
}

.livewire-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 1085;
    overflow: hidden;
}

.livewire-search-results .list-group-item {
    padding: 0.85rem 1rem;
}

.livewire-search-results .badge {
    text-transform: capitalize;
    flex-shrink: 0;
}

.dashboard-panel .dropdown-menu form {
    margin: 0;
}

.dashboard-panel .dropdown-menu .dropdown-item {
    gap: 0.5rem;
}

.table > :not(caption) > * > * {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.table thead th {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .sidebar {
        min-height: calc(100vh - var(--dashboard-header-offset));
    }

    .sidebar .offcanvas-md {
        position: sticky;
        top: var(--dashboard-header-offset);
        height: calc(100vh - var(--dashboard-header-offset));
        border-right: 1px solid rgba(0, 0, 0, 0.08);
    }

    .dashboard-sidebar-body {
        min-height: 100%;
    }
}

/* ---- Brand name: hide on very small screens to free space for the search bar ---- */
@media (max-width: 575.98px) {
    .app-brand--navbar .app-brand__name {
        display: none;
    }
}

/* ---- Mobile layout (< 768px) ---- */
@media (max-width: 767.98px) {
    /* Sidebar offcanvas: cap width so it never covers the full viewport */
    #sidebarMenu {
        max-width: min(320px, 88vw);
    }

    /* Search area: single-line compact strip within the flex navbar */
    .topbar-livewire-search {
        padding: 0.4rem 0.5rem;
    }

    .topbar-livewire-search .livewire-search-results {
        left: 0;
        right: 0;
    }

    /* Main content: restore horizontal padding that px-md-4 withholds on mobile */
    .dashboard-main {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Touch-friendly nav links */
    .sidebar .nav-link {
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
    }

    /* Stack page-header actions below the title on mobile */
    .btn-toolbar {
        width: 100%;
    }
}
