/* Mavriq Modern UI Theme */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --mq-bg: #f3f6fb;
    --mq-surface: #ffffff;
    --mq-surface-soft: #f8fafc;
    --mq-border: #d9e0ea;
    --mq-border-strong: #c5d2e5;
    --mq-text: #111827;
    --mq-muted: #5f6b7a;
    --mq-primary: #145af2;
    --mq-primary-2: #0f86ff;
    --mq-success: #0d9f6e;
    --mq-warning: #d97706;
    --mq-danger: #d63a4a;
    --mq-info: #0e9ac9;
    --mq-radius-lg: 22px;
    --mq-radius-md: 14px;
    --mq-shadow-1: 0 10px 24px rgba(15, 40, 80, 0.08);
    --mq-shadow-2: 0 18px 40px rgba(15, 40, 80, 0.16);
}

html,
body {
    font-family: 'Manrope', sans-serif;
    background: radial-gradient(circle at 12% 10%, #dbe9ff 0%, transparent 35%), radial-gradient(circle at 96% 90%, #d8f8ea 0%, transparent 33%), var(--mq-bg);
    color: var(--mq-text);
}

#wrapper {
    min-height: 100vh;
}

.content {
    padding: 26px 24px 40px;
}

.page-title,
.header-title,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.01em;
}

.page-title-box {
    margin-bottom: 18px;
}

.page-title {
    font-size: 1.6rem;
    margin-bottom: 0;
}

.text-muted {
    color: var(--mq-muted) !important;
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(253, 255, 255, 0.95) 100%);
    border: 1px solid var(--mq-border);
    border-radius: var(--mq-radius-lg);
    box-shadow: var(--mq-shadow-1);
}

.card .card-body {
    padding: 1.2rem;
}

.card:hover {
    border-color: var(--mq-border-strong);
    box-shadow: var(--mq-shadow-2);
    transform: translateY(-2px);
    transition: all 0.25s ease;
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.btn-primary,
.btn-success,
.btn-info {
    border: none;
}

.btn-primary {
    background: linear-gradient(140deg, var(--mq-primary), var(--mq-primary-2));
}

.btn-success {
    background: linear-gradient(140deg, #0aa56a, #22c283);
}

.btn-info {
    background: linear-gradient(140deg, #078fb4, #37b9dd);
}

.table,
table {
    --bs-table-bg: transparent;
    border-color: #dde5f0;
}

table thead,
.table thead {
    background: #122d52;
    color: #eff6ff;
}

table th,
.table th {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.84rem;
}

table tbody tr:hover,
.table tbody tr:hover {
    background-color: #f1f7ff;
}

.alert {
    border-radius: 14px;
    border: none;
}

.footer {
    background: transparent;
    border-top: 1px solid var(--mq-border);
    margin-top: 24px;
}

.footer a {
    color: #113f99;
    font-weight: 600;
}

.form-control,
.form-select,
input,
textarea,
select {
    border-radius: 12px !important;
    border: 1px solid #d5dfec !important;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: #6ea5ff !important;
    box-shadow: 0 0 0 3px rgba(20, 90, 242, 0.12) !important;
}

/* Sidebar + Topbar */
.app-menu {
    width: 300px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    background: linear-gradient(180deg, #0f203a 0%, #0e2f5e 65%, #133969 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 18px 0 30px rgba(11, 27, 52, 0.33);
}

.navbar-custom {
    position: fixed;
    top: 0;
    left: 300px;
    width: calc(100% - 300px);
    z-index: 1001;
    border-bottom: 1px solid #d8e2f0;
    background: rgba(250, 252, 255, 0.92);
    backdrop-filter: blur(8px);
}

.content-page {
    margin-left: 300px;
    width: calc(100% - 300px);
    padding-top: var(--ct-topbar-height, 70px);
}

body.sidebar-collapsed .app-menu {
    width: 88px;
}

body.sidebar-collapsed .navbar-custom {
    left: 88px;
    width: calc(100% - 88px);
}

body.sidebar-collapsed .content-page {
    margin-left: 88px;
    width: calc(100% - 88px);
}

html[data-layout-mode=detached] body #wrapper .app-menu {
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
}

html[data-layout-mode=detached] body #wrapper .navbar-custom {
    top: 0 !important;
    border-radius: 0 !important;
}

.mq-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 14px 10px;
    flex-shrink: 0;
}

.mq-logo {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    object-fit: contain;
    padding: 10px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.mq-brand-text {
    color: #ecf4ff;
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-top: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
}

.mq-userbox {
    margin: 8px 14px 10px;
    border-radius: 14px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mq-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.mq-user-details {
    min-width: 0;
}

.mq-user-name {
    color: #f8fbff;
    font-size: 0.85rem;
    line-height: 1.2;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mq-user-role {
    color: #b5cdf0;
    font-size: 0.75rem;
    margin: 0;
}

.app-menu .menu {
    padding: 0 12px 8px;
}

.app-menu .scrollbar {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
    padding-bottom: 0;
}

.menu-link {
    color: #d4e2f7 !important;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 4px 2px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.menu-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
}

.menu-link.active {
    color: #ffffff !important;
    background: linear-gradient(140deg, rgba(20, 90, 242, 0.64), rgba(15, 134, 255, 0.36));
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.menu-icon {
    color: #95b1d8;
    min-width: 20px;
}

.menu-link.active .menu-icon,
.menu-link:hover .menu-icon {
    color: #dff0ff;
}

.menu-item.disabled .menu-link {
    opacity: 0.42;
    pointer-events: none;
}

.topbar {
    padding-inline: 14px;
}

.button-toggle-menu,
.topbar .nav-link {
    color: #123a74 !important;
    border-radius: 10px;
}

.button-toggle-menu:hover,
.topbar .nav-link:hover {
    background: #e8f1ff;
}

.nav-user .rounded-circle {
    border: 2px solid #bfd4f8;
}

.profile-dropdown {
    border-radius: 14px;
    border: 1px solid #d8e3f2;
    box-shadow: var(--mq-shadow-1);
}

/* Dashboard extras */
.mq-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #11284a 0%, #145af2 52%, #0f86ff 100%);
    color: #eff7ff;
    border-radius: 24px;
    padding: 26px;
    margin-bottom: 20px;
    box-shadow: var(--mq-shadow-2);
}

.mq-hero::after {
    content: '';
    position: absolute;
    right: -70px;
    top: -90px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
}

.mq-hero h2 {
    color: #fff;
    margin-bottom: 8px;
}

.mq-kpi {
    position: relative;
    overflow: hidden;
}

.mq-kpi .kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.mq-kpi p {
    margin-bottom: 0;
}

.mq-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mq-dashboard-shell {
    display: grid;
    gap: 14px;
}

.mq-stat {
    font-size: clamp(1.3rem, 2.1vw, 1.9rem);
    font-weight: 800;
    line-height: 1.1;
}

.mq-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.mq-chip.ok {
    background: #eafbf3;
    color: #0f8d62;
}

.mq-chip.warn {
    background: #fff7e8;
    color: #c57907;
}

.mq-chip.bad {
    background: #fff1f2;
    color: #c63445;
}

.mq-panel-soft {
    border: 1px solid #dce8f7;
    border-radius: 16px;
    background: linear-gradient(145deg, #f8fbff, #f0f6ff);
    padding: 14px;
}

.mq-quick-action {
    border: 1px solid #d9e6f8;
    border-radius: 14px;
    background: #ffffff;
    padding: 12px;
    text-decoration: none;
    color: #123768;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mq-quick-action:hover {
    background: #f4f9ff;
    color: #0f3e7f;
}

.mq-loading {
    position: relative;
    color: transparent !important;
    border-radius: 8px;
    overflow: hidden;
}

.mq-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(222, 233, 248, 0.35) 20%, rgba(250, 252, 255, 0.9) 50%, rgba(222, 233, 248, 0.35) 80%);
    animation: mq-shimmer 1.4s infinite;
}

.mq-fade-in {
    animation: mq-fade-up 0.35s ease both;
}

.mq-meta {
    font-size: 0.78rem;
    color: #66768b;
}

.mq-inline-sep {
    display: inline-block;
    margin-inline: 8px;
    color: #9aa9bd;
}

@keyframes mq-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Auth pages */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: radial-gradient(circle at 20% 18%, rgba(37, 98, 196, 0.35), transparent 40%), radial-gradient(circle at 80% 75%, rgba(20, 160, 122, 0.28), transparent 35%), #091a32;
}

.auth-side {
    padding: 60px clamp(22px, 5vw, 72px);
    color: #e7f1ff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-side h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #fff;
    margin-bottom: 12px;
}

.auth-side p {
    color: #c6ddff;
    max-width: 520px;
}

.auth-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.auth-badge {
    border-radius: 999px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: #e9f3ff;
}

.auth-panel {
    background: rgba(255, 255, 255, 0.98);
    margin: 24px;
    border-radius: 26px;
    border: 1px solid #dce6f5;
    box-shadow: 0 28px 56px rgba(7, 24, 50, 0.34);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(22px, 3.8vw, 44px);
}

.auth-card-logo {
    width: 72px;
    margin-bottom: 14px;
}

.auth-panel h2 {
    margin-bottom: 4px;
    color: #102a4e;
}

.auth-panel .subtext {
    color: #677788;
    margin-bottom: 20px;
}

.auth-panel input,
.auth-panel .btn {
    min-height: 48px;
}

.auth-panel .btn-primary {
    color: #fff;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 16px 0;
    color: #7c8899;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #d8e1ef;
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-alt-links {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.auth-link-btn {
    text-decoration: none;
    border: 1px solid #d7e3f3;
    color: #214477;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
    width: 100%;
    font-weight: 600;
}

.auth-link-btn:hover {
    background: #eef5ff;
    color: #123869;
}

.auth-legal {
    margin-top: 14px;
    text-align: center;
    color: #73859b;
    font-size: 0.82rem;
}

.auth-legal a {
    color: #123e85;
}

@media (max-width: 1080px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-side {
        padding-bottom: 20px;
    }

    .auth-panel {
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .app-menu {
        left: -300px;
        transition: left 0.25s ease;
    }

    body.sidebar-collapsed .app-menu {
        left: 0;
        width: 300px;
    }

    .navbar-custom,
    body.sidebar-collapsed .navbar-custom,
    .content-page,
    body.sidebar-collapsed .content-page {
        left: 0;
        width: 100%;
        margin-left: 0;
    }

    .content {
        padding-inline: 14px;
    }

    .mq-grid-3 {
        grid-template-columns: 1fr;
    }
}

@supports not (height: 100dvh) {
    .app-menu {
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
    }

    html[data-layout-mode=detached] body #wrapper .app-menu {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .card,
    .mq-hero,
    .menu-link,
    .btn {
        animation: mq-fade-up 0.45s ease both;
    }

    @keyframes mq-fade-up {
        from {
            opacity: 0;
            transform: translateY(8px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

