:root {
    --ebiz-bg: #f5f7fb;
    --ebiz-surface: #ffffff;
    --ebiz-surface-2: #eef3ff;
    --ebiz-text: #172033;
    --ebiz-muted: #667085;
    --ebiz-border: #dfe6f1;
    --ebiz-primary: #3258e8;
    --ebiz-primary-dark: #2442b5;
    --ebiz-accent: #7c3aed;
    --ebiz-success: #0f9f6e;
    --ebiz-warning: #d97706;
    --ebiz-sidebar: #111827;
    --ebiz-radius: 8px;
    --ebiz-shadow: 0 18px 50px rgba(18, 25, 38, 0.08);
}

* {
    letter-spacing: 0;
}

body {
    color: var(--ebiz-text);
    background: var(--ebiz-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-body {
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: 282px;
    min-height: 100vh;
    background: var(--ebiz-sidebar);
    color: #e5e7eb;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease;
}

.sidebar-brand {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-link,
.auth-brand {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #3258e8, #0f9f6e);
    font-weight: 800;
    font-size: 24px;
}

.brand-link strong,
.auth-brand strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.brand-link small,
.auth-brand small {
    color: #aeb7c8;
    font-size: 12px;
}

.sidebar-nav {
    padding: 18px 14px;
    display: grid;
    gap: 4px;
}

.sidebar-nav .nav-link {
    min-height: 42px;
    border-radius: 8px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 14px;
}

.sidebar-nav .nav-link i {
    width: 22px;
    text-align: center;
    font-size: 17px;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.tenant-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,.06);
    border-radius: 8px;
}

.tenant-avatar,
.user-avatar {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: #3258e8;
    font-weight: 800;
}

.tenant-mini strong,
.tenant-mini small {
    display: block;
}

.tenant-mini small {
    color: #aeb7c8;
}

.app-main {
    margin-left: 282px;
    min-width: 0;
    flex: 1;
}

.app-topbar {
    min-height: 76px;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ebiz-border);
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: space-between;
    padding: 16px 28px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    min-width: 0;
}

.topbar-title h1 {
    font-size: 22px;
    line-height: 1.15;
    margin: 0;
    font-weight: 800;
}

.topbar-title span {
    color: var(--ebiz-muted);
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu {
    border: 1px solid var(--ebiz-border);
    background: #fff;
    border-radius: 8px;
    min-height: 42px;
    padding: 4px 8px 4px 4px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    color: var(--ebiz-text);
}

.app-content {
    padding: 28px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.page-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
}

.page-head h2,
.section-title {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    margin: 0 0 6px;
}

.page-head p {
    color: var(--ebiz-muted);
    margin: 0;
}

.panel {
    background: var(--ebiz-surface);
    border: 1px solid var(--ebiz-border);
    border-radius: var(--ebiz-radius);
    box-shadow: var(--ebiz-shadow);
}

.panel-body {
    padding: 22px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--ebiz-border);
    border-radius: 8px;
    padding: 18px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card small {
    color: var(--ebiz-muted);
    font-weight: 700;
}

.stat-card strong {
    font-size: 30px;
    line-height: 1;
}

.hero-panel {
    background: linear-gradient(135deg, #ffffff 0%, #eef3ff 100%);
    border: 1px solid #d7e0ff;
    border-radius: 8px;
    padding: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    gap: 20px;
    align-items: center;
}

.hero-panel h2 {
    font-size: 30px;
    font-weight: 850;
    margin: 0 0 10px;
}

.hero-panel p {
    color: var(--ebiz-muted);
    max-width: 680px;
    margin-bottom: 18px;
}

.quick-card {
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(50, 88, 232, .18);
    border-radius: 8px;
    padding: 18px;
}

.quick-card ul {
    margin: 0;
    padding-left: 20px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.service-card {
    background: #fff;
    border: 1px solid var(--ebiz-border);
    border-radius: 8px;
    padding: 20px;
    min-height: 246px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    margin-bottom: 14px;
}

.service-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 6px;
}

.service-card p {
    color: var(--ebiz-muted);
    margin-bottom: 14px;
}

.service-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    border-radius: 6px;
    font-weight: 750;
}

.beta-badge {
    background: #e9f8ef;
    color: #067647;
    border: 1px solid #b7ebc9;
}

.form-label {
    font-weight: 700;
    color: #344054;
}

.form-control,
.form-select {
    min-height: 43px;
    border-radius: 8px;
    border-color: #d7deea;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ebiz-primary);
    box-shadow: 0 0 0 .2rem rgba(50, 88, 232, .12);
}

.btn {
    border-radius: 8px;
    font-weight: 750;
    min-height: 40px;
}

.btn-primary {
    background: var(--ebiz-primary);
    border-color: var(--ebiz-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--ebiz-primary-dark);
    border-color: var(--ebiz-primary-dark);
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
}

.table {
    --bs-table-bg: transparent;
}

.table th {
    color: #667085;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
}

.table td {
    vertical-align: middle;
}

.empty-state {
    padding: 42px 18px;
    text-align: center;
    color: var(--ebiz-muted);
}

.empty-state i {
    font-size: 44px;
    color: #98a2b3;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--ebiz-text);
    font-weight: 800;
    margin: 12px 0 6px;
}

.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fb 0%, #eef3ff 100%);
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-shell {
    width: min(1080px, 100%);
    min-height: 680px;
    background: #fff;
    border: 1px solid var(--ebiz-border);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .14);
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    overflow: hidden;
}

.auth-panel {
    padding: 38px;
}

.auth-panel h1 {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 850;
    margin: 34px 0 8px;
}

.auth-panel .lead {
    color: var(--ebiz-muted);
    font-size: 15px;
}

.auth-side {
    background:
        linear-gradient(135deg, rgba(17,24,39,.92), rgba(36,66,181,.9)),
        url('/assets/img/auth-pattern.svg');
    color: #fff;
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-side h2 {
    font-size: 38px;
    line-height: 1.04;
    font-weight: 850;
    max-width: 520px;
}

.auth-side p {
    color: #d9e2f5;
    max-width: 520px;
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-feature-grid span {
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255,255,255,.08);
    font-weight: 700;
}

.auth-feature-grid i {
    margin-right: 8px;
}

.module-placeholder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
}

.timeline-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline-list li {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ebiz-border);
}

.timeline-list li:last-child {
    border-bottom: 0;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--ebiz-primary);
    margin-top: 7px;
    flex: 0 0 auto;
}

@media (max-width: 1180px) {
    .service-grid,
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 1030;
        display: none;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }

    .hero-panel,
    .module-placeholder,
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-side {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .app-content,
    .app-topbar {
        padding: 18px;
    }

    .topbar-title h1 {
        font-size: 18px;
    }

    .page-head {
        display: block;
    }

    .page-head .btn,
    .page-head .btn-group {
        margin-top: 12px;
    }

    .service-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        padding: 20px;
    }

    .hero-panel h2 {
        font-size: 24px;
    }

    .auth-panel {
        padding: 24px;
    }
}
