/* Flow Nexus UI Theme */
:root {
    --app-font-body: "Manrope", "Space Grotesk", "Trebuchet MS", sans-serif;
    --app-font-display: "Space Grotesk", "Manrope", "Trebuchet MS", sans-serif;
    --app-bg: #f7f2ea;
    --app-bg-deep: #f1ebe3;
    --app-surface: #ffffff;
    --app-surface-muted: #f7f5f1;
    --app-ink: #162031;
    --app-ink-soft: #4f5c6c;
    --app-border: #e2d9cc;
    --app-accent: #ff7a59;
    --app-accent-2: #22b4a5;
    --app-accent-3: #22355a;
    --app-shadow: 0 22px 48px rgba(22, 32, 49, 0.12);
    --app-shadow-soft: 0 10px 24px rgba(22, 32, 49, 0.08);
    --app-radius: 22px;
    --app-radius-sm: 14px;
}

body.flow-shell {
    font-family: var(--app-font-body);
    background: var(--app-bg);
    color: var(--app-ink);
}

body.flow-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background: radial-gradient(circle at 10% 20%, rgba(255, 215, 184, 0.45), transparent 45%),
        radial-gradient(circle at 80% 10%, rgba(176, 214, 255, 0.45), transparent 42%),
        radial-gradient(circle at 20% 80%, rgba(196, 255, 239, 0.5), transparent 48%);
}

body.flow-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(248, 242, 233, 0.9) 100%);
}

body.flow-shell {
    --bs-primary: var(--app-accent);
    --bs-secondary: var(--app-accent-2);
    --bs-success: #2e7d32;
    --bs-warning: #f59e0b;
    --bs-danger: #e24f40;
    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--app-ink);
    --bs-link-color: var(--app-accent-2);
    --bs-border-color: var(--app-border);
}

h1,
h2,
h3,
h4,
h5,
h6,
.flow-title,
.flow-panel-title,
.flow-value {
    font-family: var(--app-font-display);
    letter-spacing: -0.02em;
}

#main-wrapper {
    background: transparent;
}

.page-wrapper {
    padding: 20px 28px 32px;
}

.body-wrapper {
    padding: 8px 0 32px;
}

.card {
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
}

.card-body {
    padding: 22px 24px;
}

.table {
    color: var(--app-ink);
}

.table thead th {
    color: var(--app-ink-soft);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.table tbody tr {
    border-color: var(--app-border);
}

.form-control,
.form-select {
    border-radius: 14px;
    border: 1px solid var(--app-border);
    background: #fffaf4;
    color: var(--app-ink);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(255, 122, 89, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 89, 0.2);
}

.btn {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.55rem 1.35rem;
}

.btn-primary {
    background: var(--app-accent);
    border-color: var(--app-accent);
    box-shadow: 0 12px 22px rgba(255, 122, 89, 0.35);
}

.btn-outline-primary {
    border-color: rgba(255, 122, 89, 0.6);
    color: var(--app-accent);
}

.btn-outline-secondary {
    border-color: rgba(34, 180, 165, 0.55);
    color: var(--app-accent-2);
}

.btn-dark {
    background: var(--app-accent-3);
    border-color: var(--app-accent-3);
    box-shadow: 0 12px 24px rgba(34, 53, 90, 0.3);
}

.text-muted {
    color: var(--app-ink-soft) !important;
}

.text-bg-light {
    background: #fff7ef !important;
    color: #4e5c6b !important;
}

.topbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 217, 204, 0.8);
    box-shadow: 0 8px 18px rgba(22, 32, 49, 0.06);
}

.topbar .navbar {
    padding: 14px 28px;
}

.left-sidebar {
    background: linear-gradient(160deg, #0f172a 0%, #13233c 55%, #1b2f4f 100%);
    border-right: 1px solid rgba(15, 23, 42, 0.3);
    color: #d3dceb;
    z-index: 1040;
    pointer-events: auto;
}

.left-sidebar .brand-logo {
    padding: 24px 22px 10px;
}

.left-sidebar .brand-logo .logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-text {
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
    font-family: var(--app-font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff3e8;
    text-transform: none;
}

.brand-text span:first-child {
    font-size: 20px;
}

.brand-text .brand-subtitle {
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.brand-text--compact span:first-child {
    font-size: 18px;
}

.brand-text--compact .brand-subtitle {
    font-size: 10px;
}

.brand-text--auth {
    color: var(--app-ink);
}

.brand-text--auth .brand-subtitle {
    color: rgba(34, 53, 90, 0.7);
}

.left-sidebar .sidebar-nav {
    padding: 8px 14px 20px;
}

.left-sidebar .sidebar-nav ul .sidebar-item {
    margin-bottom: 6px;
}

.left-sidebar .sidebar-link {
    border-radius: 12px;
    padding: 12px 14px;
    color: #c6d3e8;
    font-weight: 500;
    transition: all 0.25s ease;
}

.left-sidebar .sidebar-link-logout {
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
}

.left-sidebar .sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 122, 89, 0.18);
    transform: translateX(2px);
}

.left-sidebar .sidebar-item.is-active .sidebar-link,
.left-sidebar .sidebar-item.active .sidebar-link {
    color: #ffffff;
    background: linear-gradient(120deg, rgba(255, 122, 89, 0.9), rgba(255, 163, 109, 0.9));
    box-shadow: 0 10px 24px rgba(255, 122, 89, 0.35);
}

.left-sidebar .sidebar-item.is-active .ti,
.left-sidebar .sidebar-item.active .ti {
    color: #ffffff;
}

.left-sidebar .custom-nav-small-cap {
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.left-sidebar .nav-small-cap {
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
}

.left-sidebar .fixed-profile {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e4ebf7;
    box-shadow: none;
}

.left-sidebar .fixed-profile .fs-2 {
    color: rgba(255, 255, 255, 0.65);
}

.breadcrumb-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(255, 246, 236, 0.9), rgba(246, 250, 255, 0.95));
    border: 1px solid rgba(226, 217, 204, 0.9);
    border-radius: 20px;
    box-shadow: var(--app-shadow-soft);
}

.breadcrumb-shell .breadcrumb {
    margin-bottom: 0;
    font-size: 13px;
}

.breadcrumb-shell-title {
    font-size: 22px;
    font-weight: 700;
}

.flow-analytics {
    --flow-ink: var(--app-ink);
    --flow-ink-soft: var(--app-ink-soft);
    --flow-accent: var(--app-accent-2);
    --flow-accent-strong: var(--app-accent-3);
    --flow-accent-warm: var(--app-accent);
    --flow-surface: var(--app-surface-muted);
    --flow-border: var(--app-border);
    --flow-grid: rgba(22, 32, 49, 0.08);
}

.flow-hero {
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 233, 0.95));
    border: 1px solid rgba(255, 122, 89, 0.2);
    box-shadow: var(--app-shadow);
    overflow: hidden;
}

.flow-hero::before {
    background: radial-gradient(circle at top right, rgba(255, 122, 89, 0.2), transparent 55%),
        radial-gradient(circle at bottom left, rgba(34, 180, 165, 0.2), transparent 50%);
}

.flow-hero-panel {
    background: rgba(34, 53, 90, 0.9);
    color: #f8fbff;
    border: none;
    box-shadow: 0 18px 35px rgba(34, 53, 90, 0.35);
}

.flow-range-group .btn {
    border-color: rgba(255, 255, 255, 0.3);
    color: #f8fbff;
}

.flow-range-group .btn.btn-light {
    background: #ffffff;
    color: #1f2b3f;
}

.flow-stat {
    border: 1px solid rgba(255, 122, 89, 0.16);
}

.flow-icon {
    color: var(--app-accent-2);
}

.flow-chart {
    background: linear-gradient(180deg, #ffffff 0%, #f7f5f1 100%);
    border-radius: 16px;
}

.flow-filter-bar,
.flow-filter,
.flow-list-item,
.flow-pill,
.flow-split {
    background: #fffaf4;
}

.flow-table td,
.flow-table th {
    border-color: var(--app-border);
}

.flow-kicker {
    color: rgba(34, 53, 90, 0.7);
    font-weight: 600;
}

.flow-chip {
    background: rgba(34, 180, 165, 0.12);
    color: #136c63;
    border: 1px solid rgba(34, 180, 165, 0.2);
}

.app-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-section-title span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--app-ink-soft);
}

.profile-hero {
    background: linear-gradient(135deg, rgba(34, 180, 165, 0.12), rgba(255, 122, 89, 0.12));
    border: 1px dashed rgba(34, 180, 165, 0.4);
    padding: 24px;
    border-radius: 20px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: rgba(34, 180, 165, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #1f7f73;
}

.setting-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid var(--app-border);
    padding: 20px;
    box-shadow: var(--app-shadow-soft);
}

.setting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.health-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--app-border);
    padding: 20px;
    box-shadow: var(--app-shadow-soft);
}

.health-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: #fff8f0;
    border: 1px solid rgba(255, 122, 89, 0.15);
}

.health-bar {
    height: 8px;
    border-radius: 999px;
    background: #f0e7db;
    overflow: hidden;
}

.health-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, rgba(34, 180, 165, 0.8), rgba(255, 122, 89, 0.9));
}

.kpi-card {
    background: linear-gradient(140deg, #ffffff, #fff4ea);
    border-radius: 18px;
    border: 1px solid rgba(255, 122, 89, 0.22);
    padding: 18px 20px;
    box-shadow: var(--app-shadow-soft);
}

.page-fade {
    animation: page-fade 0.6s ease both;
}

.system-auth-shell {
    background: radial-gradient(circle at top right, rgba(255, 210, 175, 0.45), transparent 45%),
        radial-gradient(circle at bottom left, rgba(179, 224, 255, 0.45), transparent 50%),
        linear-gradient(135deg, #fff6ec 0%, #f4f7ff 100%);
}

.system-auth-card {
    border-radius: 26px;
    border: 1px solid rgba(255, 122, 89, 0.18);
    box-shadow: var(--app-shadow);
    background: rgba(255, 255, 255, 0.94);
}

.system-auth-aside {
    background: linear-gradient(160deg, rgba(255, 242, 231, 0.95), rgba(243, 248, 255, 0.98));
}

.system-auth-highlights div {
    background: #fffaf4;
    border: 1px solid rgba(255, 122, 89, 0.16);
}

.system-auth-form input {
    border-radius: 14px;
    border: 1px solid rgba(255, 122, 89, 0.18);
    background: #fffaf4;
}

.system-auth-form input:focus {
    border-color: rgba(255, 122, 89, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 89, 0.2);
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
}

.login-card {
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-radius: 26px;
    border: 1px solid rgba(255, 122, 89, 0.2);
    box-shadow: var(--app-shadow);
    background: rgba(255, 255, 255, 0.92);
    padding: 32px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-form-fields {
    display: grid;
    gap: 18px;
}

.login-field label {
    font-weight: 600;
    color: var(--app-ink);
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 122, 89, 0.2);
    background: #fffaf4;
    padding: 12px 14px;
    color: var(--app-ink);
}

.login-field input::placeholder {
    color: rgba(79, 92, 108, 0.6);
}

.login-field input:focus {
    border-color: rgba(255, 122, 89, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 89, 0.18);
    outline: none;
}

.login-password {
    position: relative;
    display: flex;
    align-items: center;
}

.login-password input {
    padding-right: 46px;
}

.login-toggle {
    position: absolute;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--app-ink-soft);
    cursor: pointer;
    font-size: 18px;
}

.login-toggle:hover {
    color: var(--app-accent);
}

.login-actions {
    display: grid;
    gap: 14px;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--app-ink-soft);
    white-space: nowrap;
}

@keyframes page-fade {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991px) {
    .page-wrapper {
        padding: 18px 18px 24px;
    }

    .topbar .navbar {
        padding: 12px 18px;
    }
}
