:root {
    --bg-dark: #0a0a0c;
    --card-bg: #121217;
    --card-header-bg: #1a1a21;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --unit1-color: #5294e2;
    --unit2-color: #f0715d;

    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.25) #0a0a0c;
}

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

::-webkit-scrollbar-track {
    background: #0a0a0c;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.25);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

::-webkit-scrollbar-corner {
    background: #0a0a0c;
}

a {
    text-decoration: none;
    color: inherit;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.privacy-guarantee-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 12px 20px;
    color: #e5e7eb;
    backdrop-filter: blur(16px);
}

.banner-subtext {
    display: block;
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 2px;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.privacy-disclaimer-box {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.8rem;
    color: #fef3c7;
    line-height: 1.45;
    backdrop-filter: blur(16px);
}

.disclaimer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fbbf24;
    font-weight: 600;
    margin-bottom: 4px;
}

.local-dropzone-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 760px;
    margin: 40px auto;
    width: 100%;
}

.privacy-note {
    font-size: 0.76rem;
    color: #6ee7b7;
    font-weight: 500;
}

.impersonation-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(120, 53, 15, 0.7);
    border: 1px solid rgba(180, 83, 9, 0.5);
    border-radius: 12px;
    padding: 10px 18px;
    color: #fef3c7;
    font-size: 0.88rem;
    font-weight: 500;
    backdrop-filter: blur(16px);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.banner-content strong {
    color: #ffffff;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
}

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

.logo-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-indicator {
    display: none !important;
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.logo-tag {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sync-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
}

.pulse-dot {
    display: none !important;
}

.sync-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: #6ee7b7;
    font-family: var(--font-mono);
}

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

.header-right .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    height: 36px;
    white-space: nowrap;
}

.user-session-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 10px;
    border-radius: 8px;
    height: 36px;
    white-space: nowrap;
}

#activeFileBadgeBox {
    max-width: 210px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#activeFileNameBadge {
    max-width: 120px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.user-avatar-badge {
    font-size: 0.95rem;
}

.user-name-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e5e7eb;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-family: var(--font-main);
    user-select: none;
}

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

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

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

.btn-icon {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

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

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.kpi-card {
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
}

.card-unit1::before {
    background: var(--unit1-color);
}

.card-unit2::before {
    background: var(--unit2-color);
}

.card-total::before {
    background: #8b5cf6;
}

.card-scheduler::before {
    background: var(--accent-green);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.unit-color-dot {
    display: none !important;
}

.kpi-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    font-family: var(--font-mono);
}

.tag-u1 {
    background: rgba(82, 148, 226, 0.1);
    color: #93c5fd;
    border: 1px solid rgba(82, 148, 226, 0.2);
}

.tag-u2 {
    background: rgba(240, 113, 93, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(240, 113, 93, 0.2);
}

.tag-total {
    background: rgba(139, 92, 246, 0.1);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.tag-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.kpi-countdown {
    font-family: var(--font-mono);
    font-size: 1.55rem;
    color: #6ee7b7;
}

.kpi-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.kpi-subtext {
    font-weight: 500;
    color: var(--text-secondary);
}

.kpi-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.chart-section {
    width: 100%;
}

.chart-card {
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.chart-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 48px;
}

.chart-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-filters {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-main);
}

.filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.chart-main-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    letter-spacing: -0.01em;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.chart-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-legend-box {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}

.legend-item:hover {
    opacity: 0.8;
}

.legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

.line-u1 {
    background-color: var(--unit1-color);
}

.line-u2 {
    background-color: var(--unit2-color);
}

.legend-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e5e7eb;
}

.btn-toggle-area {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-main);
    user-select: none;
}

.btn-toggle-area:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-toggle-area.active {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.25);
}

.chart-container {
    width: 100%;
    height: 480px;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: visible;
}

#pointProgressionChart {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.chart-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.grid-line {
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.axis-line {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
}

.axis-text {
    fill: #6b7280;
    font-size: 11.5px;
    font-family: var(--font-main);
    user-select: none;
}

.axis-title {
    fill: #9ca3af;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-main);
    letter-spacing: 0.02em;
    user-select: none;
}

.crosshair-v {
    stroke: #3b82f6;
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
    opacity: 0.75;
}

.chart-tooltip {
    position: fixed;
    pointer-events: none;
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    min-width: 240px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    z-index: 999999;
    margin: 0;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.tooltip-date {
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
}

.tooltip-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.tooltip-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-dot {
    display: none !important;
}

.tooltip-name {
    font-weight: 500;
    color: var(--text-secondary);
}

.tooltip-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-val {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #ffffff;
}

.tooltip-delta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}

.delta-u1 {
    background: rgba(82, 148, 226, 0.15);
    color: #93c5fd;
}

.delta-u2 {
    background: rgba(240, 113, 93, 0.15);
    color: #fca5a5;
}

.tooltip-hint-row {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
    text-align: center;
}

.tooltip-hint-text {
    font-size: 0.72rem;
    color: #60a5fa;
    font-weight: 500;
}

.dp-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
}

.dp-header-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dp-date-label {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.dp-time-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dp-type-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.dp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.dp-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dp-stat-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dp-stat-value {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.dp-breakdown-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
}

.dp-section-title {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: #e5e7eb;
}

.dp-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.dp-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.78rem;
}

.dp-meta-label {
    color: var(--text-muted);
    font-weight: 600;
}

.dp-meta-code {
    font-family: var(--font-mono);
    color: #60a5fa;
    word-break: break-all;
}

@media (max-width: 640px) {
    .dp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tooltip-breakdown {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.breakdown-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.breakdown-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.breakdown-tag {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: #d1d5db;
    font-family: var(--font-mono);
}

.chart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 0 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
}

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

.stat-bold {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 6px;
}

.stat-mono {
    font-family: var(--font-mono);
}

.admin-panel {
    width: 100%;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.detail-card {
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.3s ease;
}

.detail-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
}

.detail-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.detail-badge {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge-accent {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

.user-role-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
}

.role-admin {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.breakdown-bars-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.breakdown-item:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.breakdown-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
}

.breakdown-name {
    font-weight: 600;
    color: #f3f4f6;
    letter-spacing: 0.01em;
}

.breakdown-val {
    font-family: var(--font-mono);
    color: #9ca3af;
    font-size: 0.82rem;
}

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

.breakdown-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--unit1-color);
    transition: width 0.4s ease;
}

.files-table-container {
    max-height: 240px;
    overflow-y: auto;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.files-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.files-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.file-name-cell {
    font-family: var(--font-mono);
    font-weight: 500;
    color: #60a5fa;
}

.rate-limit-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.78rem;
    color: #fde68a;
    line-height: 1.4;
}

.upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.dropzone-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dropzone-text strong {
    color: #60a5fa;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0c;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

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

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 9px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.auth-tab-btn:hover {
    color: #ffffff;
}

.auth-tab-btn.active {
    background: #1a1a21;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

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

.login-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 14px;
}

.login-hint-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hint-title {
    font-weight: 600;
    color: #9ca3af;
}

.login-hint-box code {
    font-family: var(--font-mono);
    color: #60a5fa;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}

.btn-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input,
.form-textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus,
.form-textarea:focus {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

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

.status-box {
    padding: 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

.status-box.success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.status-box.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 18px;
    color: #ffffff;
    font-size: 0.85rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .chart-container {
        height: 420px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .app-container {
        gap: 16px;
    }

    .app-header {
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
        padding: 16px;
    }

    .header-left {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px;
    }

    .header-right {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-right .btn {
        flex: 1 1 auto;
        justify-content: center;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .sync-status-badge {
        width: 100%;
        justify-content: center;
        padding: 6px 12px;
    }

    .chart-card {
        padding: 16px;
        gap: 12px;
    }

    .chart-top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        min-height: auto;
    }

    .chart-main-title {
        position: static;
        transform: none;
        font-size: 1.15rem;
        text-align: center;
        order: 1;
    }

    .chart-controls-left {
        order: 2;
        justify-content: center;
    }

    .time-filters {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .filter-btn {
        flex: 1;
        padding: 6px 4px;
        text-align: center;
        font-size: 0.75rem;
    }

    .chart-controls-right {
        order: 3;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .chart-legend-box {
        padding: 6px 12px;
        gap: 12px;
    }

    .chart-container {
        height: 320px;
    }

    .chart-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        font-size: 0.76rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .kpi-card {
        padding: 16px;
        gap: 8px;
    }

    .kpi-value {
        font-size: 1.55rem;
    }

    .kpi-countdown {
        font-size: 1.35rem;
    }

    .detail-card {
        padding: 16px;
    }

    .files-table th,
    .files-table td {
        padding: 8px 6px;
        font-size: 0.76rem;
    }

    .file-name-cell {
        word-break: break-all;
        font-size: 0.72rem;
    }

    .rate-limit-notice {
        font-size: 0.74rem;
    }

    .chart-tooltip {
        padding: 10px 12px;
        min-width: 200px;
        max-width: 260px;
        font-size: 0.78rem;
    }

    .modal-card {
        width: 100%;
        max-height: 92vh;
        overflow-y: auto;
    }

    .modal-body {
        padding: 16px;
        gap: 14px;
    }

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

    .modal-footer {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .chart-legend-box {
        gap: 8px;
        padding: 4px 8px;
    }

    .legend-text {
        font-size: 0.78rem;
    }

    .chart-container {
        height: 280px;
    }
}

.stored-files-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.stored-file-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.stored-file-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.stored-file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stored-file-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #ffffff;
    word-break: break-all;
}

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

.stored-file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cloud-save-prompt {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: center;
    padding: 10px 0;
}

.cloud-save-prompt p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.cloud-save-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.82rem;
    color: #e5e7eb;
}

.cloud-save-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.privacy-disclaimer-box {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.disclaimer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
}

.tracking-history-note {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #fde68a;
}

.tracking-history-note strong {
    color: #fbbf24;
}

.chart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 10px;
}

.chart-footer-left,
.chart-footer-center,
.chart-footer-right,
.footer-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-label,
.stat-muted {
    color: var(--text-muted);
    font-weight: 500;
}

.meta-value,
.stat-bold {
    color: #ffffff;
    font-weight: 600;
    font-family: var(--font-mono);
}

.chart-footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.16);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.78rem;
    color: #fde68a;
    font-weight: 500;
}

.tracking-history-note svg,
.chart-footer-note svg {
    flex-shrink: 0;
}

.chart-footer-note strong {
    color: #fbbf24;
}