﻿/**
 * Erigo Admin Dashboard - Main Stylesheet
 * @author STUDIO ERIGO, s.r.o.
 * Modern dark theme, responsive, component-based
 */

/* ============================================================
   CSS Variables / Design Tokens
   ============================================================ */

:root {
    /* Colors - Dark Theme */
    --bg-primary: #0f1117;
    --bg-secondary: #161923;
    --bg-tertiary: #1c1f2e;
    --bg-card: #1a1d2e;
    --bg-card-hover: #222640;
    --bg-input: #12141e;

    --border-color: #2a2d3e;
    --border-light: #353849;

    --text-primary: #e4e6f0;
    --text-secondary: #8b8fa3;
    --text-muted: #5c6078;

    --accent-blue: #eb1659;
    --accent-blue-hover: #c9114a;
    --accent-green: #22c55e;
    --accent-green-hover: #16a34a;
    --accent-orange: #f59e0b;
    --accent-orange-hover: #d97706;
    --accent-red: #ef4444;
    --accent-red-hover: #dc2626;
    --accent-purple: #a855f7;
    --accent-purple-hover: #9333ea;
    --accent-yellow: #eab308;
    --accent-cyan: #06b6d4;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 68px;
    --header-height: 60px;
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --border-radius-lg: 14px;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px rgba(235, 22, 89, 0.15);
    --shadow-glow-green: 0 0 20px rgba(34, 197, 94, 0.15);
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-blue-hover);
}

code, pre {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.87rem;
}

code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    color: var(--accent-cyan);
}

pre {
    background: var(--bg-input);
    padding: 14px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

pre code {
    background: none;
    padding: 0;
}

/* ============================================================
   App Layout
   ============================================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: var(--transition-slow);
}

.page-content {
    padding: 24px;
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition-slow);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--header-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(235, 22, 89, 0.35);
}

.logo-icon svg {
    width: 36px;
    height: 36px;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.logo-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    display: none;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-list {
    list-style: none;
    padding: 0 10px;
}

.nav-divider {
    padding: 18px 12px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.9rem;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-external-icon {
    margin-left: auto;
    opacity: 0.4;
    width: 14px !important;
    height: 14px !important;
}

.nav-item.active .nav-link {
    color: var(--accent-blue);
    background: rgba(235, 22, 89, 0.12);
    font-weight: 500;
}

.nav-item.active .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--accent-blue);
    border-radius: 0 3px 3px 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border-color);
}

.sidebar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.info-separator {
    opacity: 0.4;
}

/* ============================================================
   Header
   ============================================================ */

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.server-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
}

.header-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================================
   Stats Grid
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-blue .stat-icon { background: rgba(235, 22, 89, 0.12); color: var(--accent-blue); }
.stat-green .stat-icon { background: rgba(34, 197, 94, 0.12); color: var(--accent-green); }
.stat-purple .stat-icon { background: rgba(168, 85, 247, 0.12); color: var(--accent-purple); }
.stat-orange .stat-icon { background: rgba(245, 158, 11, 0.12); color: var(--accent-orange); }
.stat-red .stat-icon { background: rgba(239, 68, 68, 0.12); color: var(--accent-red); }
.stat-yellow .stat-icon { background: rgba(234, 179, 8, 0.12); color: var(--accent-yellow); }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    display: block;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: block;
}

/* ============================================================
   Info Bar
   ============================================================ */

.info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.info-item svg {
    width: 15px;
    height: 15px;
}

/* ============================================================
   Section Headers
   ============================================================ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title svg {
    width: 20px;
    height: 20px;
    color: var(--accent-blue);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 14px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow-blue);
}

.search-box svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.87rem;
    width: 200px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ============================================================
   Domain Cards Grid
   ============================================================ */

.domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.domain-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.domain-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.domain-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.domain-icon {
    width: 38px;
    height: 38px;
    background: rgba(235, 22, 89, 0.12);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.domain-icon svg {
    width: 18px;
    height: 18px;
}

.domain-name-wrap {
    flex: 1;
    min-width: 0;
}

.domain-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-path {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-status {
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

.status-online {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent-green);
}

.status-unknown {
    background: rgba(139, 143, 163, 0.12);
    color: var(--text-muted);
}

.status-offline {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
}

.domain-card-body {
    padding: 14px 16px;
}

.domain-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.domain-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-typo3 {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-orange);
}

.badge-symlink {
    background: rgba(168, 85, 247, 0.12);
    color: var(--accent-purple);
}

.badge-folder {
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent-cyan);
}

.domain-stats {
    display: flex;
    gap: 16px;
}

.domain-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.domain-stat svg {
    width: 14px;
    height: 14px;
}

/* ============================================================
   Quick Actions Grid
   ============================================================ */

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    color: var(--text-primary);
}

.action-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon svg {
    width: 22px;
    height: 22px;
}

.action-blue { background: rgba(235, 22, 89, 0.12); color: var(--accent-blue); }
.action-green { background: rgba(34, 197, 94, 0.12); color: var(--accent-green); }
.action-orange { background: rgba(245, 158, 11, 0.12); color: var(--accent-orange); }
.action-purple { background: rgba(168, 85, 247, 0.12); color: var(--accent-purple); }

.action-info h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.action-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================================
   Panels
   ============================================================ */

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent-blue);
}

.panel-body {
    padding: 20px;
}

/* ============================================================
   Forms
   ============================================================ */

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label svg {
    width: 15px;
    height: 15px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow-blue);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.form-helpers {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.helper-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 10px;
    padding-top: 6px;
}

.inline-form {
    display: inline;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 0.87rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-blue-hover);
    box-shadow: var(--shadow-glow-blue);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: var(--accent-red);
    color: white;
}

.btn-outline {
    background: none;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ============================================================
   Alerts
   ============================================================ */

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.88rem;
    border: 1px solid;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.alert-success {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
    color: var(--accent-green);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--accent-red);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    color: var(--accent-orange);
}

.alert-info {
    background: rgba(235, 22, 89, 0.12);
    border-color: rgba(235, 22, 89, 0.12);
    color: var(--accent-blue);
}

/* ============================================================
   Data Table
   ============================================================ */

.symlinks-table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-input);
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.data-table td small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .row-danger {
    background: rgba(239, 68, 68, 0.06);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent-green);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
}

/* ============================================================
   Monitoring - Status & Findings
   ============================================================ */

.status-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.87rem;
    color: var(--text-secondary);
}

.status-item svg {
    width: 16px;
    height: 16px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.status-online {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.status-indicator.status-offline {
    background: var(--accent-red);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: 16px;
}

.info-box h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box h3 svg {
    width: 16px;
    height: 16px;
}

.info-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Findings */
.findings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.finding-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.finding-item:hover {
    border-color: var(--border-light);
}

.finding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.finding-severity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.finding-severity svg {
    width: 16px;
    height: 16px;
}

.severity-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-critical { background: rgba(239, 68, 68, 0.12); color: var(--accent-red); }
.severity-critical svg { color: var(--accent-red); }
.severity-high { background: rgba(245, 158, 11, 0.12); color: var(--accent-orange); }
.severity-high svg { color: var(--accent-orange); }
.severity-medium { background: rgba(234, 179, 8, 0.12); color: var(--accent-yellow); }
.severity-medium svg { color: var(--accent-yellow); }
.severity-low { background: rgba(235, 22, 89, 0.12); color: var(--accent-blue); }
.severity-low svg { color: var(--accent-blue); }
.severity-info { background: rgba(139, 143, 163, 0.12); color: var(--text-secondary); }

.finding-check {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.finding-body {
    padding: 12px 16px;
}

.finding-message {
    font-size: 0.87rem;
    margin-bottom: 6px;
}

.finding-path {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    word-break: break-all;
}

.finding-details {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ============================================================
   Scan Results Title
   ============================================================ */

.results-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

/* ============================================================
   Empty States
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.empty-state.compact {
    padding: 24px 20px;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.empty-state p {
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.empty-state .empty-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-state.success svg {
    color: var(--accent-green);
}

/* ============================================================
   Login Page
   ============================================================ */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-lg);
}

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

.login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 16px;
}

.login-logo svg {
    width: 28px;
    height: 28px;
}

.login-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-form .btn-block {
    margin-top: 8px;
    padding: 12px;
}

/* ============================================================
   Text Utilities
   ============================================================ */

.text-muted { color: var(--text-muted); }

/* ============================================================
   Installer
   ============================================================ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-value {
    font-size: 0.88rem;
    color: var(--text-primary);
}

.info-value code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--accent-blue);
}

.install-steps-list {
    list-style: decimal;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.install-steps-list li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.install-steps-list li strong {
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

.installer-form .form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.installer-form .form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 12px;
}

.installer-form .form-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 1rem;
}

.installer-form .form-section h4 svg {
    width: 18px;
    height: 18px;
    color: var(--accent-blue);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-with-prefix {
    display: flex;
    align-items: stretch;
}

.input-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: 'Space Mono', monospace;
    white-space: nowrap;
}

.input-with-prefix input {
    border-radius: 0 var(--radius) var(--radius) 0;
    flex: 1;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-hint code {
    background: var(--bg-tertiary);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.76rem;
    color: var(--accent-blue);
}

.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 0.95rem;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-info {
    background: rgba(235, 22, 89, 0.12);
    color: var(--accent-blue);
}

.extensions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.extension-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
}

/* ============================================================
   Changelog Mailer
   ============================================================ */

.changelog-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.changelog-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .changelog-grid { grid-template-columns: 1fr; }
}

/* (Full-width content is now applied globally via .page-content) */

/* ── Email composer card ── */
.email-composer {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

.email-composer::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius-lg);
    pointer-events: none;
    background: linear-gradient(135deg, rgba(235,22,89,0.06), transparent 40%);
}

.email-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.email-row:last-of-type { border-bottom: none; }

.email-label {
    flex: 0 0 70px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding-top: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.email-static {
    flex: 1;
    padding: 9px 0;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.email-input {
    flex: 1;
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.email-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(235, 22, 89, 0.15);
}

textarea.email-input { resize: vertical; min-height: 60px; line-height: 1.55; }

.email-divider {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 6px 0;
}

/* Recipient chips */
.email-recipients {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0;
}

.recipient-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.recipient-chip input { display: none; }

.recipient-chip .chip-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.recipient-chip .chip-content svg {
    width: 13px;
    height: 13px;
    opacity: 0.7;
}

.recipient-chip input:checked + .chip-content {
    background: rgba(235, 22, 89, 0.12);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.recipient-chip input:checked + .chip-content svg {
    color: var(--accent-blue);
    opacity: 1;
}

/* Composer blocks (intro, sections, footer) */
.composer-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
    position: relative;
    z-index: 1;
}

.composer-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.composer-label svg { width: 15px; height: 15px; }

.composer-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    line-height: 1.55;
    transition: var(--transition);
    outline: none;
}

.composer-textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(235, 22, 89, 0.15);
}

/* Section blocks */
.section-block {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 14px;
}

.section-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.section-emoji {
    font-size: 1.05rem;
    margin-right: 2px;
}

.section-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-item {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.section-item-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.section-item-fields .email-input {
    padding: 7px 10px;
    font-size: 0.88rem;
}

.section-item-desc { min-height: 38px; }

.section-item-remove {
    align-self: stretch;
    padding: 6px 10px;
}

.section-item-remove svg { width: 14px; height: 14px; }

/* ── Settings sidebar ── */
.changelog-settings .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
}

.changelog-settings .form-group:last-child { margin-bottom: 0; }

.form-group-row {
    flex-direction: row;
    gap: 12px;
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.release-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.release-type-option {
    cursor: pointer;
    user-select: none;
}

.release-type-option input { display: none; }

.release-type-option .rt-pill {
    display: block;
    padding: 8px 10px;
    text-align: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition);
}

.release-type-option:hover .rt-pill {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.release-type-option input:checked + .rt-pill {
    background: color-mix(in srgb, var(--rt-color) 15%, transparent);
    border-color: var(--rt-color);
    color: var(--rt-color);
    font-weight: 600;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.tips-list li::before {
    content: '›';
    color: var(--accent-blue);
    font-weight: 700;
    margin-right: 8px;
}

/* ── Preview modal ── */
.changelog-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.changelog-modal[hidden] { display: none; }

.changelog-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.changelog-modal-dialog {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: min(900px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.changelog-modal-header,
.changelog-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.changelog-modal-footer {
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    gap: 10px;
}

.changelog-modal-header h3 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.changelog-modal-body {
    flex: 1;
    overflow: auto;
    background: #0f1117;
}

.changelog-modal-body iframe {
    width: 100%;
    height: 65vh;
    border: 0;
    background: #0f1117;
    display: block;
}


.extension-badge svg {
    width: 14px;
    height: 14px;
    color: var(--accent-purple);
}

.install-message-group {
    margin-bottom: 12px;
}

.install-message-group:last-child {
    margin-bottom: 0;
}

.install-message-group .alert {
    margin-bottom: 6px;
}

.install-message-group .alert:last-child {
    margin-bottom: 0;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-toggle {
        display: flex;
    }

    .page-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .domains-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .info-bar {
        flex-direction: column;
        gap: 8px;
    }

    .top-header {
        padding: 0 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 24px;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================================
   Scrollbar Styling
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================
   Cache Manager
   ============================================================ */

/* Page header */
.cache-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cache-header-info .section-title {
    margin-bottom: 0.25rem;
}

.cache-subtitle {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 0.3rem;
}

/* Table */
.cache-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.cache-table thead tr {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.cache-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.cache-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.cache-table tbody tr:last-child td {
    border-bottom: none;
}

.cache-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.cache-domain-name {
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.cache-domain-path code {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Size badges */
.cache-size-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-green  { background: rgba(34,197,94,.15);   color: var(--accent-green); }
.badge-orange { background: rgba(245,158,11,.15);  color: var(--accent-orange); }
.badge-red    { background: rgba(239,68,68,.15);   color: var(--accent-red); }
.badge-muted  { background: var(--bg-tertiary);    color: var(--text-muted); }

/* Status badges */
.cache-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-has-cache { background: rgba(245,158,11,.12); color: var(--accent-orange); }
.status-no-cache  { background: rgba(34,197,94,.12);  color: var(--accent-green); }

/* Toast */
.cache-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    animation: toastIn 0.2s ease;
}

.cache-toast-success { background: rgba(34,197,94,.15);  color: var(--accent-green);  border: 1px solid rgba(34,197,94,.3); }
.cache-toast-error   { background: rgba(239,68,68,.15);  color: var(--accent-red);    border: 1px solid rgba(239,68,68,.3); }
.cache-toast-warning { background: rgba(245,158,11,.15); color: var(--accent-orange); border: 1px solid rgba(245,158,11,.3); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Spinner */
.cache-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Bulk result rows */
.result-ok   td { color: var(--accent-green); }
.result-fail td { color: var(--accent-red); }

@media (max-width: 768px) {
    .cache-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cache-table th:nth-child(2),
    .cache-table td:nth-child(2) {
        display: none;
    }
}



/* ── Owner-only password gate ── */
.changelog-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem 1rem;
}

.changelog-gate-card {
    width: min(420px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.changelog-gate-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(235,22,89,0.12), transparent 60%);
    pointer-events: none;
}

.changelog-gate-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eb1659, #ff4d8a);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(235,22,89,0.35);
    position: relative;
    z-index: 1;
}

.changelog-gate-icon svg { width: 26px; height: 26px; }

.changelog-gate-card h2 {
    margin: 0 0 6px 0;
    color: var(--text-primary);
    font-size: 1.35rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.changelog-gate-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 18px 0;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.changelog-gate-form {
    display: flex;
    flex-direction: column;
    text-align: left;
    position: relative;
    z-index: 1;
}

.changelog-gate-form .form-label { margin-bottom: 6px; }

.changelog-gate-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--accent-red);
    border-radius: var(--border-radius-sm);
    font-size: 0.88rem;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.changelog-gate-error svg { width: 16px; height: 16px; flex-shrink: 0; }