:root {
    --bg-primary: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --accent-neon: #0ea5e9;
    --accent-purple: #2563eb;
    --text-main: #0b1220;
    --text-muted: #334155;
    --glass-bg: rgba(255, 255, 255, 0.98);
    --glass-border: rgba(15, 23, 42, 0.18);
    --neon-glow: 0 0 10px rgba(14, 165, 233, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background: radial-gradient(circle at 50% 0%, #ffffff 0%, #edf2f8 55%, var(--bg-primary) 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 1240px;
}

header {
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInDown 0.8s ease-out;
}

.auth-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.auth-status {
    font-size: 0.82rem;
    color: #334155;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    background: #ffffff;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.heading-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(14, 165, 233, 0.35);
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    margin-bottom: 12px;
}

h1 {
    font-size: 2.35rem;
    font-weight: 700;
    letter-spacing: 0.4px;
}

h1 span {
    color: var(--accent-neon);
    text-shadow: none;
}

header p {
    color: var(--text-muted);
    font-size: 1.02rem;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.45;
}

.tool-tags {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tool-tag {
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.78rem;
    color: #1e293b;
    background: #ffffff;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
}

.tool-tag.is-active {
    border-color: rgba(14, 165, 233, 0.45);
    color: #0369a1;
    background: rgba(14, 165, 233, 0.1);
}

.hero-search {
    margin: 14px auto 0;
    max-width: 560px;
    display: flex;
    gap: 8px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 999px;
    padding: 6px;
}

.hero-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    padding: 8px 12px;
    outline: none;
}

.hero-search-btn {
    border: none;
    border-radius: 999px;
    background: linear-gradient(100deg, #2458d8 0%, #19c8da 100%);
    color: #fff;
    font-weight: 600;
    padding: 9px 16px;
    cursor: pointer;
}

.workspace-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

.tool-main {
    min-width: 0;
}

.tool-catalog-panel {
    margin-bottom: 0;
    background: linear-gradient(175deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
}

.tool-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
}

.tool-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.tool-card {
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 14px;
    background: #ffffff;
    padding: 1rem;
    min-height: 168px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tool-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

.tool-card.is-active {
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.2);
}

.tool-card-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
}

.tool-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #075985;
    border: 1px solid rgba(14, 165, 233, 0.35);
    background: rgba(14, 165, 233, 0.12);
}

.tool-card:nth-child(2) .tool-icon {
    border-color: rgba(255, 171, 87, 0.5);
    color: #ffd4a0;
    background: rgba(255, 171, 87, 0.15);
}

.tool-card:nth-child(3) .tool-icon {
    border-color: rgba(172, 196, 255, 0.5);
    color: #d6e4ff;
    background: rgba(172, 196, 255, 0.14);
}

.tool-card:nth-child(4) .tool-icon {
    border-color: rgba(193, 161, 255, 0.5);
    color: #e4d2ff;
    background: rgba(193, 161, 255, 0.14);
}

.tool-card h3 {
    font-size: 1.08rem;
    color: var(--text-main);
    margin: 0;
    flex: 1;
    min-width: 140px;
}

.tool-card p {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.4;
}

.tool-badge {
    border: 1px solid rgba(15, 23, 42, 0.2);
    color: #334155;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.tool-badge-live {
    border-color: rgba(14, 165, 233, 0.45);
    color: #0369a1;
    background: rgba(14, 165, 233, 0.12);
}

.tool-catalog-message {
    margin-top: 0.9rem;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(37, 99, 235, 0.28);
    background: rgba(37, 99, 235, 0.1);
    color: #1e3a8a;
    font-size: 0.9rem;
}

.site-footer {
    margin-top: 1rem;
    text-align: center;
    color: #475569;
    font-size: 0.86rem;
    padding: 0.35rem 0 1.2rem;
}

.site-footer a {
    color: #0f4fa8;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 1040px) {
    .workspace-layout {
        grid-template-columns: 1fr;
    }

    .tool-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .hero-search {
        max-width: 100%;
    }

    .tool-catalog-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(37, 99, 235, 0.22);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.14);
    padding-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    color: var(--text-main);
}

/* Form Controls */
.field-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.neon-input {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.22);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 8px;
    outline: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.neon-input:focus {
    border-color: var(--accent-neon);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.neon-input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

select option {
    background: #ffffff;
    color: var(--text-main);
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed rgba(15, 23, 42, 0.3);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(148, 163, 184, 0.12);
}

.file-drop-zone p {
    font-size: 1.1rem;
    margin-top: 10px;
    font-weight: 600;
    color: #0f172a;
}

.file-drop-zone span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--accent-neon);
    background: rgba(14, 165, 233, 0.08);
}

.file-drop-zone svg {
    color: var(--accent-neon);
    transition: transform 0.3s ease;
}

.file-drop-zone:hover svg {
    transform: translateY(-5px);
}

.sample-template-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: #0c4a6e;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.sample-template-link:hover {
    text-decoration: underline;
}

.holidays-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.holidays-small-btn {
    width: auto;
    padding: 10px 14px;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.holidays-summary {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.holidays-list-compact {
    max-height: 180px;
    overflow-y: auto;
}

.holidays-list-compact li {
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: #075985;
}

/* Button */
.primary-btn {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 12px;
    background: linear-gradient(100deg, #2458d8 0%, #2f8ee0 55%, #19c8da 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 10px 14px;
    border: 1px solid rgba(15, 23, 42, 0.22);
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.45);
    transform: translateY(-1px);
}

.secondary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.secondary-actions {
    margin-top: 0.8rem;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.advanced-actions {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    padding: 8px 10px;
}

.advanced-actions summary {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.advanced-actions-body {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.onboarding-card {
    margin-top: 0.9rem;
    padding: 0.8rem;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
}

.onboarding-card h3 {
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 0.45rem;
}

.onboarding-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.onboarding-card li {
    font-size: 0.84rem;
    color: #334155;
    padding-left: 22px;
    position: relative;
}

.onboarding-card li::before {
    content: "○";
    position: absolute;
    left: 0;
    top: 0;
    color: #475569;
}

.onboarding-card li.done {
    color: #065f46;
}

.onboarding-card li.done::before {
    content: "✓";
    color: #059669;
    font-weight: 700;
}

.primary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: linear-gradient(100deg, #9caec8 0%, #90a4c4 100%);
    box-shadow: none;
}

.primary-btn.glow-effect:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
    filter: brightness(1.04);
}

.primary-btn:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.2);
}

.inline-status {
    margin-top: 0.9rem;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.95rem;
    text-align: center;
    transition: opacity 0.25s ease;
}

.inline-status.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: #b91c1c;
}

.inline-status.warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #92400e;
}

.inline-status.success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #065f46;
}

/* Results & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 1.8rem;
    font-weight: 800;
}

.stat-card p.highlight {
    color: var(--accent-neon);
    text-shadow: none;
}

.eligibility-summary-card {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    padding: 1rem;
}

.eligibility-summary-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #0f172a;
}

.eligibility-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 0.7rem;
}

.eligibility-summary-item {
    border: 1px solid rgba(15, 23, 42, 0.11);
    border-radius: 10px;
    padding: 10px;
    background: #ffffff;
}

.eligibility-summary-item p {
    font-size: 0.78rem;
    color: #475569;
    margin-bottom: 4px;
}

.eligibility-summary-item strong {
    font-size: 1rem;
    color: #0f172a;
}

/* Chart Canvas */
.chart-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    height: 400px;
    width: 100%;
}

.data-qa-panel {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.88);
}

.data-qa-panel h3 {
    margin-bottom: 0.8rem;
    font-size: 1rem;
    color: var(--text-main);
}

.data-qa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.7rem;
    margin-bottom: 0.8rem;
}

.data-qa-item {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    padding: 10px;
}

.data-qa-item p {
    font-size: 0.78rem;
    color: #475569;
    margin-bottom: 4px;
}

.data-qa-item strong {
    font-size: 0.98rem;
    color: #0f172a;
}

.qa-warnings-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qa-warnings-list li {
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #334155;
    background: rgba(148, 163, 184, 0.12);
}

.qa-warnings-list li.warning {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

.qa-warnings-list li.success {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
}

/* Badges */
.badge {
    background: rgba(14, 165, 233, 0.12);
    color: var(--accent-neon);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--accent-neon);
}

/* Selected Days Info */
.selected-days-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(15, 23, 42, 0.14);
}

.selected-days-info p {
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--text-main);
}

.selected-days-info ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.selected-days-info li {
    background: rgba(37, 99, 235, 0.08);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.list-warning li {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #92400e;
}

.list-danger li {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.list-muted li {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #475569;
}

.list-coverage li {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.28);
    color: #9a3412;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #ffffff;
    border-left: 4px solid var(--accent-neon);
    padding: 15px 25px;
    border-radius: 8px;
    color: var(--text-main);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 1000;
}

.toast.hidden {
    transform: translateX(120%);
    opacity: 0;
}

.hidden {
    display: none;
}

.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 1rem;
}

.auth-modal.hidden {
    display: none !important;
}

.auth-modal-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.auth-modal-card h3 {
    font-size: 1.05rem;
    color: #0f172a;
}

.auth-modal-card p {
    color: #475569;
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.auth-modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.auth-message {
    min-height: 18px;
    font-size: 0.82rem;
    color: #475569;
}

.run-details-content {
    font-size: 0.86rem;
    color: #334155;
    line-height: 1.45;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    padding: 0.75rem;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.auth-recovery-block {
    margin-top: 0.35rem;
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.07);
    border-radius: 10px;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.account-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 1rem;
}

.account-card {
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    background: #ffffff;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-card h3 {
    font-size: 1rem;
    color: #0f172a;
}

.account-muted {
    color: #475569;
    font-size: 0.86rem;
}

.history-table-wrap {
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 10px;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.history-table th,
.history-table td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    padding: 8px 10px;
    text-align: left;
    font-size: 0.82rem;
    color: #334155;
}

.history-table th {
    color: #0f172a;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.08);
}

.history-table tbody tr {
    cursor: pointer;
}

.history-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.06);
}

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

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.pulse-ring {
    width: 15px;
    height: 15px;
    background: var(--accent-neon);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-neon);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(0, 240, 255, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 240, 255, 0);
    }
}
