/* ============================================================
   SaasSolution – Modern Admin Theme
   ============================================================ */

:root {
    --sidebar-bg: #1e1b4b;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: rgba(99,102,241,0.25);
    --sidebar-active-border: #6366f1;
    --sidebar-text: rgba(255,255,255,0.75);
    --sidebar-width: 260px;
    --topbar-h: 64px;
    --indigo: #6366f1;
    --indigo-dark: #4f46e5;
    --surface: #f5f6ff;
    --card-shadow: 0 2px 16px rgba(99,102,241,0.08);
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--surface);
    color: #1e1b4b;
    margin: 0;
}

/* ── Sidebar ─────────────────────────────────────────────── */
#app-wrapper { min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    transition: width .25s ease, transform .25s ease;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    color: #fff;
    font-size: 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--indigo);
    background: rgba(99,102,241,0.18);
    border-radius: 10px;
    padding: 6px;
    flex-shrink: 0;
}

.sidebar-nav {
    list-style: none;
    padding: 14px 0;
    margin: 0;
}

.nav-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 16px 20px 6px;
    white-space: nowrap;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background .15s, color .15s, border-color .15s;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.sidebar-link i { font-size: 1.1rem; flex-shrink: 0; }

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--sidebar-active-border);
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 12px 0;
}

/* collapsed sidebar */
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-link span { display: none; }
.sidebar.collapsed .sidebar-link { 
    justify-content: center; 
    padding: 12px; 
    border-left: none; 
}
.sidebar.collapsed .sidebar-link i { margin: 0; }
.sidebar.collapsed .brand-icon { margin: 0; }
.sidebar.collapsed form { width: 100%; }
.sidebar.collapsed .sidebar-footer form .sidebar-link { text-align: center !important; }
.sidebar.collapsed .vipps-full { display: none !important; }

/* ── Main content ────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left .25s ease;
}

.sidebar-collapsed .main-content { margin-left: 68px; }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #ebebf5;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(99,102,241,0.06);
}

.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e1b4b;
}

.sidebar-toggle {
    background: transparent;
    border: 1px solid #ebebf5;
    border-radius: 8px;
    color: #6b7280;
    padding: 6px 9px;
}

.sidebar-toggle:hover { background: var(--surface); color: var(--indigo); }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border-radius: 50px;
    padding: 5px 14px 5px 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    border: 1px solid #ebebf5;
}

.user-avatar {
    width: 30px; height: 30px;
    background: var(--indigo);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.9rem;
}

/* ── Page content ────────────────────────────────────────── */
.page-content { padding: 28px 28px 48px; }

/* ── Cards ───────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid #ebebf5;
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.indigo  { background: rgba(99,102,241,0.12); color: var(--indigo); }
.stat-icon.green   { background: rgba(16,185,129,0.12); color: #10b981; }
.stat-icon.amber   { background: rgba(245,158,11,0.12); color: #f59e0b; }
.stat-icon.rose    { background: rgba(239,68,68,0.12);  color: #ef4444; }

.stat-label { font-size: 0.78rem; color: #9ca3af; font-weight: 500; margin-bottom: 2px; }
.stat-value { font-size: 1.35rem; font-weight: 700; color: #1e1b4b; }

/* ── Section cards ───────────────────────────────────────── */
.section-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    border: 1px solid #ebebf5;
    overflow: hidden;
}

.section-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #ebebf5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e1b4b;
    margin: 0;
}

.section-card-body { padding: 24px; }

/* ── Pricing cards ───────────────────────────────────────── */
.pricing-card {
    background: #fff;
    border-radius: var(--radius);
    border: 2px solid #ebebf5;
    padding: 32px 28px;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    position: relative;
    height: 100%;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(99,102,241,0.15);
}

.pricing-card.featured {
    border-color: var(--indigo);
    box-shadow: 0 8px 32px rgba(99,102,241,0.2);
}

.pricing-badge {
    position: absolute;
    top: -13px; left: 50%; transform: translateX(-50%);
    background: var(--indigo);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 4px 16px;
    border-radius: 20px;
}

.pricing-name { font-size: 1rem; font-weight: 600; color: #6b7280; margin-bottom: 8px; }
.pricing-price { font-size: 2.4rem; font-weight: 700; color: #1e1b4b; line-height: 1; }
.pricing-period { font-size: 0.85rem; color: #9ca3af; margin-left: 4px; }

.pricing-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.9rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.pricing-feature:last-child { border: none; }
.pricing-feature i { color: #10b981; font-size: 1rem; }

/* ── Subscription status badge ───────────────────────────── */
.sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
}

.sub-badge.active   { background: rgba(16,185,129,0.12); color: #059669; }
.sub-badge.inactive { background: rgba(107,114,128,0.12); color: #6b7280; }

/* ── Table ───────────────────────────────────────────────── */
.modern-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.modern-table th {
    background: var(--surface);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9ca3af;
    padding: 11px 18px;
    border-bottom: 1px solid #ebebf5;
}

.modern-table td {
    padding: 14px 18px;
    font-size: 0.88rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.modern-table tr:last-child td { border-bottom: none; }
.modern-table tr:hover td { background: #fafaff; }

/* ── Profile ─────────────────────────────────────────────── */
.profile-avatar-lg {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo), #818cf8);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    color: #fff;
    flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-indigo {
    background: var(--indigo);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 22px;
    transition: background .15s, transform .1s;
}

.btn-indigo:hover { background: var(--indigo-dark); color: #fff; transform: translateY(-1px); }

.btn-vipps {
    background: #ff5b24;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 22px;
    transition: background .15s, transform .1s, box-shadow .1s;
}

.btn-vipps:hover {
    background: #e04a14;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,91,36,0.35);
}

.btn-outline-indigo {
    color: var(--indigo);
    border: 2px solid var(--indigo);
    border-radius: 10px;
    font-weight: 600;
    padding: 9px 22px;
    background: transparent;
    transition: all .15s;
}

.btn-outline-indigo:hover { background: var(--indigo); color: #fff; }

/* ── Public pages ────────────────────────────────────────── */
.public-navbar {
    background: #fff;
    border-bottom: 1px solid #ebebf5;
    padding: 0 0;
    box-shadow: 0 1px 8px rgba(99,102,241,0.06);
}

.public-navbar .navbar-brand { font-size: 1.25rem; color: #1e1b4b; }
.text-indigo { color: var(--indigo) !important; }

.hero-section {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4f46e5 100%);
    padding: 100px 0 80px;
    text-align: center;
    color: #fff;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 18px;
}

.hero-section p { font-size: 1.15rem; color: rgba(255,255,255,0.75); max-width: 520px; margin: 0 auto 32px; }

.public-footer { background: #fff; border-top: 1px solid #ebebf5; }

/* ── Success page ────────────────────────────────────────── */
.success-icon {
    width: 80px; height: 80px;
    background: rgba(16,185,129,0.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem;
    color: #10b981;
    margin: 0 auto 20px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { 
        transform: translateX(-100%); 
        width: 260px !important;
    }
    .sidebar.mobile-open { 
        transform: translateX(0); 
        box-shadow: 8px 0 32px rgba(0,0,0,0.5);
    }
    /* Når mobil-meny er åpen, vis tekst */
    .sidebar.mobile-open .sidebar-brand span,
    .sidebar.mobile-open .nav-label,
    .sidebar.mobile-open .sidebar-link span { 
        display: inline !important; 
    }
    .sidebar.mobile-open .sidebar-link { 
        justify-content: flex-start !important; 
        padding: 10px 20px !important;
    }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 18px; }
    .hero-section h1 { font-size: 2rem; }
}

/* ── Mobile sidebar overlay ──────────────────────────────── */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}
.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Sidebar Submenu ──────────────────────────────────────── */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0,0,0,0.15);
}

.sidebar-submenu .sidebar-link {
    padding-left: 52px;
    font-size: 0.8rem;
    border-left: none;
}

.sidebar-submenu .sidebar-link i {
    font-size: 0.9rem;
}

.sidebar-link[data-bs-toggle="collapse"] {
    position: relative;
}

.sidebar-link[data-bs-toggle="collapse"] .bi-chevron-down {
    transition: transform 0.2s ease;
}

.sidebar-link[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* ── User Dropdown ─────────────────────────────────────────── */
.user-chip.dropdown-toggle::after {
    margin-left: 8px;
    vertical-align: middle;
}

.dropdown-menu {
    border: 1px solid #ebebf5;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 8px 0;
    min-width: 220px;
}

.dropdown-header {
    padding: 12px 16px;
    background: transparent;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #374151;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background: var(--surface);
    color: var(--indigo);
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: #ebebf5;
}

/* ── Button variants ──────────────────────────────────────── */
.btn-indigo {
    background: var(--indigo);
    border-color: var(--indigo);
    color: #fff;
}

.btn-indigo:hover {
    background: var(--indigo-dark);
    border-color: var(--indigo-dark);
    color: #fff;
}

.btn-outline-indigo {
    background: transparent;
    border-color: var(--indigo);
    color: var(--indigo);
}

.btn-outline-indigo:hover {
    background: var(--indigo);
    color: #fff;
}

.bg-indigo {
    background-color: var(--indigo) !important;
}

.text-indigo {
    color: var(--indigo) !important;
}

/* ── Profile page extras ─────────────────────────────────── */
.profile-avatar-lg {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
}

.sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.sub-badge.active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.sub-badge.inactive {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
