/* Global Styling - Refined for "Pixel Perfect" Dashboard */
/* Global Styling - Refined for "Pixel Perfect" Dashboard */
:root {
    --bg-dark: #020205;
    /* Deepest Void */
    --surface-dark: #080a10;
    /* Dark Panel */
    --surface-light: #12141c;
    /* Lighter Panel */
    --border-color: rgba(255, 255, 255, 0.08);
    /* Subtle white border */

    --text-primary: #f8fafc;
    /* Crisp White */
    --text-secondary: #94a3b8;
    /* Slate 400 */

    --accent-primary: #38bdf8;
    /* Sky Blue - softer/spacey */
    --accent-secondary: #818cf8;
    /* Indigo - deep spacey */
    --accent-purple: #c084fc;

    --status-active: #22d3ee;
    /* Cyan */
    --status-queue: #60a5fa;
    /* Blue */
    --status-archive: #475569;

    --font-heading: 'Orbitron', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --shadow-card: 0 8px 20px -4px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
}

/* Header - Transparent/Glass */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 64px;
    /* Slightly taller */
    background: rgba(8, 10, 16, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

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

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: white;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.main-nav {
    display: flex;
    gap: 32px;
    height: 100%;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    height: 100%;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    padding: 0 4px;
    letter-spacing: 0.5px;
}

.nav-item:hover {
    color: white;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.nav-item.active {
    color: white;
    border-bottom-color: var(--accent-primary);
}

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

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    /* Softer corners */
    padding: 8px 12px;
    width: 260px;
    transition: all 0.3s;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    margin-left: 10px;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
    font-family: var(--font-body);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 1.1rem;
}

.icon-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-secondary);
    border: 2px solid var(--surface-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* Main Content */
#main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-dark);
}

#main-content::-webkit-scrollbar {
    width: 8px;
}

#main-content::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

#main-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.view-section {
    max-width: 1600px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-out;
}

.hidden-view {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: white;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 700px;
}

/* Filter Bar - Horizontal & Sleek */
.filter-bar {
    display: flex;
    gap: 16px;
    background: var(--surface-dark);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    align-items: flex-end;
    box-shadow: var(--shadow-card);
}

.filter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

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

select,
input[type="text"] {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

select:focus,
input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.filter-actions {
    display: flex;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    height: 38px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-secondary), #00c3ff);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 119, 255, 0.3);
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-card);
}

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

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag {
    font-size: 0.65rem;
    background: var(--surface-light);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Charts */
.chart-area {
    height: 220px;
    width: 100%;
    position: relative;
}

/* Bar Chart */
.bar-chart-mockup {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 10px 10px 10px;
    height: 100%;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to top, rgba(255, 255, 255, 0.02), transparent 50%);
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 12%;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
    border-top: 2px solid var(--accent-primary);
    opacity: 0.8;
    position: relative;
    border-radius: 2px 2px 0 0;
}

/* Grid lines for chart */
.bar-chart-mockup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 100% 40px;
    opacity: 0.3;
    pointer-events: none;
}

.bar-group .label {
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Line Chart */
.line-chart-mockup {
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    height: 100%;
}

.line-chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 10px;
}

.chart-labels span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Table */
.table-card {
    padding: 0;
    overflow: hidden;
}

/* Flush table */
.table-card .card-header {
    padding: 20px 20px 15px 20px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.data-table tr:hover {
    background: rgba(0, 240, 255, 0.03);
}

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

.highlight-text {
    color: var(--accent-primary) !important;
    font-weight: 500;
}

.status-chip {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    display: inline-block;
}

.status-chip.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-active);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-chip.queue {
    background: rgba(14, 165, 233, 0.1);
    color: var(--status-queue);
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.status-chip.archived {
    background: rgba(100, 116, 139, 0.1);
    color: var(--status-archive);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Table Footer */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-dark);
}

.pagination button {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    min-width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 4px;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--text-secondary);
    color: white;
}

.pagination button.active {
    background: var(--accent-secondary);
    color: white;
    border-color: var(--accent-secondary);
    box-shadow: 0 2px 5px rgba(0, 119, 255, 0.3);
}

/* Footer Stats */
.footer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.stat-card {
    background: linear-gradient(180deg, var(--surface-dark) 0%, rgba(20, 24, 32, 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-secondary);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: rgba(0, 119, 255, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.stat-icon.purple {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    line-height: 1.1;
    margin-bottom: 4px;
    font-family: var(--font-heading);
}

.stat-value small {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-trend.positive {
    color: var(--status-active);
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    background: var(--surface-dark);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-links a {
    color: var(--text-secondary);
    margin-left: 20px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

/* Utilities */


.icon-btn-small {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.icon-btn-small:hover {
    opacity: 1;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .footer-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}