:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --bg: #f4f5f7;
    --card-bg: #ffffff;
    --border-soft: #e2e3e7;
    --text-main: #212529;
    --text-muted: #6c757d;
    --danger: #dc3545;
    --success: #198754;
    --app-navbar-height: 64px;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(
        circle at top left,
        #f1f5ff 0,
        #f4f5f7 35%,
        #eef2f7 100%
        );
    color: var(--text-main);
    font-family:
        Inter,
        "Segoe UI",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
}

/*
 * Hovedmenu
 */

.app-navbar {
    min-height: var(--app-navbar-height);
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.15);
}

.app-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.app-navbar .nav-link {
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.55rem 0.75rem;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.app-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.app-navbar .dropdown-menu {
    min-width: 14rem;
    padding: 0.45rem;
    border: 0;
    border-radius: 0.75rem;
    box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.16);
}

.app-navbar .dropdown-item {
    display: flex;
    align-items: center;
    border-radius: 0.45rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-main);
    font-weight: 500;
}

.app-navbar .dropdown-item i {
    width: 1.25rem;
    color: var(--text-muted);
    text-align: center;
}

.app-navbar .dropdown-item:hover,
.app-navbar .dropdown-item:focus {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-dark);
}

.app-navbar .dropdown-item:hover i,
.app-navbar .dropdown-item:focus i {
    color: var(--primary-dark);
}

.app-navbar .dropdown-item.active,
.app-navbar .dropdown-item:active {
    background-color: var(--primary);
    color: #ffffff;
}

.app-navbar .dropdown-item.active i,
.app-navbar .dropdown-item:active i {
    color: #ffffff;
}

.app-navbar .dropdown-divider {
    margin: 0.4rem 0;
}

.app-navbar .dropdown-item.text-danger:hover,
.app-navbar .dropdown-item.text-danger:focus {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger) !important;
}

/*
 * Sideindhold
 */

.content-wrapper {
    min-height: calc(100vh - var(--app-navbar-height));
    padding-top: 24px;
    padding-bottom: 40px;
}

/*
 * Kort
 */

.card {
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.card-header {
    border-bottom: 1px solid var(--border-soft);
    background:
        linear-gradient(
        90deg,
        rgba(13, 110, 253, 0.08),
        rgba(13, 110, 253, 0)
        );
}

/*
 * Tabeller
 */

.table thead th {
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/*
 * Badges
 */

.badge-soft-success {
    background-color: rgba(25, 135, 84, 0.12);
    color: var(--success);
}

.badge-soft-danger {
    background-color: rgba(220, 53, 69, 0.12);
    color: var(--danger);
}

/*
 * Statistik
 */

.stat-card {
    padding: 18px 20px;
    border-radius: 1rem;
    background:
        radial-gradient(
        circle at top left,
        rgba(13, 110, 253, 0.18),
        #0d6efd 35%,
        #0b5ed7 100%
        );
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.45);
}

.stat-card h3 {
    margin: 0;
    font-size: 1.7rem;
}

.stat-card small {
    font-size: 0.78rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    opacity: 0.9;
}

/*
 * Dashboard
 */

.dashboard-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dashboard-card {
    position: relative;
    flex: 1 1 250px;
    overflow: hidden;
    min-height: 150px;
    padding: 1.5rem;
    border-radius: 1rem;
    color: #ffffff;
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
}

.dashboard-card::before {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(
        circle,
        rgba(255, 255, 255, 0.25) 0%,
        transparent 60%
        );
    content: "";
    opacity: 0.2;
    animation: dashboard-pulse 6s infinite linear;
    pointer-events: none;
}

.dashboard-card h3 {
    position: relative;
    margin-bottom: 0.625rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.dashboard-card .value {
    position: relative;
    font-size: clamp(1.75rem, 4vw, 2.3rem);
    font-weight: 700;
}

.card-income {
    background: linear-gradient(135deg, #198754, #2fbf71);
}

.card-expense {
    background: linear-gradient(135deg, #b02a37, #dc3545);
}

.card-result {
    background: linear-gradient(135deg, #495057, #868e96);
}

.graph-card {
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 0.35rem 1.25rem rgba(15, 23, 42, 0.08);
}

canvas#financeChart {
    max-height: 420px;
}

/*
 * Søgefelt
 */

.search-box {
    position: relative;
    width: 100%;
    max-width: 350px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 2.75rem 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 0.625rem;
    transition:
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

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

.search-box .icon {
    position: absolute;
    top: 50%;
    right: 0.875rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    transform: translateY(-50%);
}
.item-actions-column {
    width: 210px;
}
.item-form-container {
    max-width: 900px;
}

.mileage-chart-container {
    min-height: 260px;
}

.mileage-actions-column {
    width: 70px;
}

.company-settings-header-icon {
    width: 3rem;
    height: 3rem;
}

.company-logo-icon {
    width: 2rem;
    height: 2rem;
}

.company-logo-preview-box {
    height: 140px;
}

.company-logo-preview {
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
}
.mileage-year-column {
    width: 120px;
}

.mileage-rate-column {
    width: 200px;
}
.subscription-due-icon {
    width: 2rem;
    height: 2rem;
}
.subscription-section-icon {
    width: 2rem;
    height: 2rem;
}
.user-form-container {
    max-width: 600px;
}
/*
 * Animationer
 */

@keyframes dashboard-pulse {
    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-card::before {
        animation: none;
    }
}

/*
 * Mobilnavigation
 */

@media (max-width: 1199.98px) {
    .app-navbar .navbar-collapse {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .app-navbar .navbar-nav {
        gap: 0.25rem;
    }

    .app-navbar .dropdown-menu {
        margin-top: 0.25rem;
        border-radius: 0.6rem;
        box-shadow: none;
    }

    .app-navbar .nav-link {
        padding: 0.65rem 0.75rem;
    }
}

/*
 * Modulvisninger
 */

.item-actions-column {
    width: 210px;
}

.item-form-container {
    max-width: 900px;
}

.mileage-chart-container {
    min-height: 260px;
}

.mileage-actions-column {
    width: 70px;
}

.company-settings-header-icon {
    width: 3rem;
    height: 3rem;
}

.company-logo-icon {
    width: 2rem;
    height: 2rem;
}

.company-logo-preview-box {
    height: 140px;
}

.company-logo-preview {
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
}

.mileage-year-column {
    width: 120px;
}

.mileage-rate-column {
    width: 200px;
}

.subscription-due-icon,
.subscription-section-icon {
    width: 2rem;
    height: 2rem;
}

.user-form-container {
    max-width: 600px;
}

.login-card-wrapper {
    max-width: 420px;
}

.login-icon {
    width: 3.5rem;
    height: 3.5rem;
}

.dashboard-finance-chart {
    min-height: 340px;
}

.dashboard-category-chart {
    min-height: 300px;
}

/*
 * Administrativ sidebar
 */

.sidebar-modern {
    position: sticky;
    top: 5.5rem;
}

.sidebar-modern .list-group {
    border: 1px solid var(--app-border, #e6e9ef);
    background: #ffffff;
}

.sidebar-modern .list-group-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.375rem;
    padding: 0.8rem 1rem;
    border: 0;
    border-radius: 0.625rem;
    color: #343a40;
    font-size: 0.95rem;
    font-weight: 500;
    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

.sidebar-modern .list-group-item:last-child {
    margin-bottom: 0;
}

.sidebar-modern .list-group-item:hover,
.sidebar-modern .list-group-item:focus {
    background: #eef3ff;
    color: #1746c6;
}

.sidebar-modern .list-group-item.active-menu {
    background: #dce7ff;
    color: #1746c6;
    font-weight: 600;
    box-shadow:
        inset 0 0 0 1px rgba(64, 104, 255, 0.22);
}

.sidebar-modern .list-group-item i {
    width: 1.25rem;
    font-size: 1.1rem;
    text-align: center;
    opacity: 0.9;
}

@media (max-width: 991.98px) {
    .sidebar-modern {
        position: static;
    }
}
