@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Outfit:wght@500;600;700&display=swap");

:root {
    --mui-primary: #2962ff;
    --mui-primary-strong: #0039cb;
    --mui-accent: #00b8d4;
    --mui-danger: #d32f2f;
    --mui-success: #2e7d32;
    --mui-warning: #f57c00;
    --mui-bg: #eef3fb;
    --mui-surface: #ffffff;
    --mui-surface-muted: #f6f8fc;
    --mui-text: #0f1b3d;
    --mui-text-muted: #66708a;
    --mui-border: #dbe3f2;
    --mui-radius: 16px;
    --mui-shadow-sm: 0 6px 16px rgba(22, 40, 80, 0.08);
    --mui-shadow-md: 0 14px 34px rgba(22, 40, 80, 0.12);
}

* {
    box-sizing: border-box;
}

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

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--mui-text);
    background:
        radial-gradient(1200px circle at -15% -20%, rgba(41, 98, 255, 0.2), transparent 40%),
        radial-gradient(900px circle at 115% 0%, rgba(0, 184, 212, 0.18), transparent 35%),
        var(--mui-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 280px 1fr;
}

.app-sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(170deg, #12234f 0%, #0b1530 100%);
    color: #f5f8ff;
}

.sidebar-brand {
    padding: 1.4rem 1.4rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-kicker {
    margin: 0;
    color: #9fb6ff;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.brand-title {
    margin: 0.55rem 0 0;
    font-family: "Outfit", "Manrope", sans-serif;
    font-size: 1.26rem;
    letter-spacing: 0.01em;
}

.sidebar-nav {
    padding: 0.9rem;
}

.sidebar-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-label {
    margin: 0 0 0.55rem;
    color: #91a7ea;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.68rem;
    font-weight: 700;
}

.nav-link,
.nav-button,
.subnav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.56rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #d3defe;
    padding: 0.62rem 0.72rem;
    font-size: 0.86rem;
    font-weight: 600;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-link:hover,
.subnav-link:hover,
.nav-button:hover {
    background: rgba(129, 156, 255, 0.16);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-link.is-active {
    background: rgba(97, 143, 255, 0.25);
    color: #ffffff;
}

.subnav-link.is-active {
    background: rgba(97, 143, 255, 0.22);
    color: #ffffff;
}

.nav-button::-webkit-details-marker,
.sidebar-nav summary::marker {
    display: none;
}

.nav-link svg,
.nav-button svg,
.subnav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.subnav-wrap {
    margin: 0.36rem 0 0 1.55rem;
    padding-left: 0.7rem;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.subnav-link {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.42rem 0.56rem;
}

.nav-button[disabled] {
    opacity: 0.44;
    cursor: not-allowed;
}

.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--mui-border);
    background: rgba(255, 255, 255, 0.84);
    padding: 1rem 1.5rem;
    backdrop-filter: blur(12px);
}

.topbar-kicker {
    margin: 0;
    font-size: 0.86rem;
    color: var(--mui-text-muted);
}

.topbar-title {
    margin: 0.18rem 0 0;
    font-size: 1.52rem;
    font-weight: 800;
    color: var(--mui-text);
}

.topbar-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.68rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--mui-border);
    background: var(--mui-surface);
    color: var(--mui-text-muted);
    border-radius: 999px;
    padding: 0.45rem 0.74rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.chip-primary {
    border-color: rgba(41, 98, 255, 0.16);
    color: var(--mui-primary);
    background: rgba(41, 98, 255, 0.08);
}

.chip-accent {
    border-color: rgba(0, 184, 212, 0.2);
    color: #007d8f;
    background: rgba(0, 184, 212, 0.14);
}

.app-content {
    padding: 1.3rem;
}

.app-footer {
    margin-top: auto;
    border-top: 1px solid var(--mui-border);
    background: rgba(255, 255, 255, 0.9);
    color: var(--mui-text-muted);
    padding: 0.9rem 1.2rem;
    text-align: center;
    font-size: 0.8rem;
}

.heart {
    color: #f14880;
}

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

.content-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.card,
.stat-card {
    border: 1px solid var(--mui-border);
    border-radius: var(--mui-radius);
    background: var(--mui-surface);
    box-shadow: var(--mui-shadow-sm);
}

.card {
    padding: 1rem;
}

.stat-card {
    padding: 1.05rem;
}

.stat-title {
    margin: 0;
    color: var(--mui-text-muted);
    font-size: 0.84rem;
}

.stat-value {
    margin: 0.55rem 0 0;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--mui-text);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-kicker {
    margin: 0;
    color: var(--mui-text-muted);
    font-size: 0.82rem;
}

.section-title {
    margin: 0.2rem 0 0;
    font-size: 1.04rem;
    color: var(--mui-text);
    font-weight: 700;
}

.chart {
    display: flex;
    align-items: flex-end;
    gap: 0.7rem;
    min-height: 255px;
    margin-top: 0.6rem;
}

.chart-col {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.chart-bar-wrap {
    height: 186px;
    border-radius: 14px;
    background: #edf1f9;
    padding: 8px;
    display: flex;
    align-items: flex-end;
}

.chart-bar {
    width: 100%;
    border-radius: 10px;
    animation: growBar 0.65s ease-out;
    transform-origin: bottom;
}

.chart-bar.primary {
    background: linear-gradient(180deg, #5a8dff 0%, #2962ff 100%);
}

.chart-bar.accent {
    background: linear-gradient(180deg, #41d6ed 0%, #00a7c2 100%);
}

.chart-label {
    margin-top: 0.6rem;
    font-size: 0.74rem;
    color: var(--mui-text-muted);
    font-weight: 700;
}

.chart-value {
    margin-top: 0.14rem;
    font-size: 0.73rem;
    color: #7b879f;
}

.dashboard-chart-grid {
    grid-template-columns: 1fr;
}

.dashboard-chart .chart {
    overflow-x: auto;
    padding-bottom: 0.4rem;
    gap: 0.55rem;
}

.dashboard-chart .chart-col {
    flex: 0 0 76px;
    min-width: 76px;
}

.dashboard-chart .chart-value {
    font-size: 0.68rem;
    line-height: 1.25;
    white-space: nowrap;
}

.dashboard-chart .section-head {
    flex-wrap: wrap;
}

.table-card {
    overflow: hidden;
    border: 1px solid var(--mui-border);
    border-radius: var(--mui-radius);
    background: var(--mui-surface);
    box-shadow: var(--mui-shadow-sm);
}

.table-head {
    padding: 0.88rem 1rem;
    border-bottom: 1px solid var(--mui-border);
    background: var(--mui-surface-muted);
    color: var(--mui-text-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.data-table th,
.data-table td {
    padding: 0.76rem 1rem;
    border-bottom: 1px solid #edf1f9;
    text-align: left;
    font-size: 0.84rem;
}

.data-table th {
    background: #f8faff;
    color: #56617d;
    font-weight: 700;
}

.data-table th.text-right,
.data-table td.text-right {
    text-align: right;
}

.data-table tbody tr:hover {
    background: #f8fbff;
}

.data-table tbody tr.invoice-row-pending {
    background: #fff4e8;
}

.data-table tbody tr.invoice-row-pending:hover {
    background: #ffe9cf;
}

.invoice-done-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 0.24rem 0.56rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
}

.invoice-done-badge.is-yes {
    background: rgba(46, 125, 50, 0.12);
    color: #1f6b23;
}

.invoice-done-badge.is-no {
    background: rgba(245, 124, 0, 0.16);
    color: #a55100;
}

.data-table td.title {
    color: #16223f;
    font-weight: 700;
}

.muted {
    color: var(--mui-text-muted);
}

.text-right {
    text-align: right;
}

.table-empty {
    text-align: center;
    color: var(--mui-text-muted);
    padding: 1.5rem 1rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-title {
    margin: 0;
    font-family: "Outfit", "Manrope", sans-serif;
    font-size: 1.65rem;
    color: var(--mui-text);
}

.page-subtitle {
    margin: 0;
    color: var(--mui-text-muted);
    font-size: 0.86rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    color: var(--mui-primary);
    font-weight: 700;
    font-size: 0.86rem;
    margin-bottom: 0.44rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.44rem;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 0.7rem 0.92rem;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #2962ff 0%, #0d47a1 100%);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(41, 98, 255, 0.24);
}

.btn-primary:hover {
    box-shadow: 0 12px 22px rgba(41, 98, 255, 0.32);
}

.btn-outline {
    border-color: var(--mui-border);
    color: var(--mui-text);
    background: #ffffff;
}

.btn-outline:hover {
    background: #f5f8ff;
}

.btn-danger {
    color: var(--mui-danger);
    background: rgba(211, 47, 47, 0.08);
    border-color: rgba(211, 47, 47, 0.2);
}

.btn-link {
    border: 0;
    background: transparent;
    color: var(--mui-primary);
    font-weight: 700;
    padding: 0;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-card {
    max-width: 860px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.form-group {
    margin-bottom: 0.9rem;
}

.label {
    display: block;
    margin-bottom: 0.44rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: #223257;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid #cfd9eb;
    border-radius: 11px;
    background: #ffffff;
    color: #16223f;
    font-size: 0.92rem;
    font-family: inherit;
    line-height: 1.4;
    padding: 0.64rem 0.72rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--mui-primary);
    box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.16);
}

.textarea {
    resize: vertical;
    min-height: 100px;
}

.error {
    margin-top: 0.34rem;
    color: var(--mui-danger);
    font-size: 0.78rem;
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.alert {
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0.8rem 0.9rem;
    font-size: 0.84rem;
}

.alert-success {
    background: rgba(46, 125, 50, 0.1);
    color: #1b5e20;
    border-color: rgba(46, 125, 50, 0.24);
}

.alert-error {
    background: rgba(211, 47, 47, 0.1);
    color: #8a1313;
    border-color: rgba(211, 47, 47, 0.24);
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.74rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--mui-border);
    background: #ffffff;
    color: var(--mui-text-muted);
    padding: 0 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.pagination .active span {
    border-color: rgba(41, 98, 255, 0.24);
    color: var(--mui-primary);
    background: rgba(41, 98, 255, 0.08);
}

.meta-row {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    color: var(--mui-text-muted);
    font-size: 0.84rem;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.login-promo {
    padding: clamp(1.8rem, 4vw, 3rem);
    background:
        radial-gradient(circle at 18% 10%, rgba(65, 165, 255, 0.38), transparent 45%),
        linear-gradient(150deg, #0a1b42 0%, #0f285e 52%, #00395d 100%);
    color: #edf2ff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.promo-kicker {
    margin: 0;
    font-size: 0.74rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #9fc6ff;
}

.promo-company-logo {
    width: min(100%, 300px);
    max-height: 68px;
    display: block;
    object-fit: contain;
    object-position: left center;
}

.promo-title {
    margin: 0.7rem 0 0;
    max-width: 520px;
    font-family: "Outfit", "Manrope", sans-serif;
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    line-height: 1.07;
}

.promo-brand {
    margin-top: 0.7rem;
    display: flex;
    align-items: center;
}

.promo-logo {
    width: min(100%, 430px);
    max-height: 105px;
    height: auto;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.promo-points {
    display: grid;
    gap: 0.8rem;
    max-width: 560px;
}

.promo-point {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.86rem 0.92rem;
    font-size: 0.9rem;
}

.login-form-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.2rem;
}

.login-brand {
    width: 100%;
    max-width: 470px;
    display: flex;
    justify-content: center;
}

.login-logo {
    width: min(100%, 340px);
    max-height: 92px;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
}

.login-brand-text {
    margin: 0;
    font-family: "Outfit", "Manrope", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mui-text);
    text-align: center;
}

.login-card {
    width: 100%;
    max-width: 470px;
    border-radius: 20px;
    border: 1px solid var(--mui-border);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--mui-shadow-md);
    padding: 1.35rem;
}

.login-title {
    margin: 0.22rem 0 0;
    font-size: 1.8rem;
    color: var(--mui-text);
    font-family: "Outfit", "Manrope", sans-serif;
}

.login-subtitle {
    margin: 0;
    color: var(--mui-text-muted);
    font-size: 0.9rem;
}

.login-form {
    margin-top: 1rem;
}

.w-full {
    width: 100%;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 0.9rem;
}

.mt-3 {
    margin-top: 1.2rem;
}

@keyframes growBar {
    from {
        transform: scaleY(0.2);
        opacity: 0.25;
    }
    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

@media (max-width: 1200px) {
    .content-grid-3,
    .content-grid-2 {
        grid-template-columns: 1fr;
    }

    .dashboard-chart .chart-col {
        flex-basis: 72px;
        min-width: 72px;
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-promo {
        min-height: 320px;
    }

    .promo-company-logo {
        width: min(100%, 260px);
    }

    .promo-logo {
        width: min(100%, 360px);
        max-height: 84px;
    }

    .login-logo {
        width: min(100%, 300px);
        max-height: 82px;
    }
}

@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-meta {
        width: 100%;
        justify-content: flex-start;
    }

    .app-content {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}