@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #5B21B6;
    /* Deep Spiritual Violet */
    --primary-light: #7C3AED;
    --primary-dark: #6d28d9;
    --primary-soft: #f5f3ff;
    --primary-glow: rgba(124, 58, 237, 0.4);
    --progress-bg: #f1f5f9;
    --bg: #fafafa;
    --surface: #ffffff;
    --border: #F1F5F9;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --radius: 1rem;
    --radius-sm: 0.75rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.font-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
}

/* --- Layout --- */
.main-content {
    min-height: 100vh;
    padding-top: 7.5rem;
    /* Increased from 5rem */
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .main-content {
        padding: 6.5rem 1rem 1.5rem 1rem;
        /* Increased top from 5rem */
        /* Restoring 1rem for tighter mobile feel */
    }
}

/* --- Components --- */
/* Sidebar nav-items removed */

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
    display: flex;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: scale(0.98);
}

.icon-btn {
    padding: 0.75rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.icon-btn:hover {
    background-color: var(--bg);
    color: var(--primary);
    transform: scale(1.1);
}

/* --- Table --- */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    text-align: left;
    padding: 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--bg);
    background-color: #fafafa;
}

.modern-table td {
    padding: 1.5rem;
    border-bottom: 1px solid var(--bg);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: background-color 0.3s ease;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.modern-table tr:hover td {
    background-color: #fefefe;
}

/* --- Badges --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1.25rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.active {
    background-color: var(--primary-soft);
    color: var(--primary);
}

.status-badge.closed {
    background-color: #f1f5f9;
    color: #94a3b8;
}

/* --- Action Cards & Animations --- */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.action-card-premium {
    background: linear-gradient(-45deg, #ffffff, #fdfaff, #f5f3ff, #ffffff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(124, 58, 237, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem !important;
    /* Fixed padding for alignment */
}

.action-card-premium:hover {
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 0 20px 40px -15px var(--primary-glow);
}

@media (max-width: 768px) {
    .action-card-premium {
        padding: 1.5rem !important;
    }

    .action-card-premium h2 {
        font-size: 1.5rem;
    }
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}

.action-card-premium:hover .orb-1 {
    transform: scale(1.5) translate(-10%, -10%);
    background: rgba(124, 58, 237, 0.15);
}

.action-card-premium:hover .orb-2 {
    transform: scale(1.8) translate(10%, 10%);
    background: rgba(124, 58, 237, 0.1);
}

.glass-input {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.05);
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.inline-edit-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--primary);
    font-weight: bold;
    color: var(--text-main);
    padding: 0 4px;
    width: 140px;
    outline: none;
}

.bg-primary {
    background-color: var(--primary) !important;
}

/* --- Pricing Cards --- */
.price-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s;
}

.price-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.price-card.featured {
    border: 2px solid var(--primary);
}

/* --- Interactions --- */
.page-view {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Grid Parity --- */
#home-card-container>div {
    display: flex;
    flex-direction: column;
}

#history-table-container {
    transition: all 0.5s ease-in-out;
}

.modern-table th.text-center,
.modern-table td:nth-child(3) {
    text-align: center;
}

.modern-table td:nth-child(3) .flex {
    justify-content: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--soft);
    border-radius: 10px;
}