/* ==================== CSS Variables & Design System ==================== */
:root {
    --bg-deep: #06060f;
    --bg-primary: #0a0a18;
    --bg-secondary: #0f0f25;
    --bg-card: rgba(14, 14, 38, 0.75);
    --bg-card-hover: rgba(20, 20, 50, 0.85);
    --bg-input: rgba(10, 10, 30, 0.8);
    --border-subtle: rgba(100, 140, 255, 0.12);
    --border-glow: rgba(0, 229, 255, 0.3);
    --border-strong: rgba(0, 229, 255, 0.5);
    --accent-cyan: #00e5ff;
    --accent-blue: #2979ff;
    --accent-purple: #b347ea;
    --accent-pink: #ff4081;
    --accent-green: #00e676;
    --accent-amber: #ffab40;
    --text-primary: #e8eaf0;
    --text-secondary: #8892b0;
    --text-dim: #555a70;
    --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.3), 0 0 60px rgba(0, 229, 255, 0.1);
    --glow-purple: 0 0 20px rgba(179, 71, 234, 0.3), 0 0 60px rgba(179, 71, 234, 0.1);
    --glow-blue: 0 0 20px rgba(41, 121, 255, 0.3), 0 0 60px rgba(41, 121, 255, 0.1);
    --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    --font-sans: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', system-ui, -apple-system, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==================== Particle Background ==================== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ==================== Grid Overlay ==================== */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 30%, transparent 70%);
}

/* ==================== App Container ==================== */
#app {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== Login Page ==================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 420px;
    max-width: 90vw;
    position: relative;
    box-shadow: 0 0 80px rgba(0, 229, 255, 0.06), 0 0 40px rgba(179, 71, 234, 0.04);
    animation: cardEntrance 0.6s ease;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 30px;
    right: 30px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
}

.login-card::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 30px;
    right: 30px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.3), rgba(179, 71, 234, 0.3), transparent);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo .icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border: 2px solid var(--accent-cyan);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-cyan);
    animation: pulseGlow 3s ease-in-out infinite;
}

.login-logo .icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent-cyan);
    fill: none;
    stroke-width: 1.5;
}

.login-logo h1 {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
}

.login-logo .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    margin-top: 6px;
    text-transform: uppercase;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: all var(--transition-normal);
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1), var(--glow-cyan);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-sans);
    letter-spacing: 0.04em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 30px rgba(0, 229, 255, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--border-glow);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-danger {
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.25);
}

.btn-danger:hover {
    background: rgba(255, 82, 82, 0.25);
}

.login-error {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: #ff5252;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    animation: shake 0.4s ease;
}

/* ==================== Dashboard Layout ==================== */
.dashboard {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header .logo-text {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.sidebar-header .logo-sub {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    letter-spacing: 0.03em;
}

.nav-item:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(0, 229, 255, 0.08);
    color: var(--accent-cyan);
    border-color: rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.06);
}

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

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-footer .user-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-footer .btn-logout {
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.sidebar-footer .btn-logout:hover {
    color: var(--accent-pink);
    background: rgba(255,64,129,0.08);
}

/* ==================== Main Content ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.main-header h2 {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.main-header .header-actions {
    display: flex;
    gap: 10px;
}

.main-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
}

/* Scrollbar */
.main-body::-webkit-scrollbar {
    width: 6px;
}
.main-body::-webkit-scrollbar-track {
    background: transparent;
}
.main-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}
.main-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.14);
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.04);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

/* ==================== Stats Cards ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card .stat-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 6px;
}

/* ==================== Tables ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table thead {
    background: rgba(0, 229, 255, 0.04);
}

table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(100, 140, 255, 0.06);
    color: var(--text-primary);
    white-space: nowrap;
}

table tbody tr {
    transition: background var(--transition-fast);
    cursor: pointer;
}

table tbody tr:hover {
    background: rgba(0, 229, 255, 0.04);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.status-waiting { background: rgba(255, 171, 64, 0.12); color: var(--accent-amber); }
.status-running { background: rgba(41, 121, 255, 0.12); color: var(--accent-blue); }
.status-created { background: rgba(0, 230, 118, 0.12); color: var(--accent-green); }
.status-done { background: rgba(0, 229, 255, 0.12); color: var(--accent-cyan); }

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-waiting .status-dot { background: var(--accent-amber); }
.status-running .status-dot { background: var(--accent-blue); animation: pulse 1.5s infinite; }
.status-created .status-dot { background: var(--accent-green); }
.status-done .status-dot { background: var(--accent-cyan); }

/* ==================== Form Elements ==================== */
.form-section {
    margin-bottom: 28px;
}

.form-section-title {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent-cyan);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

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

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

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

.form-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    transition: all var(--transition-normal);
    outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.08);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ==================== Region Tree Select ==================== */
.region-selector {
    position: relative;
}

.region-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    min-height: 42px;
}

.region-trigger:hover {
    border-color: var(--border-glow);
}

.region-trigger.has-selection {
    color: var(--accent-cyan);
    border-color: rgba(0, 229, 255, 0.3);
}

.region-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    z-index: 100;
    display: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.region-dropdown.open {
    display: block;
    animation: dropdownIn 0.2s ease;
}

.region-search {
    padding: 10px;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
}

.region-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}

.region-search input:focus {
    border-color: var(--accent-cyan);
}

.region-tree {
    padding: 6px 0;
}

.tree-node {
    user-select: none;
}

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 13px;
}

.tree-node-header:hover {
    background: rgba(255,255,255,0.03);
}

.tree-node-header .expand-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 10px;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.tree-node-header .expand-icon.expanded {
    transform: rotate(90deg);
}

.tree-node-header .checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--text-dim);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.tree-node-header .checkbox-custom.checked {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.tree-node-header .checkbox-custom.partial {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--accent-cyan);
}

.tree-node-header .node-label {
    color: var(--text-primary);
    flex: 1;
}

.tree-node-header .node-count {
    font-size: 10px;
    color: var(--text-dim);
}

.tree-children {
    padding-left: 28px;
    display: none;
}

.tree-children.open {
    display: block;
}

/* ==================== Modals ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 90vw;
    max-width: 1200px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 80px rgba(0, 229, 255, 0.08);
    animation: modalIn 0.3s ease;
}

.modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    border-color: var(--border-glow);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

.modal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0;
}

.modal-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
    letter-spacing: 0.03em;
}

.modal-tab:hover {
    color: var(--text-primary);
}

.modal-tab.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

.detail-body {
    flex: 1;
    min-height: 0;
}

/* ==================== Charts ==================== */
.chart-section {
    margin-bottom: 24px;
}

.chart-section-title {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    margin-bottom: 14px;
}

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

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 160px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    flex: 1;
    height: 22px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
    position: relative;
    min-width: 2px;
}

.bar-fill.cyan { background: linear-gradient(90deg, rgba(0,229,255,0.5), var(--accent-cyan)); }
.bar-fill.blue { background: linear-gradient(90deg, rgba(41,121,255,0.5), var(--accent-blue)); }
.bar-fill.purple { background: linear-gradient(90deg, rgba(179,71,234,0.5), var(--accent-purple)); }
.bar-fill.pink { background: linear-gradient(90deg, rgba(255,64,129,0.5), var(--accent-pink)); }
.bar-fill.green { background: linear-gradient(90deg, rgba(0,230,118,0.5), var(--accent-green)); }
.bar-fill.amber { background: linear-gradient(90deg, rgba(255,171,64,0.5), var(--accent-amber)); }

.bar-value {
    width: 70px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    flex-shrink: 0;
}

/* Pie chart (CSS-only) */
.pie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.pie-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
}

.pie-card h4 {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

/* ==================== Tag Stats Grid ==================== */
.tag-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.tag-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}

.tag-stat-card h4 {
    font-size: 12px;
    color: var(--accent-cyan);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 14px;
    font-family: var(--font-mono);
}

/* ==================== Loading & Progress ==================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 229, 255, 0.2);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

.progress-bar-container {
    margin: 16px 0;
}

.progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 2px;
    transition: width 0.5s ease;
    animation: progressShimmer 2s infinite;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ==================== Progress Card ==================== */
.progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.progress-card-header {
    margin-bottom: 16px;
}

.progress-task-id {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-cyan);
    letter-spacing: 0.05em;
}

.progress-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.progress-detail {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    backdrop-filter: blur(12px);
    min-width: 280px;
}

.toast-success {
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--accent-green);
}

.toast-error {
    background: rgba(255, 82, 82, 0.12);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: #ff5252;
}

.toast-info {
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--accent-cyan);
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 14px;
    letter-spacing: 0.04em;
}

/* ==================== Polling indicator ==================== */
.poll-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.poll-indicator.active {
    background: rgba(0, 229, 255, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.poll-indicator .poll-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-cyan);
    animation: pulse 1.5s infinite;
}

/* ==================== Person Card Grid ==================== */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.person-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-fast);
}

.person-card:hover {
    border-color: var(--border-glow);
}

.person-card .person-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent-cyan);
    margin-bottom: 10px;
}

.person-card .person-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.person-tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.06);
}

/* ==================== Decision result display ==================== */
.decision-option {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.decision-participate {
    background: rgba(0, 230, 118, 0.12);
    color: var(--accent-green);
}

.decision-not-participate {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
}

/* ==================== Animations ==================== */
@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 229, 255, 0.2); }
    50% { box-shadow: 0 0 40px rgba(0, 229, 255, 0.4), 0 0 80px rgba(0, 229, 255, 0.1); }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(20px); }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes progressShimmer {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

@keyframes scanLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Scan line effect on cards */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.4), transparent);
    animation: scanLine 4s linear infinite;
    pointer-events: none;
    z-index: 2;
}

/* ==================== Data glow text ==================== */
.text-glow {
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
    color: var(--accent-cyan);
}

/* ==================== Dividers ==================== */
.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 20px 0;
}

.divider-glow {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.3), transparent);
    margin: 20px 0;
}

/* ==================== Utility ==================== */
.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
