:root {
    --bg-main: #f4f7fe;
    --bg-soft: #eef3ff;
    --card-bg: #ffffff;
    --primary: #4664ff;
    --primary-2: #6c7dff;
    --success: #0fb17f;
    --warning: #f5a623;
    --danger: #e24545;
    --text-main: #1b2559;
    --text-soft: #7c8db5;
    --border: #e8edfb;
    --shadow: 0 18px 35px rgba(24, 39, 75, 0.08);
    --sidebar-bg: #f8fbff;
    --sidebar-bg-2: #eef3ff;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Outfit", sans-serif;
    color: var(--text-main);
    background: var(--bg-main);
    margin: 0;
}

a {
    text-decoration: none;
}

.required::after {
    content: " *";
    color: var(--danger);
}

.table thead th {
    white-space: nowrap;
}

.badge-status {
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 0.45rem 0.6rem;
}

.card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    border-bottom: 1px solid var(--border) !important;
}

.btn {
    border-radius: 12px;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: transparent;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #3f59ed, #5f71ff);
}

.form-control {
    border: 1px solid #dce4ff;
    border-radius: 12px;
    padding: 0.58rem 0.78rem;
}

.form-select {
    border: 1px solid #dce4ff;
    border-radius: 12px;
    padding: 0.58rem 2.25rem 0.58rem 0.78rem;
    background-position: right 0.72rem center;
}

.form-control:focus,
.form-select:focus {
    border-color: #bfd0ff;
    box-shadow: 0 0 0 0.22rem rgba(70, 100, 255, 0.12);
}

.soft-alert {
    border: 0;
    border-radius: 14px;
}

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

.app-sidebar {
    width: 240px;
    background: linear-gradient(185deg, var(--sidebar-bg), var(--sidebar-bg-2));
    color: var(--text-main);
    padding: 1.4rem 1.05rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0.35rem 0.8rem;
}

.sidebar-brand-logo {
    display: block;
    max-width: 165px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sidebar-brand-fallback {
    width: 165px;
    height: 56px;
    border-radius: 12px;
    background: rgba(70, 100, 255, 0.08);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sidebar-menu {
    display: grid;
    gap: 0.35rem;
}

.menu-link {
    color: var(--text-main);
    border-radius: 12px;
    padding: 0.68rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-link i {
    font-size: 1rem;
}

.menu-link:hover {
    color: var(--primary);
    background: rgba(70, 100, 255, 0.08);
}

.menu-link.active {
    background: rgba(70, 100, 255, 0.12);
    color: var(--primary);
}

.sidebar-footer {
    margin-top: 1.2rem;
    padding: 0.5rem;
}

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

.app-topbar {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.topbar-subtitle {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.84rem;
}

.topbar-subtitle,
.client-page-head > div > p.text-muted.mb-0,
.order-page-head > div > p.text-muted.mb-0,
.invoice-compose-subtitle,
.app-content > .d-flex.justify-content-between.align-items-center.mb-3 > div > p.text-muted.mb-0 {
    display: none;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--primary), #9f85ff);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.1;
}

.user-role {
    color: var(--text-soft);
    font-size: 0.8rem;
}

.app-content {
    padding: 1.45rem 1.45rem 1.45rem 1rem;
}

.card-stat {
    border: 0;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.dashboard-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.dashboard-card-link:hover,
.dashboard-card-link:focus {
    color: inherit;
    text-decoration: none;
}

.dashboard-card-link .card-stat {
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-card-link:hover .card-stat,
.dashboard-card-link:focus .card-stat {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(31, 42, 92, 0.12) !important;
}

.card-stat .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 168px;
}

.card-stat::before {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    right: -25px;
    top: -25px;
    opacity: 0.22;
    background: linear-gradient(145deg, var(--primary), #9f85ff);
}

.stat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-soft);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    color: #fff;
    background: linear-gradient(130deg, var(--primary), #7b8dff);
}

.stat-clients .stat-icon {
    background: linear-gradient(130deg, #3f8cff, #56b0ff);
}

.stat-orders .stat-icon {
    background: linear-gradient(130deg, #7b5dff, #9987ff);
}

.stat-pending .stat-icon {
    background: linear-gradient(130deg, #ff9345, #ffb955);
}

.stat-paid .stat-icon {
    background: linear-gradient(130deg, #1dbf89, #4de1ad);
}

.stat-revenue .stat-icon {
    background: linear-gradient(130deg, #1199a9, #44cad9);
}

.stat-renewals .stat-icon {
    background: linear-gradient(130deg, #dd5ce4, #fc8ef1);
}

.stat-value {
    font-size: 1.56rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.stat-meta {
    color: var(--text-soft);
    font-size: 0.8rem;
    margin-top: auto;
    padding-top: 0.35rem;
}

.profile-avatar {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(145deg, #4f6dff, #8e6eff);
    box-shadow: 0 10px 22px rgba(76, 101, 255, 0.35);
}

.profile-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.45px;
    margin-bottom: 0.25rem;
}

.profile-info-value {
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.profile-stat .card-body {
    padding: 0.9rem 1rem;
}

.profile-stat-label {
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.74rem;
    font-weight: 600;
}

.profile-stat-value {
    margin-top: 0.32rem;
    font-size: 1.18rem;
    font-weight: 700;
}

.profile-stat-date {
    font-size: 0.86rem;
    line-height: 1.3;
}

.profile-stat-orders {
    background: linear-gradient(135deg, rgba(79, 109, 255, 0.09), rgba(79, 109, 255, 0.03));
}

.profile-stat-paid {
    background: linear-gradient(135deg, rgba(31, 178, 136, 0.1), rgba(31, 178, 136, 0.03));
}

.client-page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.client-form-shell {
    overflow: hidden;
}

.client-form-header {
    border-bottom: 1px solid var(--border);
    background: linear-gradient(145deg, #f7f9ff, #f1f5ff);
}

.client-head-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #4c6bff, #7f78ff);
}

.client-head-title {
    font-weight: 700;
    line-height: 1.1;
}

.client-head-subtitle {
    color: var(--text-soft);
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

.client-form-section {
    border: 1px solid #e7edff;
    border-radius: 14px;
    background: #fbfcff;
    padding: 1rem;
}

.section-title {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.section-title h6 {
    margin: 0;
    font-weight: 700;
}

.section-title p {
    margin: 0.15rem 0 0;
    color: var(--text-soft);
    font-size: 0.78rem;
}

.section-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #4a66ff;
    background: #eaf0ff;
    font-size: 0.9rem;
}

.contact-mode-list {
    display: grid;
    gap: 0.45rem;
}

.contact-mode-option {
    margin: 0;
    border: 1px solid #dde5ff;
    background: #fff;
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.contact-mode-option input {
    margin-top: 0;
}

.client-form-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    border-top: 1px dashed #dce4ff;
    padding-top: 1rem;
}

.client-aside-card {
    position: sticky;
    top: 86px;
}

.aside-title {
    font-weight: 700;
    margin-bottom: 0.7rem;
}

.aside-list {
    margin: 0 0 0.85rem;
    padding-left: 1.1rem;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.aside-list li {
    margin-bottom: 0.3rem;
}

.aside-chip {
    font-size: 0.82rem;
    border: 1px solid #dce5ff;
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    background: #f8faff;
    color: #4f5f8d;
}

.order-page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.order-form-shell {
    overflow: hidden;
}

.order-form-header {
    border-bottom: 1px solid var(--border);
    background: linear-gradient(145deg, #f8faff, #f0f4ff);
}

.order-config-note {
    font-size: 0.82rem;
    border: 1px solid #dde5ff;
    border-radius: 10px;
    background: #f7faff;
    color: #4f5f8d;
    padding: 0.55rem 0.65rem;
}

.order-item-card {
    border: 1px solid #e4ebff;
    border-radius: 14px;
    padding: 0.95rem;
    background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.order-total-row {
    margin-top: 0.2rem;
}

.order-total-box {
    border: 1px solid #dce4ff;
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    background: #f8faff;
    color: #4f5f8d;
}

.order-total-grand {
    background: linear-gradient(135deg, rgba(70, 100, 255, 0.1), rgba(108, 125, 255, 0.08));
    border-color: #cfd9ff;
    color: #24357a;
}

.order-notes-card {
    position: sticky;
    top: 86px;
}

.public-body {
    min-height: 100vh;
    background: linear-gradient(145deg, #edf2ff, #f9fcff);
}

.public-main {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.public-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.3;
    z-index: 0;
}

.glow-a {
    width: 330px;
    height: 330px;
    background: #6e8fff;
    top: -100px;
    left: -70px;
}

.glow-b {
    width: 300px;
    height: 300px;
    background: #64e5c3;
    right: -100px;
    bottom: -100px;
}

.public-main > .container {
    position: relative;
    z-index: 1;
}

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

.table > :not(caption) > * > * {
    border-bottom-color: #edf1fc;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    vertical-align: middle;
}

.table thead th {
    color: #7586b0;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.login-card {
    border: 0 !important;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.login-left {
    border-radius: 16px 0 0 16px;
    background: linear-gradient(150deg, #182b86, #4254d3 58%, #5e6cff);
    color: #fff;
    min-height: 100%;
    padding: 2rem;
}

.login-left h3 {
    font-weight: 700;
}

.login-left p {
    color: rgba(255, 255, 255, 0.82);
}

.login-feature {
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    margin-bottom: 0.55rem;
    font-size: 0.88rem;
}

.login-right {
    padding: 2rem;
}

.sidebar-overlay {
    display: none;
}

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

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

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

    body.sidebar-open .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 1035;
    }

    .app-topbar {
        padding: 0.9rem 1rem;
    }

    .app-content {
        padding: 1rem;
    }

    .topbar-subtitle,
    .user-role {
        display: none;
    }

    .login-left {
        border-radius: 16px 16px 0 0;
    }

    .client-aside-card {
        position: static;
    }

    .order-notes-card {
        position: static;
    }
}
