/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #081426;
    --surface: #12233b;
    --surface-soft: #172b46;

    --text: #edf4ff;
    --text-secondary: #b1c1d8;
    --text-muted: #8498b5;

    --border: #263b58;

    --primary: #3979e8;
    --primary-hover: #2865cd;

    --green: #16a34a;
    --orange: #f59e0b;
    --red: #ef4444;
    --blue: #3b82f6;
    --purple: #8b5cf6;

    --sidebar-width: 270px;

    --shadow-sm:
        0 5px 18px rgba(0, 0, 0, 0.16);

    --shadow:
        0 14px 35px rgba(0, 0, 0, 0.25);

    --radius: 18px;

    --transition:
        0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        "Plus Jakarta Sans",
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);

    min-height: 100vh;

    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

input,
textarea,
select {
    outline: none;
}

.hidden {
    display: none !important;
}


/* =========================================================
   LOGIN
========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(139, 92, 246, 0.15),
            transparent 35%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(59, 130, 246, 0.12),
            transparent 35%
        ),
        #f8fafc;
}

.login-background {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-grid {
    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(
            rgba(15, 23, 42, 0.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(15, 23, 42, 0.035) 1px,
            transparent 1px
        );

    background-size: 45px 45px;
}

.login-orb {
    position: absolute;

    width: 400px;
    height: 400px;

    border-radius: 50%;

    filter: blur(70px);

    opacity: 0.55;

    animation:
        floatOrb 10s ease-in-out infinite;
}

.orb-1 {
    background: rgba(139, 92, 246, 0.2);
    top: -180px;
    left: -150px;
}

.orb-2 {
    background: rgba(59, 130, 246, 0.18);
    right: -150px;
    bottom: -180px;

    animation-delay: -5s;
}

@keyframes floatOrb {

    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(35px, -25px, 0);
    }
}

.login-wrapper {
    width: 100%;
    max-width: 430px;

    position: relative;
    z-index: 2;

    padding: 30px 20px;

    animation:
        loginEnter 0.7s ease both;
}

.login-brand {
    animation: loginContentEnter 0.55s 0.12s ease both;
}

.login-card {
    transform-origin: center;
    animation: loginCardEnter 0.65s 0.18s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.login-card .form-group {
    animation: loginContentEnter 0.45s ease both;
}

.login-card .form-group:nth-child(1) {
    animation-delay: 0.28s;
}

.login-card .form-group:nth-child(2) {
    animation-delay: 0.36s;
}

.login-options,
.btn-login {
    animation: loginContentEnter 0.45s 0.42s ease both;
}

@keyframes loginEnter {

    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginContentEnter {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginCardEnter {

    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    margin-bottom: 25px;
}

.brand-mark {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #111827,
            #334155
        );

    box-shadow:
        0 10px 25px rgba(15, 23, 42, 0.2);
}

.brand-mark i {
    font-size: 23px;
}

.brand-mark.small {
    width: 40px;
    height: 40px;

    border-radius: 11px;
}

.brand-mark.small i {
    font-size: 19px;
}

.brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.brand-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.login-card {
    background: rgba(255, 255, 255, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.8);

    border-radius: 24px;

    padding: 35px;

    box-shadow:
        0 25px 80px rgba(15, 23, 42, 0.12);

    backdrop-filter: blur(20px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    width: 52px;
    height: 52px;

    margin: 0 auto 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background: #f1f5f9;
    color: #111827;
}

.login-icon i {
    font-size: 20px;
}

.login-header h1 {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;

    margin-top: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    font-size: 12px;
    font-weight: 700;

    margin-bottom: 8px;

    color: #334155;
}

.form-group label span {
    color: var(--red);
}

.input-wrapper {
    position: relative;
}

.input-wrapper > i {
    position: absolute;

    left: 15px;
    top: 50%;

    transform: translateY(-50%);

    color: #94a3b8;

    font-size: 14px;

    pointer-events: none;
}

.input-wrapper input {
    width: 100%;

    height: 50px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: #ffffff;

    padding:
        0 45px
        0 43px;

    font-size: 13px;

    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: #94a3b8;

    box-shadow:
        0 0 0 4px rgba(15, 23, 42, 0.05);
}

.password-toggle {
    position: absolute;

    right: 5px;
    top: 5px;

    width: 40px;
    height: 40px;

    border: 0;
    background: transparent;

    color: #94a3b8;

    border-radius: 9px;
}

.password-toggle:hover {
    background: #f1f5f9;
    color: #334155;
}

.field-error {
    display: block;

    color: var(--red);

    font-size: 11px;

    margin-top: 6px;

    min-height: 0;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 12px;
    color: var(--text-secondary);

    cursor: pointer;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
}

.custom-checkbox {
    width: 17px;
    height: 17px;

    border: 1px solid #cbd5e1;
    border-radius: 5px;

    background: #ffffff;

    position: relative;

    transition: var(--transition);
}

.checkbox-label input:checked + .custom-checkbox {
    background: #111827;
    border-color: #111827;
}

.checkbox-label input:checked + .custom-checkbox::after {
    content: "";

    position: absolute;

    left: 5px;
    top: 2px;

    width: 4px;
    height: 8px;

    border:
        solid #ffffff;

    border-width:
        0 2px 2px 0;

    transform: rotate(45deg);
}

.btn {
    min-height: 46px;

    border-radius: 11px;

    padding:
        0 18px;

    border: 1px solid transparent;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 9px;

    font-size: 12px;
    font-weight: 700;

    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);

    transform: translateY(-1px);

    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.16);
}

.btn-secondary {
    background: #ffffff;
    color: #334155;

    border-color: var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-login {
    width: 100%;
    height: 50px;
}

.button-loading {
    display: none;
}

.is-loading .button-text {
    display: none;
}

.is-loading .button-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.demo-login {
    margin-top: 25px;
    padding-top: 22px;

    border-top: 1px solid var(--border);
}

.demo-title {
    text-align: center;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 1px;

    margin-bottom: 12px;
}

.demo-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;
}

.demo-button {
    border: 1px solid var(--border);

    background: #ffffff;

    border-radius: 12px;

    padding: 10px;

    display: flex;
    align-items: center;

    gap: 9px;

    text-align: left;

    transition: var(--transition);
}

.demo-button:hover {
    border-color: #cbd5e1;
    background: #f8fafc;

    transform: translateY(-2px);
}

.demo-button strong {
    display: block;

    font-size: 11px;
}

.demo-button small {
    display: block;

    color: var(--text-muted);

    font-size: 9px;

    margin-top: 2px;
}

.demo-avatar {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    color: #ffffff;

    font-size: 11px;
    font-weight: 800;
}

.avatar-a {
    background: #6366f1;
}

.avatar-b {
    background: #0ea5e9;
}

.login-footer {
    text-align: center;

    color: #94a3b8;

    font-size: 10px;

    margin-top: 18px;
}

.login-footer span {
    padding: 0 5px;
}


/* =========================================================
   APPLICATION LAYOUT
========================================================= */

.app-page {
    min-height: 100vh;

    display: flex;

    position: relative;
    isolation: isolate;
}

.app-page.dashboard-active::before,
.app-page.dashboard-active::after {
    content: "";
    position: fixed;
    z-index: 0;
    width: min(36vw, 460px);
    aspect-ratio: 1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(68px);
    opacity: 0.42;
    will-change: transform;
}

.app-page.dashboard-active::before {
    top: 4vh;
    right: 4vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.48), rgba(59, 130, 246, 0));
    animation: dashboardGlowDrift 19s ease-in-out infinite alternate;
}

.app-page.dashboard-active::after {
    left: 18vw;
    bottom: -22vh;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.34), rgba(139, 92, 246, 0));
    animation: dashboardGlowDrift 24s -7s ease-in-out infinite alternate-reverse;
}

@keyframes dashboardGlowDrift {

    from {
        transform: translate3d(-3vw, -2vh, 0) scale(0.84);
    }

    to {
        transform: translate3d(3vw, 3vh, 0) scale(1.16);
    }
}

.sidebar {
    width: var(--sidebar-width);

    background: #ffffff;

    border-right: 1px solid var(--border);

    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    z-index: 100;

    display: flex;
    flex-direction: column;

    transition:
        transform var(--transition);
}

.sidebar-header {
    height: 75px;

    display: flex;
    align-items: center;

    justify-content: space-between;

    padding: 0 20px;

    border-bottom: 1px solid #f1f5f9;
}

.sidebar-brand {
    display: flex;
    align-items: center;

    gap: 10px;
}

.sidebar-brand-text strong {
    display: block;

    font-size: 13px;
    font-weight: 800;
}

.sidebar-brand-text span {
    display: block;

    color: var(--text-muted);

    font-size: 9px;

    margin-top: 2px;
}

.sidebar-close {
    display: none;

    width: 34px;
    height: 34px;

    border: 0;

    background: #f8fafc;

    border-radius: 9px;

    color: #64748b;
}

.sidebar-user {
    margin: 18px 15px;

    padding: 13px;

    background: #f8fafc;

    border: 1px solid #f1f5f9;

    border-radius: 14px;

    display: flex;
    align-items: center;

    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;

    border-radius: 11px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #111827,
            #475569
        );

    font-size: 12px;
    font-weight: 800;

    flex-shrink: 0;
}

.user-avatar.small {
    width: 34px;
    height: 34px;

    border-radius: 10px;

    font-size: 11px;
}

.sidebar-user-info {
    min-width: 0;

    flex: 1;
}

.sidebar-user-info strong {
    display: block;

    font-size: 11px;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    display: block;

    color: var(--text-muted);

    font-size: 9px;

    margin-top: 2px;
}

.online-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #22c55e;

    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.08);
}

.sidebar-nav {
    flex: 1;

    overflow-y: auto;

    padding: 5px 12px;
}

.nav-section-title {
    color: #a1aab8;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.9px;

    padding:
        18px 12px 8px;
}

.nav-item {
    width: 100%;

    border: 0;

    background: transparent;

    color: #64748b;

    border-radius: 10px;

    min-height: 42px;

    padding: 0 12px;

    display: flex;
    align-items: center;

    gap: 11px;

    font-size: 11px;
    font-weight: 600;

    text-align: left;

    transition:
        color var(--transition),
        background var(--transition),
        transform var(--transition),
        box-shadow var(--transition);

    position: relative;
}

.nav-item:hover {
    color: #111827;
    background: #f8fafc;
    transform: translateX(3px);
}

.nav-item:active {
    transform: translateX(2px) scale(0.98);
}

.nav-item.active {
    color: #111827;

    background: #f1f5f9;

    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.nav-item.active::before {
    content: "";

    position: absolute;

    left: 0;

    top: 11px;
    bottom: 11px;

    width: 3px;

    border-radius: 0 4px 4px 0;

    background: #111827;
    box-shadow: 0 0 12px rgba(104, 162, 255, 0.35);
    animation: navIndicatorEnter 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes navIndicatorEnter {

    from {
        opacity: 0;
        transform: scaleY(0.2);
    }

    72% {
        opacity: 1;
        transform: scaleY(1.14);
    }

    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

.nav-icon {
    width: 20px;

    display: flex;
    justify-content: center;

    font-size: 13px;
}

.nav-badge {
    margin-left: auto;

    min-width: 20px;
    height: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #e2e8f0;

    color: #475569;

    border-radius: 6px;

    font-size: 9px;
}

.sidebar-bottom {
    padding: 15px;

    border-top: 1px solid #f1f5f9;
}

.local-mode {
    display: flex;
    align-items: center;

    gap: 9px;

    padding: 10px;

    background: #f8fafc;

    border-radius: 10px;

    margin-bottom: 10px;
}

.local-dot {
    width: 7px;
    height: 7px;

    background: #22c55e;

    border-radius: 50%;
}

.local-mode strong {
    display: block;

    font-size: 8px;

    letter-spacing: 0.7px;
}

.local-mode small {
    display: block;

    color: #94a3b8;

    font-size: 8px;

    margin-top: 2px;
}

.logout-button {
    width: 100%;

    height: 40px;

    background: transparent;

    border: 1px solid var(--border);

    color: #64748b;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    font-size: 10px;
    font-weight: 700;

    transition: var(--transition);
}

.logout-button:hover {
    color: var(--red);

    border-color: #fecaca;

    background: #fef2f2;
}

.main-area {
    margin-left: var(--sidebar-width);

    min-width: 0;

    flex: 1;

    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.topbar {
    height: 75px;

    background: rgba(255, 255, 255, 0.9);

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding:
        0 30px;

    position: sticky;

    top: 0;

    z-index: 50;

    backdrop-filter: blur(15px);
}

.topbar-left {
    display: flex;
    align-items: center;

    gap: 15px;
}

.hamburger-btn {
    display: none;

    width: 38px;
    height: 38px;

    border: 1px solid var(--border);

    background: #ffffff;

    border-radius: 10px;

    color: #475569;
}

.page-title {
    font-size: 15px;
    font-weight: 800;
}

.page-subtitle {
    font-size: 10px;

    color: var(--text-muted);

    margin-top: 3px;
}

.topbar-user {
    display: flex;
    align-items: center;

    gap: 9px;
}

.topbar-user-info strong {
    display: block;

    font-size: 10px;
}

.topbar-user-info span {
    display: block;

    font-size: 8px;

    color: var(--text-muted);

    margin-top: 2px;
}

.page-content {
    padding: 30px;

    max-width: 1600px;

    margin: 0 auto;
}

.page-view {
    display: none;

    animation:
        viewEnter 0.46s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.page-view.active {
    display: block;
}

@keyframes viewEnter {

    from {
        opacity: 0;
        transform: translate3d(0, 16px, 0) scale(0.985);
        filter: blur(6px);
    }

    68% {
        opacity: 1;
        transform: translate3d(0, -2px, 0) scale(1.002);
        filter: blur(0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

.app-page.is-entering {
    animation: appReveal 0.55s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes appReveal {

    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


