
:root {
    /* Surfaces — MUHGPT near-black scale */
    --bg-primary: #0a0a0a;
    --bg-secondary: #050505;
    --bg-tertiary: #1a1a1a;
    --bg-card: #141414;
    --bg-card-hover: #1c1c1c;
    --bg-input: #0d0d0d;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    /* Brand — MUHGPT red */
    --accent-primary: #dc2626;
    --accent-primary-hover: #b91c1c;
    --accent-secondary: #ef4444;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #3b82f6;

    --glow-primary: 0 0 20px rgba(220, 38, 38, 0.18);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.15);
    --glow-danger: 0 0 20px rgba(239, 68, 68, 0.18);
    --glow-purple: 0 0 20px rgba(168, 85, 247, 0.15);

    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6b7280;
    --text-accent: #ef4444;

    --border-color: #2d2d2d;
    --border-hover: #3d3d3d;
    --border-accent: rgba(220, 38, 38, 0.35);

    /* 🌊 Liquid glass (MUHGPT) */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-strong: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-light: rgba(255, 255, 255, 0.22);
    --glass-shine: rgba(255, 255, 255, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.3);

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.25);

    --sidebar-width: 260px;
    --header-height: 60px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace;
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.8rem;
    --font-size-md: 0.9rem;
    --font-size-lg: 1.1rem;
    --font-size-xl: 1.4rem;
    --font-size-2xl: 1.8rem;
    --font-size-3xl: 2.4rem;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    --z-sidebar: 100;
    --z-header: 200;
    --z-modal: 500;
    --z-toast: 600;
    --z-tooltip: 700;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

a { color: var(--accent-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

::selection { background: var(--accent-primary); color: #fff; }
*:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand h1 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.sidebar-brand span {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin: 1px 0;
    font-size: var(--font-size-md);
    position: relative;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(220, 38, 38, 0.10);
    color: var(--accent-primary);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-stats {
    display: flex;
    gap: 12px;
}

.stat-mini {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.stat-mini .stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-mini .stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
}

.app-header {
    height: var(--header-height);
    min-height: var(--header-height);
    background: rgba(10, 10, 10, 0.72);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: var(--z-header);
}

.header-search {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.header-search input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 10px 18px 10px 42px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: var(--font-size-md);
    outline: none;
    transition: all var(--transition-fast);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.header-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 15px;
}

.header-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.header-btn.has-notification::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--accent-danger);
    border-radius: 50%;
}

/* Hidden on desktop; the mobile media query (later in the file) re-enables it.
   Defined here so source order makes the media-query rule win without !important. */
.mobile-menu-btn { display: none; }

/* Backdrop behind the off-canvas sidebar on mobile (hidden on desktop). */
.sidebar-backdrop { display: none; }

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-primary);
}

.module-view {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.module-header {
    margin-bottom: 24px;
}

.module-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.module-header p {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
}

.search-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.search-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: var(--font-size-md);
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

.form-input::placeholder { color: var(--text-muted); }

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

.action-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.action-tab {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    font-family: var(--font-main);
}

.action-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.action-tab.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: var(--glow-primary);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-danger {
    background: transparent;
    color: var(--accent-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-danger);
}

.btn-success {
    background: var(--accent-success);
    color: #fff;
    border-color: var(--accent-success);
}

.btn-sm { padding: 6px 12px; font-size: var(--font-size-sm); }
.btn-lg { padding: 14px 28px; font-size: var(--font-size-lg); }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all var(--transition-fast);
}

.card:hover {
    border-color: var(--glass-border-light);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: var(--font-size-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.result-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-fast);
}

.result-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.result-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.result-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.result-item-icon.found { background: rgba(16, 185, 129, 0.12); color: var(--accent-success); }
.result-item-icon.not-found { background: rgba(239, 68, 68, 0.12); color: var(--accent-danger); }
.result-item-icon.info { background: rgba(59, 130, 246, 0.12); color: var(--accent-info); }
.result-item-icon.warning { background: rgba(245, 158, 11, 0.12); color: var(--accent-warning); }

.result-item-title {
    font-weight: 600;
    font-size: var(--font-size-md);
}

.result-item-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.result-item-body {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.data-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: var(--font-size-sm);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-secondary);
}

.data-table tr:hover td {
    background: var(--bg-card-hover);
}

.data-table td { color: var(--text-primary); }

.kv-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-size: var(--font-size-sm);
}

.kv-key {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.kv-value {
    color: var(--text-primary);
    word-break: break-word;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

/* Key/value rows used throughout the result renderers (.kv-list > .kv-item). */
.kv-list { display: flex; flex-direction: column; }
.kv-item {
    display: flex;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
}
.kv-item:last-child { border-bottom: none; }
.kv-item .kv-key { flex: 0 0 36%; white-space: normal; }
.kv-item .kv-value { flex: 1; min-width: 0; }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

.tag-success { background: rgba(16, 185, 129, 0.12); color: var(--accent-success); }
.tag-danger  { background: rgba(239, 68, 68, 0.12); color: var(--accent-danger); }
.tag-warning { background: rgba(245, 158, 11, 0.12); color: var(--accent-warning); }
.tag-info    { background: rgba(59, 130, 246, 0.12); color: var(--accent-info); }
.tag-purple  { background: rgba(168, 85, 247, 0.14); color: #a855f7; }
.tag-neutral { background: var(--bg-tertiary); color: var(--text-secondary); }
.tag-blue    { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.tag-green   { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.tag-red     { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.tag-yellow  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* Unified global-search report */
.uni-status { font-size: .78rem; color: var(--text-secondary); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.uni-final { border-color: #a855f7; box-shadow: 0 0 0 1px rgba(168, 85, 247, .22); }
.uni-final > .card-header h3 { color: #c084fc; }

.risk-meter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.risk-meter-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.risk-meter-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.risk-meter-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
}

.breach-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.breach-alert {
    color: #ff5f5f;
    font-weight: 700;
    font-size: var(--font-size-lg);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.breach-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.breach-item {
    background: linear-gradient(180deg, rgba(45, 27, 45, 0.72), rgba(39, 29, 54, 0.56));
    border: 1px solid rgba(255, 86, 86, 0.18);
    border-left: 4px solid #ff5f5f;
    border-radius: 10px;
    padding: 14px 16px;
}

.breach-item-title {
    margin: 0 0 2px;
    color: #f8fafc;
    font-size: 1.08rem;
    font-weight: 700;
}

.breach-item-meta {
    color: #b8c2d9;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.breach-item-desc {
    color: #d5d9e7;
    margin: 0;
    line-height: 1.5;
    font-size: 0.94rem;
}

.breach-item-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.password-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(21, 29, 43, 0.92));
}

.password-hero.is-compromised {
    border-color: rgba(239, 68, 68, 0.28);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.08), var(--glow-danger);
}

.password-hero.is-safe {
    border-color: rgba(16, 185, 129, 0.24);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.06), var(--glow-success);
}

.password-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
}

.password-hero.is-compromised .password-hero-icon {
    color: #fda4af;
    background: rgba(127, 29, 29, 0.35);
}

.password-hero.is-safe .password-hero-icon {
    color: #6ee7b7;
    background: rgba(6, 78, 59, 0.35);
}

.password-hero-title {
    font-size: 1.9rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.password-hero-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 700px;
}

.password-hero-text strong {
    color: var(--text-primary);
}

.password-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.password-hero-count {
    min-width: 140px;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.password-hero-count-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.password-hero-count-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.password-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.password-stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.password-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.password-stat-value {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-25 { width: 25%; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease;
    pointer-events: all;
    max-width: 380px;
}

.toast.success, .toast-success { border-left: 3px solid var(--accent-success); }
.toast.error, .toast-error   { border-left: 3px solid var(--accent-danger); }
.toast.warning, .toast-warning { border-left: 3px solid var(--accent-warning); }
.toast.info, .toast-info    { border-left: 3px solid var(--accent-primary); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success .toast-icon, .toast-success i { color: var(--accent-success); }
.toast.error .toast-icon, .toast-error i   { color: var(--accent-danger); }
.toast.warning .toast-icon, .toast-warning i { color: var(--accent-warning); }
.toast.info .toast-icon, .toast-info i    { color: var(--accent-primary); }

.toast-exit {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100px); opacity: 0; }
}

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(20, 20, 20, 0.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: var(--font-size-lg); font-weight: 600; }

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 8px; }

.progress-bar {
    background: var(--border-color);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent-primary);
    transition: width 0.5s ease;
}

.stats-row,
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--glass-border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.stat-card-icon.cyan { background: rgba(59, 130, 246, 0.12); color: var(--accent-info); }
.stat-card-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); }
.stat-card-icon.purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.stat-card-icon.orange { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); }
.stat-card-icon.red { background: rgba(239, 68, 68, 0.1); color: var(--accent-danger); }
.stat-card-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-info); }

.stat-card-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: 2px;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.platform-item:hover { border-color: var(--border-hover); }
.platform-item.found { border-left: 3px solid var(--accent-success); }
.platform-item.not-found { border-left: 3px solid var(--border-color); opacity: 0.6; }

.platform-item i { font-size: 18px; width: 22px; text-align: center; }
.platform-item .platform-name { font-weight: 500; }
.platform-item .platform-status { margin-left: auto; }

.map-container {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.code-block {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: var(--font-size-md);
    max-width: 400px;
}

.dashboard-welcome {
    padding: 40px 0 30px;
    text-align: center;
}

.dashboard-welcome h2 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.dashboard-welcome p {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.quick-action {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-action:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.quick-action i {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
}

.quick-action span {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.quick-action:hover span { color: var(--text-primary); }

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(220, 38, 38, 0.04);
}

.upload-zone i {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
}

.result-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.result-tab {
    padding: 10px 20px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-main);
}

.result-tab:hover { color: var(--text-primary); }

.result-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.json-viewer {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    max-height: 400px;
    overflow: auto;
    color: var(--text-secondary);
}

.json-key { color: var(--accent-primary); }
.json-string { color: var(--accent-success); }
.json-number { color: var(--accent-warning); }
.json-boolean { color: var(--accent-secondary); }
.json-null { color: var(--text-muted); }

.security-score {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 800;
    flex-shrink: 0;
    background: conic-gradient(var(--accent-primary) calc(var(--score) * 3.6deg), var(--border-color) 0);
    position: relative;
}

.score-circle::before {
    content: attr(data-score);
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 800;
}

.score-details h4 { font-size: var(--font-size-lg); margin-bottom: 4px; }
.score-details p { color: var(--text-muted); font-size: var(--font-size-sm); }

@media (max-width: 768px) {
    /* ── Off-canvas drawer + backdrop (drawer sits above the header, below modals) ── */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100%;
        width: min(82vw, 320px);
        min-width: 0;
        transform: translateX(-100%);
        z-index: 400;
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 390;
        background: rgba(0, 0, 0, 0.6);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition-normal), visibility var(--transition-normal);
    }
    .sidebar.open ~ .sidebar-backdrop { opacity: 1; visibility: visible; }

    /* Reveal the hamburger — wins over the base hide via source order */
    .mobile-menu-btn { display: flex; width: 42px; height: 42px; }

    /* ── Header: compact but tappable, honour notch safe-areas ── */
    .app-header {
        padding: 0 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        gap: 8px;
    }
    .header-search { min-width: 0; }
    .header-actions { gap: 4px; }
    .header-btn { width: 40px; height: 40px; flex-shrink: 0; }

    .content-area {
        padding: 16px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    .module-header h2, .page-header h2 { font-size: 1.45rem; }

    /* ── Forms: stack, full-width submit, 16px inputs (stops iOS focus-zoom) ── */
    .search-form { padding: 16px; }
    .search-form-row { flex-direction: column; }
    .form-input,
    .header-search input,
    .search-form input,
    .search-form select { font-size: 16px; }
    .search-form .btn { width: 100%; justify-content: center; }

    /* ── Segmented tabs scroll horizontally instead of being crushed ── */
    .action-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .action-tabs::-webkit-scrollbar { display: none; }
    .action-tab { flex: 0 0 auto; white-space: nowrap; }

    /* ── Grids → fewer columns ── */
    .results-grid { grid-template-columns: 1fr; }
    .platform-grid { grid-template-columns: 1fr; }
    .stats-row,
    .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .stat-card { padding: 16px; }
    .quick-action { padding: 18px 12px; }

    /* ── KV rows: label stacked above value ── */
    .kv-item { flex-direction: column; gap: 2px; }
    .kv-item .kv-key { flex: none; }

    /* ── Modals behave like bottom sheets ── */
    .modal-overlay { align-items: flex-end; }
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .modal-footer { flex-direction: column-reverse; }
    .modal-footer .btn { width: 100%; }

    /* Larger nav tap targets */
    .nav-item { padding: 12px 14px; }
}

/* Touch devices: hover tooltips would stick on tap — disable them */
@media (hover: none) {
    [data-tooltip]::after,
    [data-tooltip]:hover::after { display: none !important; }
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 20px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.flex-wrap { flex-wrap: wrap; }
.mt-xs { margin-top: 4px; }
.mb-lg { margin-bottom: 24px; }
.text-primary { color: var(--accent-primary) !important; }

.page-header {
    margin-bottom: 24px;
}
.page-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-header h2 i {
    color: var(--accent-primary);
}
.page-header p {
    color: var(--text-muted);
    font-size: var(--font-size-md);
}
