:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --cyan: #06b6d4;
    --purple: #8b5cf6;
    --purple-light: #a78bfa;
    --emerald: #10b981;
    --emerald-light: #34d399;
    --rose: #f43f5e;
    --rose-light: #fb7185;
    --amber: #f59e0b;
    --amber-light: #fbbf24;
    --font-jakarta: 'Plus Jakarta Sans', sans-serif;
    --sidebar-width: 272px;
    --sidebar-collapsed: 80px;
    --navbar-height: 68px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --safe-top: env(safe-area-inset-top, 0);
}

[data-theme="dark"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --bg-card-solid: #111827;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.08);
    --border-hover: rgba(148, 163, 184, 0.2);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #3b82f6, #06b6d4);
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #f43f5e, #f59e0b);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #ec4899);
    --gradient-risk: linear-gradient(135deg, #f59e0b 0%, #f43f5e 50%, #8b5cf6 100%);
}

[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: rgba(241, 245, 249, 0.92);
    --bg-card-solid: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.18);
    --border-hover: rgba(148, 163, 184, 0.35);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
    --gradient-primary: linear-gradient(135deg, #3b82f6, #06b6d4);
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #f43f5e, #f59e0b);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #ec4899);
    --gradient-risk: linear-gradient(135deg, #f59e0b 0%, #f43f5e 50%, #8b5cf6 100%);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-jakarta);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    transition: background 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}

body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

input,
select,
textarea {
    font-family: inherit;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-height: 100dvh;
    transition: margin-left var(--transition-normal);
    min-width: 0;
    width: 100%;
}

.main-content.collapsed {
    margin-left: var(--sidebar-collapsed);
}

.page-content {
    padding: 24px;
    padding-top: calc(var(--navbar-height) + 24px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 100%;
    overflow-x: hidden;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--bg-card-solid);
    border-right: 1px solid var(--border-color);
    z-index: 50;
    transition: width var(--transition-normal), transform var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    height: var(--navbar-height);
    flex-shrink: 0;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    animation: shimmer 3s ease infinite;
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity var(--transition-normal), width var(--transition-normal);
    min-width: 0;
}

.sidebar.collapsed .sidebar-brand {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.sidebar-brand h1 {
    font-size: 18px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.sidebar-brand span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-normal);
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
    margin-bottom: 2px;
    width: 100%;
    text-align: left;
    min-height: 44px;
}

.nav-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.nav-link i,
.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-link .nav-text {
    overflow: hidden;
    transition: opacity var(--transition-normal), width var(--transition-normal);
}

.sidebar.collapsed .nav-link .nav-text,
.sidebar.collapsed .nav-link .nav-badge,
.sidebar.collapsed .nav-link .nav-arrow {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    color: #fff;
    flex-shrink: 0;
}

.nav-badge.red {
    background: var(--rose);
}

.nav-badge.green {
    background: var(--emerald);
}

.nav-badge.blue {
    background: var(--primary);
}

.nav-badge.purple {
    background: var(--purple);
}

.nav-arrow {
    margin-left: auto;
    width: 16px !important;
    height: 16px !important;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.nav-link.expanded .nav-arrow {
    transform: rotate(90deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    padding-left: 8px;
}

.nav-submenu.open {
    max-height: 300px;
}

.nav-submenu .nav-link {
    padding: 8px 12px 8px 36px;
    font-size: 13px;
    min-height: 40px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    background: var(--bg-card-hover);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    text-align: left;
}

.sidebar-user:hover {
    background: var(--gradient-primary);
}

.sidebar-user:hover .u-name,
.sidebar-user:hover .u-role {
    color: #fff;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-info {
    overflow: hidden;
    transition: opacity var(--transition-normal);
    min-width: 0;
}

.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
}

.u-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.u-role {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--navbar-height);
    background: var(--bg-card-solid);
    border-bottom: 1px solid var(--border-color);
    z-index: 40;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    transition: left var(--transition-normal);
}

.navbar.collapsed {
    left: var(--sidebar-collapsed);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.nav-icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.nav-icon-btn .dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rose);
    border: 2px solid var(--bg-card-solid);
}

.mobile-toggle {
    display: none;
}

.navbar-search {
    position: relative;
    width: 300px;
    max-width: 100%;
}

.navbar-search input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card-hover);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.navbar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.navbar-search .s-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.navbar-search .s-key {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card-solid);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    pointer-events: none;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--amber);
    border-color: var(--border-hover);
}

[data-theme="dark"] .icon-sun {
    display: block;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: block;
}

.live-ticker {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald);
    position: relative;
    flex-shrink: 0;
    display: inline-block;
}

.live-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--emerald);
    opacity: 0.4;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 0;
        transform: scale(1.8);
    }
}

.navbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.navbar-profile:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.navbar-profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}

.navbar-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.np-info-text {
    text-align: left;
    min-width: 0;
}

.np-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
}

.np-role {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all var(--transition-normal);
    z-index: 200;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dd-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dd-body {
    padding: 8px;
    max-height: 340px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
}

.dd-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.dd-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.dd-footer a {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notif-item:hover {
    background: var(--bg-card-hover);
}

.notif-item.unread {
    background: rgba(59, 130, 246, 0.04);
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notif-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all var(--transition-normal);
    min-width: 0;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
}

.card-pad {
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header>div:first-child {
    min-width: 0;
    flex: 1;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-left {
    min-width: 0;
    flex: 1;
}

.page-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.page-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb i {
    width: 12px;
    height: 12px;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* RISK HERO */
.risk-hero {
    background: var(--gradient-risk);
    border-radius: 24px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.risk-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.risk-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 40%;
    height: 160%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.rh-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    align-items: center;
}

.rh-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.rh-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 12px;
}

.rh-desc {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 22px;
    max-width: 520px;
}

.rh-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.rh-stat-item {}

.rh-stat-lbl {
    font-size: 11px;
    opacity: 0.85;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rh-stat-val {
    font-size: 22px;
    font-weight: 800;
}

.rh-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* RISK SCORE CIRCLE */
.risk-score-wrap {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto;
}

.risk-score-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.rsc-lbl {
    font-size: 11px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.rsc-num {
    font-size: 68px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 4px;
}

.rsc-status {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    min-width: 0;
    opacity: 1 !important;
    visibility: visible !important;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.c-blue::before {
    background: var(--gradient-primary);
}

.stat-card.c-green::before {
    background: var(--gradient-success);
}

.stat-card.c-amber::before {
    background: linear-gradient(135deg, var(--amber), var(--amber-light));
}

.stat-card.c-rose::before {
    background: var(--gradient-danger);
}

.stat-card.c-purple::before {
    background: var(--gradient-purple);
}

.sc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sc-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sc-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
    word-break: break-word;
}

.sc-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}

.sc-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    flex-wrap: wrap;
}

.sc-trend.up {
    color: var(--emerald);
}

.sc-trend.down {
    color: var(--rose);
}

/* TABS */
.tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px;
    font-family: var(--font-jakarta);
}

.tab-btn * {
    pointer-events: none;
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-count {
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--bg-card-hover);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
}

.tab-btn.active .tab-count {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeSlide 0.3s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card-hover);
    padding: 4px;
    border-radius: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.chart-tabs::-webkit-scrollbar {
    display: none;
}

.chart-tab {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    font-family: var(--font-jakarta);
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    background: transparent;
}

.chart-tab:hover {
    color: var(--text-primary);
}

.chart-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-jakarta);
    transition: all var(--transition-fast);
    outline: none;
    overflow: hidden;
    white-space: nowrap;
    min-height: 44px;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
}

.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
    min-height: 32px;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.3);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-light);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-light);
}

.badge-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose-light);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber-light);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple-light);
}

/* RISK LEVEL BAR */
.risk-level-card {
    padding: 20px;
    border-radius: 14px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
}

.rlc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.rlc-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rlc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rlc-icon i {
    width: 18px;
    height: 18px;
}

.rlc-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.rlc-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.rlc-value {
    font-size: 20px;
    font-weight: 800;
    text-align: right;
}

.rlc-value.low {
    color: var(--emerald);
}

.rlc-value.medium {
    color: var(--amber);
}

.rlc-value.high {
    color: var(--rose);
}

.rlc-value.extreme {
    color: #dc2626;
}

.risk-bar {
    height: 14px;
    background: linear-gradient(90deg, #10b981 0%, #34d399 25%, #f59e0b 50%, #f43f5e 75%, #dc2626 100%);
    border-radius: 7px;
    position: relative;
    overflow: visible;
}

.risk-bar-marker {
    position: absolute;
    top: -6px;
    width: 4px;
    height: 26px;
    background: #fff;
    border: 2px solid var(--bg-card-solid);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%);
    transition: left 1s ease;
}

.risk-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* KPI TILE */
.kpi-tile {
    padding: 20px;
    border-radius: 14px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.kpi-tile:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
}

.kpi-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-tile-icon i {
    width: 20px;
    height: 20px;
}

.kpi-tile-lbl {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.kpi-tile-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
}

.kpi-tile-val.up {
    color: var(--emerald);
}

.kpi-tile-val.down {
    color: var(--rose);
}

.kpi-tile-val.warning {
    color: var(--amber);
}

.kpi-tile-sub {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-tile-sub.up {
    color: var(--emerald);
}

.kpi-tile-sub.down {
    color: var(--rose);
}

/* METRIC ROW */
.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon i {
    width: 18px;
    height: 18px;
}

.metric-info {
    min-width: 0;
}

.metric-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.metric-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.metric-right {
    text-align: right;
    flex-shrink: 0;
}

.metric-val {
    font-size: 15px;
    font-weight: 800;
}

.metric-val.up {
    color: var(--emerald);
}

.metric-val.down {
    color: var(--rose);
}

.metric-val.warning {
    color: var(--amber);
}

.metric-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ALERT CARD */
.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.alert-item.warning {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.25);
}

.alert-item.danger {
    background: rgba(244, 63, 94, 0.05);
    border-color: rgba(244, 63, 94, 0.25);
}

.alert-item.info {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.25);
}

.alert-item.success {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.25);
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon i {
    width: 20px;
    height: 20px;
}

.alert-item.warning .alert-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
}

.alert-item.danger .alert-icon {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
}

.alert-item.info .alert-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.alert-item.success .alert-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.alert-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.alert-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.alert-action {
    flex-shrink: 0;
}

/* TABLE */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    min-width: 800px;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.crypto-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crypto-cell-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-card-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crypto-cell-icon img {
    width: 22px;
    height: 22px;
}

.c-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 13px;
}

/* RISK LEVEL PILL */
.risk-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-pill.low {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
}

.risk-pill.medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
}

.risk-pill.high {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
}

.risk-pill.extreme {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

/* EXPOSURE BAR */
.exposure-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.exposure-track {
    flex: 1;
    height: 6px;
    background: var(--bg-card-hover);
    border-radius: 3px;
    overflow: hidden;
}

.exposure-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.exposure-fill.low {
    background: var(--gradient-success);
}

.exposure-fill.medium {
    background: linear-gradient(135deg, var(--amber), var(--amber-light));
}

.exposure-fill.high {
    background: var(--gradient-danger);
}

.exposure-lbl {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 42px;
    text-align: right;
}

/* RECOMMENDATION CARD */
.rec-card {
    padding: 18px;
    border-radius: 14px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    display: flex;
    gap: 14px;
}

.rec-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.rec-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rec-icon i {
    width: 22px;
    height: 22px;
}

.rec-icon.critical {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
}

.rec-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
}

.rec-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.rec-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
}

.rec-content {
    flex: 1;
    min-width: 0;
}

.rec-priority {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.rec-priority.critical {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
}

.rec-priority.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
}

.rec-priority.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.rec-priority.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
}

.rec-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.rec-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.rec-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-card-solid);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.rec-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.rec-btn i {
    width: 12px;
    height: 12px;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.show .modal-box {
    transform: scale(1) translateY(0);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-head h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.modal-close-btn:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose);
    border-color: var(--rose);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card-hover);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-fast);
    font-family: var(--font-jakarta);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
    appearance: none;
    cursor: pointer;
}

.toast-container {
    position: fixed;
    top: calc(20px + var(--safe-top));
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}

.toast {
    min-width: 320px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: 12px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    animation: toast-in 0.3s ease-out;
}

.toast.closing {
    animation: toast-out 0.3s ease-in forwards;
}

.toast.t-success {
    border-left: 3px solid var(--emerald);
}

.toast.t-error {
    border-left: 3px solid var(--rose);
}

.toast.t-warning {
    border-left: 3px solid var(--amber);
}

.toast.t-info {
    border-left: 3px solid var(--primary);
}

@keyframes toast-in {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.toast-msg {
    font-size: 13px;
    color: var(--text-muted);
}

.toast-close {
    width: 24px;
    height: 24px;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 6px;
    cursor: pointer;
}

.toast-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.main-footer {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.main-footer a {
    font-size: 13px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.main-footer a:hover {
    color: var(--primary);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scroll-hint {
    display: none;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    align-items: center;
    gap: 4px;
}

@media (max-width: 1400px) {
    .navbar-search {
        width: 260px;
    }
}

@media (max-width: 1280px) {
    .navbar-search {
        width: 220px;
    }

    .live-ticker {
        display: none;
    }

    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1100px) {
    .navbar-search {
        display: none;
    }

    .np-info-text {
        display: none;
    }

    .navbar-profile {
        padding: 5px;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .grid-2,
    .grid-2-1 {
        grid-template-columns: 1fr;
    }

    .rh-inner {
        grid-template-columns: 1fr;
    }

    .risk-score-wrap {
        margin: 0 auto;
    }
}

@media (max-width: 900px) {
    :root {
        --navbar-height: 64px;
    }

    .page-content {
        padding: 20px;
        padding-top: calc(var(--navbar-height) + 20px);
        gap: 20px;
    }

    .risk-hero {
        padding: 24px;
    }

    .rh-title {
        font-size: 24px;
    }

    .rh-stat-val {
        font-size: 18px;
    }

    .page-title {
        font-size: 22px;
    }

    .risk-score-wrap {
        width: 200px;
        height: 200px;
    }

    .rsc-num {
        font-size: 56px;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 60px;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 60;
        width: 280px !important;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .navbar {
        left: 0 !important;
        padding: 0 12px;
        gap: 8px;
    }

    .mobile-toggle {
        display: flex;
    }

    .desktop-toggle {
        display: none;
    }

    .page-content {
        padding: 14px;
        padding-top: calc(var(--navbar-height) + 14px);
        gap: 16px;
    }

    .grid-4 {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .sc-value {
        font-size: 20px;
    }

    .sc-label {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .sc-trend {
        font-size: 12px;
    }

    .sc-trend>span:last-child {
        display: none;
    }

    .sc-icon {
        width: 40px;
        height: 40px;
    }

    .sc-header {
        margin-bottom: 12px;
    }

    .card-pad {
        padding: 16px;
    }

    .card-header {
        margin-bottom: 16px;
        gap: 8px;
    }

    .card-title {
        font-size: 15px;
    }

    .risk-hero {
        padding: 20px;
        border-radius: 18px;
    }

    .rh-title {
        font-size: 20px;
    }

    .rh-stats {
        grid-template-columns: 1fr;
    }

    .toast-container {
        top: calc(12px + var(--safe-top));
        right: 12px;
        left: 12px;
        max-width: calc(100vw - 24px);
    }

    .toast {
        min-width: auto;
        max-width: 100%;
        padding: 12px 14px;
    }

    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-box {
        border-radius: 18px;
        max-height: 88vh;
        max-height: 88dvh;
    }

    .modal-head {
        padding: 16px 18px;
    }

    .modal-body {
        padding: 18px;
    }

    .modal-foot {
        padding: 14px 18px;
    }

    .modal-foot .btn {
        flex: 1;
    }

    .dropdown-menu {
        position: fixed;
        top: calc(var(--navbar-height) + 8px) !important;
        right: 12px !important;
        left: 12px !important;
        min-width: auto !important;
        max-width: none !important;
    }

    .navbar-profile {
        border: none;
        padding: 3px;
    }

    .main-footer {
        padding: 16px 0;
    }

    .main-footer>* {
        text-align: center;
        width: 100%;
    }

    .main-footer>div:last-child {
        justify-content: center;
    }

    .navbar-right {
        gap: 4px;
    }

    .nav-icon-btn,
    .theme-toggle {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .page-title {
        font-size: 20px;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .scroll-hint {
        display: flex;
    }

    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .page-content {
        padding: 12px;
        padding-top: calc(var(--navbar-height) + 12px);
        gap: 14px;
    }

    .grid-4 {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .sc-value {
        font-size: 18px;
    }

    .btn {
        padding: 9px 16px;
        font-size: 13px;
        min-height: 40px;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 11px;
        min-height: 28px;
    }

    .rh-title {
        font-size: 18px;
    }

    .risk-score-wrap {
        width: 180px;
        height: 180px;
    }

    .rsc-num {
        font-size: 48px;
    }
}

@media (max-width: 480px) {
    :root {
        --navbar-height: 56px;
    }

    .page-content {
        padding: 10px;
        padding-top: calc(var(--navbar-height) + 10px);
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .sc-value {
        font-size: 24px;
    }

    .sc-trend>span:last-child {
        display: inline;
    }

    .card {
        border-radius: 14px;
    }

    .card-pad {
        padding: 14px;
    }

    .sidebar {
        width: 260px !important;
    }

    .navbar {
        padding: 0 10px;
        gap: 6px;
    }

    .nav-icon-btn,
    .theme-toggle {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .navbar-profile-avatar {
        width: 32px;
        height: 32px;
    }

    .modal-overlay {
        padding: 8px;
    }

    .modal-box {
        border-radius: 16px;
    }

    .dropdown-menu {
        top: calc(var(--navbar-height) + 6px) !important;
        right: 10px !important;
        left: 10px !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .nav-link:hover {
        transform: none;
        background: transparent;
        color: var(--text-secondary);
    }

    .nav-link:active {
        background: var(--bg-card-hover);
        color: var(--text-primary);
    }

    .nav-link.active {
        background: var(--gradient-primary);
        color: #fff;
    }

    .btn:hover,
    .stat-card:hover,
    .card:hover,
    .kpi-tile:hover,
    .rec-card:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.97);
    }
}

@media print {

    .sidebar,
    .navbar,
    .sidebar-overlay,
    .toast-container,
    .page-loader {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================
   Risk Level Responsive
========================= */

/* Desktop */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* Card */
.risk-level-card {
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--card);
    overflow: hidden;
}

.rlc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.rlc-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.rlc-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rlc-icon svg {
    width: 20px;
    height: 20px;
}

.rlc-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.rlc-desc {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.rlc-value {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.risk-bar {
    margin: 20px 0 10px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444, #991b1b);
    position: relative;
}

.risk-bar-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, .2);
}

.risk-scale {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

/* =========================
      Tablet
========================= */

@media (max-width:992px) {

    .grid-2 {
        grid-template-columns: 1fr;
    }

}

/* =========================
      Mobile
========================= */

@media (max-width:768px) {

    .card-pad {
        padding: 18px;
    }

    .rlc-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rlc-title {
        width: 100%;
    }

    .rlc-value {
        margin-left: 56px;
    }

    .rlc-name {
        font-size: 14px;
    }

    .rlc-desc {
        font-size: 12px;
    }

    .risk-scale {
        font-size: 11px;
    }

}

/* =========================
      Small Mobile
========================= */

@media (max-width:480px) {

    .card-pad {
        padding: 16px;
    }

    .rlc-icon {
        width: 40px;
        height: 40px;
    }

    .rlc-name {
        font-size: 13px;
    }

    .rlc-desc {
        font-size: 11px;
    }

    .rlc-value {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    .risk-scale {
        font-size: 10px;
    }

}

.risk-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width:768px) {
    .risk-grid {
        grid-template-columns: 1fr;
    }
}