@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* TallyPrime Colors */
    --primary: #1860a3;
    /* Tally Blue */
    --primary-dark: #114578;
    --secondary: #649ccf;
    /* Light Blue */
    --accent: #fdb934;
    /* Tally Gold */
    --accent-dark: #d99a2a;

    /* Backgrounds */
    --bg-gradient: linear-gradient(135deg, #f0f7ff 0%, #e0efff 100%);
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);

    /* Text */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* UI Elements */
    --radius: 16px;
    --nav-height: 70px;
    --shadow-sm: 0 4px 6px -1px rgba(24, 96, 163, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(24, 96, 163, 0.15);

    /* Loader Variables */
    --loader-bg: #f0f7ff;
    --loader-spinner: var(--primary);
    --loader-spinner-alt: var(--accent);

    --tally-blue: var(--primary);
    --tally-gold: var(--accent);
    --bg-main: var(--bg-gradient);
    --border-color: var(--glass-border);
}

/* --- 🌑 PREMIUM AESTHETIC DARK THEME --- */
body.dark-mode {
    /* Backgrounds: Deep Space Gradient */
    --bg-gradient: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e1b4b 100%);
    --bg-main: #020617;

    /* Glassmorphism Cards */
    --card-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);

    /* Neon Accents */
    --primary: #38bdf8;
    /* Sky Blue Neon */
    --primary-dark: #0ea5e9;
    --accent: #eeac1d;
    /* Pink Neon */
    --accent-glow: rgba(56, 189, 248, 0.5);

    /* Text */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #64748b;

    /* UI */
    --shadow-sm: 0 4px 20px -5px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.8);
    --nav-glass: rgba(2, 6, 23, 0.8);
}

body.dark-mode {
    background-attachment: fixed;
}

/* Glass Navbar */
body.dark-mode .navbar {
    background: var(--nav-glass);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Glowing Headings */
body.dark-mode h1,
body.dark-mode h2 {
    background: linear-gradient(to right, #fff, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
}

/* Animated Cards */
body.dark-mode .tool-card,
body.dark-mode .card,
body.dark-mode .tip-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
    will-change: transform;
    position: relative;
    overflow: hidden;
}

body.dark-mode .tool-card:hover,
body.dark-mode .tip-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -10px var(--accent-glow);
}

/* Shine Effect */
body.dark-mode .tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

body.dark-mode .tool-card:hover::before {
    left: 100%;
}

/* Neon Buttons */
body.dark-mode .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 0 15px var(--accent-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #000 !important;
}

body.dark-mode .btn-primary:hover {
    box-shadow: 0 0 25px var(--primary);
    transform: translateY(-3px);
}

body.dark-mode .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--glass-border);
}

body.dark-mode .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* Dark Mode Inputs */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .search-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: white;
    transition: 0.3s;
}

body.dark-mode input:focus,
body.dark-mode .search-input:focus {
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

/* Paper Protections */
body.dark-mode .invoice-paper,
body.dark-mode .payslip-preview {
    background: #fff !important;
    color: #000 !important;
    border: none !important;

    /* Force Light Mode Variables locally */
    --primary: #1860a3 !important;
    --primary-dark: #114578 !important;
    --tally-blue: #1860a3 !important;
    --tally-gold: #fdb934 !important;
    --text-main: #1e293b !important;
    --text-muted: #64748b !important;
    --text-light: #94a3b8 !important;
}

/* Force specific elements to ignore Dark Mode Text Effects */
body.dark-mode .invoice-paper h1,
body.dark-mode .invoice-paper h2,
body.dark-mode .invoice-paper h3,
body.dark-mode .payslip-preview h1,
body.dark-mode .payslip-preview h2,
body.dark-mode .payslip-preview h3,
body.dark-mode .payslip-preview .section-title {
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: initial !important;
    text-shadow: none !important;
    color: var(--tally-blue) !important;
}

body.dark-mode .invoice-paper input,
body.dark-mode .payslip-preview input {
    color: #000 !important;
    border-color: transparent !important;
}

@media print {

    /* Hide UI Elements */
    header,
    footer,
    .navbar,
    .back-link,
    .btn-primary,
    .no-print {
        display: none !important;
    }

    /* Force Page Background */
    html,
    body {
        background: white !important;
        background-color: white !important;
        background-image: none !important;
        color: black !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    body.dark-mode {
        background: white !important;
        background-color: white !important;
        background-image: none !important;
        color: black !important;
        --text-main: #000 !important;
        --card-bg: white !important;
        --bg-gradient: none !important;
    }

    body.dark-mode .invoice-paper,
    body.dark-mode .payslip-preview {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
    }

    body.dark-mode input,
    body.dark-mode textarea {
        color: black !important;
        background: transparent !important;
        border: none !important;
    }

    /* General Print Safety */
    * {
        color: black !important;
        background-color: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Exceptions for backgrounds we want to keep (like headers/logos) if any */
    .brand-strip,
    .net-pay-box,
    th {
        background-color: transparent !important;
        /* Let specific page print styles handle this or reset if needed */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Re-apply backgrounds for specific colored elements that must print */
    .net-pay-box {
        background-color: var(--tally-blue) !important;
        color: white !important;
    }

    .net-pay-box span {
        color: white !important;
    }

    .payslip-table th {
        color: #64748b !important;
    }

    /* Reset Invoice Specifics */
    .invoice-paper,
    .payslip-preview {
        background: white !important;
    }
}




* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    padding-top: var(--nav-height);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* --- Layout --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.tool-container {
    max-width: 900px;
    margin: 4rem auto;
    padding: 2rem;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
    color: var(--primary);
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.25rem, 8vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
}

.back-link:hover {
    color: var(--primary);
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(24, 96, 163, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(24, 96, 163, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    background: white;
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.btn-secondary.sm {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

.btn-secondary:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

/* --- Cards --- */
.card,
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 2rem;
    will-change: transform;
}

.minimal-card {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Tools Grid --- */
.tools-grid,
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 5%;
}

.tool-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    will-change: transform;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(24, 96, 163, 0.15);
    border-color: rgba(255, 255, 255, 0.9);
}

.tool-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* If form is direct child of body or main container for login pages */
.auth-form {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    margin: 2rem auto;
    animation: fadeUp 0.6s ease-out 0.2s backwards;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.minimal-input {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.minimal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(24, 96, 163, 0.1);
    background: white;
}

/* --- specialized sections --- */

.upload-area {
    margin-top: 2rem;
    border: 2px dashed #cbd5e1;
    padding: 2rem;
    text-align: center;
    border-radius: 12px;
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    transition: border-color 0.3s ease, background-color 0.3s ease;
    will-change: background-color, border-color;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(24, 96, 163, 0.05);
}

/* Dark Mode Upload Area */
body.dark-mode .upload-area {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--glass-border);
}

body.dark-mode .upload-area:hover,
body.dark-mode .upload-area.dragover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--primary);
}

.mode-switch-box {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: #f8fafc;
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

body.dark-mode .mode-switch-box {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--glass-border);
    color: var(--text-main);
}

/* Dark Mode Minimal Card Override */
body.dark-mode .minimal-card {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--glass-border);
}

/* Ensure inputs in minimal cards are visible */
body.dark-mode .minimal-input {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--glass-border);
    color: var(--text-main);
}

body.dark-mode .minimal-input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.upload-btn-floating {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.config-section {
    margin-top: 2rem;
}

.section-title {
    margin-bottom: 1rem;
    color: var(--tally-blue);
    border-bottom: 2px solid var(--tally-gold);
    padding-bottom: 0.5rem;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.guide-box {
    background: #eff6ff;
    border-left: 4px solid var(--tally-blue);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.guide-list {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    color: #33baf6;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
}

.preview-table th {
    background: #f1f5f9;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid #e2e8f0;
}

.preview-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-main);
}

.preview-table tr:last-child td {
    border-bottom: none;
}

.logo-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 60px;
    width: auto;
    display: block;
}

.user-badge-container {
    display: flex;
    align-items: center;
    transform: translateY(-5px) scale(0.85);
}

.badge-premium,
.badge-starter,
.badge-free {
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-premium {
    background: var(--accent);
    color: #000000;
}

.badge-starter {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-free {
    background: #f3f4f6;
    color: #4b5563;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: 0.3s;
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 5rem 1rem;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeUp 0.8s ease-out;
}

.hero-sm {
    padding: 3rem 1rem;
    padding-bottom: 1rem;
}

/* --- Loaders --- */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--loader-bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
    /* CSS Failsafe: Force hide after 4 seconds if JS fails */
    animation: forceHide 0.5s ease 4s forwards;
    pointer-events: all;
}

@keyframes forceHide {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* Tally Cube Animation */
.spinner-cube {
    width: 40px;
    height: 40px;
    background: var(--loader-spinner);
    animation: rotatePlane 1.2s infinite ease-in-out;
}

@keyframes rotatePlane {
    0% {
        transform: perspective(120px) rotateX(0deg) rotateY(0deg);
    }

    50% {
        transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
        background: var(--loader-spinner-alt);
    }

    100% {
        transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
    }
}

#processing-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 9000;
    display: none;
    /* Toggled by JS */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.processing-content {
    text-align: center;
}

.processing-text {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    animation: pulse 1.5s infinite;
}

/* --- Animations --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(24, 96, 163, 0.2);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 15px 5px rgba(24, 96, 163, 0.3);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(24, 96, 163, 0.2);
    }
}

@keyframes drift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

@keyframes driftAlt {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-50px, 40px) rotate(-180deg);
    }

    100% {
        transform: translate(0, 0) rotate(-360deg);
    }
}

/* --- Utilities & Animations --- */
.animate-fade-up {
    animation: fadeUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}


/* --- Status Boxes --- */
.status-box {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    display: none;
}

.status-box:not(:empty) {
    display: block;
}

.status-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.status-warning {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

/* --- Tips & Knowledge Base --- */
.search-container {
    max-width: 600px;
    margin: 2rem auto 3rem auto;
    position: relative;
    z-index: 10;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 8px 25px rgba(24, 96, 163, 0.15);
    border-color: var(--primary);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.4);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(24, 96, 163, 0.3);
}

.tips-section {
    padding-bottom: 5rem;
}

/* Tip Cards */
.tip-card {
    cursor: pointer;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}

.tip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.tip-icon {
    font-size: 2.2rem;
    background: rgba(255, 255, 255, 0.6);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.tip-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.8rem;
    color: var(--text-main);
    font-weight: 700;
}

.tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    height: fit-content;
}

.tag.prime {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.tag.erp {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.tag.banking {
    background: #ecfccb;
    color: #3f6212;
    border: 1px solid #d9f99d;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    width: 100%;
    max-width: 650px;
    border-radius: 24px;
    padding: 3rem;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 1);
}

.modal-overlay.open .modal-content {
    transform: scale(1) translateY(0);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: var(--primary);
    color: white;
}

.modal-body h2 {
    margin-right: 2rem;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-body h4 {
    color: var(--primary-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 0.3rem;
}

.modal-body p {
    color: var(--text-main);
    line-height: 1.7;
}

.modal-body ol,
.modal-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.modal-body li {
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
}

kbd {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-bottom-width: 3px;
    border-radius: 6px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    display: inline-block;
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px;
    white-space: nowrap;
    font-family: 'Consolas', monospace;
    margin: 0 3px;
}

/* Table Responsiveness */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.preview-table {
    width: 100%;
    /* Scoped min-width is now handled in the responsive section */
}

/* --- Watermark --- */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 5rem;
    color: rgba(0, 0, 0, 0.08);
    z-index: 100;
    pointer-events: none;
    white-space: nowrap;
    font-weight: 800;
    text-transform: uppercase;
    display: block;
    user-select: none;
    width: 100%;
    text-align: center;
}

@media print {
    .watermark {
        display: block !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

@media print {

    .navbar,
    footer,
    .no-print,
    #theme-toggle {
        display: none !important;
    }

    body {
        background: white;
        padding-top: 0;
    }
}

/* --- Theme Toggle Switch --- */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.theme-switch {
    display: inline-block;
    height: 26px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background: #eff6ff;
    /* Light Blue tint */
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    border: 2px solid #bfdbfe;
    /* Visible Blue Border */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.slider:before {
    background-color: #3b82f6;
    /* Primary Blue Knob */
    bottom: 3px;
    content: '';
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Dark Mode State */
input:checked+.slider {
    background: #1e293b;
    border-color: #475569;
}

input:checked+.slider:before {
    transform: translateX(24px);
    background-color: #fdb934;
    /* Gold Knob */
    box-shadow: 0 0 8px rgba(253, 185, 52, 0.4);
}

.slider-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    z-index: 1;
    transition: opacity 0.3s;
    line-height: 1;
    pointer-events: none;
    font-weight: bold;
}

.moon-icon {
    right: 6px;
    color: #94a3b8;
}

.sun-icon {
    left: 6px;
    color: #e2e8f0;
    opacity: 0;
}

input:checked+.slider .sun-icon {
    opacity: 1;
}

input:checked+.slider .moon-icon {
    opacity: 0;
}

/* --- Portfolio Layout Additions --- */

/* Hero Large */
.hero-large {
    /* Subtract nav height to fit exactly in viewport */
    min-height: calc(100vh - var(--nav-height));
    /* Fallback for browsers not supporting dvh */
    min-height: calc(100dvh - var(--nav-height));

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.8s ease-out;
}

.section-fullscreen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5rem 1rem;
    will-change: transform;
    transform: translateZ(0);
}

.auth-box {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .section-fullscreen {
        height: auto;
        min-height: 100vh;
        padding: 4rem 1rem;
        justify-content: center;
    }
}

.scroll-down-wrapper {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 10;
}

.scroll-down-arrow {
    width: 20px;
    height: 20px;
    border-right: 3px solid var(--primary);
    border-bottom: 3px solid var(--primary);
    transform: rotate(45deg);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}


.hero-large::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(24, 96, 163, 0.08) 0%, transparent 60%);
    animation: drift 25s linear infinite;
    z-index: -1;
    border-radius: 40%;
    filter: blur(40px);
}

.hero-large::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -20%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(100, 156, 207, 0.08) 0%, transparent 60%);
    animation: driftAlt 30s linear infinite;
    z-index: -1;
    border-radius: 45%;
    filter: blur(50px);
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hero-large .hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(24, 96, 163, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(24, 96, 163, 0.2);
    animation: heartbeat 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.hero-large h1 {
    font-size: clamp(3rem, 10vw, 5rem);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-large h1 span {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-large .subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 300;
}

/* About Section */
.about-section {
    padding: 5rem 0;
    position: relative;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.about-img-box {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.about-img-box img {
    width: 100%;
    display: block;
    transition: transform 0.5s;
}

.about-img-box:hover img {
    transform: scale(1.05);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 3rem;
}

/* Specific Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.skill-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

/* Featured Projects (Tools) */
.projects-section {
    padding: 5rem 0;
    background: rgba(24, 96, 163, 0.02);
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-thumb {
    height: 200px;
    background: linear-gradient(135deg, rgba(24, 96, 163, 0.1), rgba(100, 156, 207, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.project-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    background: var(--bg-main);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

/* Contact Section */
.contact-section {
    padding: 5rem 0;
    text-align: center;
}

.contact-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

/* Universal Glass Card */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .hero-large h1 {
        font-size: 3rem;
    }
}

/* --- Profile / Usage Utils --- */
.usage-card-success {
    text-align: center;
    padding: 2rem;
    background: #f0fdf4;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    color: #166534;
}

body.dark-mode .usage-card-success {
    background: rgba(4, 120, 87, 0.2);
    border-color: rgba(4, 120, 87, 0.3);
    color: #4ade80;
}

.usage-card-success h3,
.usage-card-success p {
    color: inherit !important;
}

.progress-track {
    background: #e2e8f0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

body.dark-mode .progress-track {
    background: rgba(255, 255, 255, 0.1);
}

.text-muted-soft {
    color: #64748b;
    font-size: 0.85rem;
}

body.dark-mode .text-muted-soft {
    color: #94a3b8;
}

/* --- New Section Classes (for Index) --- */
.section-white {
    background: white;
    padding: 4rem 5%;
    border-top: 1px solid var(--border-color);
}

.section-alt {
    background: var(--bg-main);
    padding: 4rem 5%;
}

body.dark-mode .section-white {
    background: transparent;
    /* Or a very dark shade if preferred */
    border-top-color: var(--glass-border);
}

body.dark-mode .section-alt {
    background: rgba(0, 0, 0, 0.2);
}

/* --- Keyboard Keys (kbd) --- */
kbd {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-bottom-width: 3px;
    border-radius: 6px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    display: inline-block;
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px;
    white-space: nowrap;
    font-family: 'Consolas', monospace;
    margin: 0 3px;
}

body.dark-mode kbd {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* --- PREMIUM ZINC VISIBILITY DARK MODE COMPONENT OVERRIDES --- */

/* Protect Print Papers (Invoice/Payslip) */
body.dark-mode .invoice-paper,
body.dark-mode .payslip-preview {
    background: white !important;
    color: black !important;
    border: none !important;
}

/* Ensure inputs inside white papers are black text */
body.dark-mode .invoice-paper input,
body.dark-mode .invoice-paper textarea,
body.dark-mode .payslip-preview input,
body.dark-mode .payslip-preview textarea,
body.dark-mode .payslip-preview .value,
body.dark-mode .payslip-preview td,
body.dark-mode .payslip-preview th {
    color: black !important;
    background: transparent !important;
    border-color: #e2e8f0 !important;
}

/* Neutral Status Boxes - Premium Zinc */
body.dark-mode .guide-box,
body.dark-mode .status-box {
    background: #18181b;
    /* Zinc 900 */
    border: 1px solid #3f3f46;
    /* Zinc 700 - Distinct */
    color: #e4e4e7;
    /* Zinc 200 */
}

body.dark-mode .status-success {
    background: rgba(4, 120, 87, 0.1);
    color: #4ade80;
    border-color: rgba(4, 120, 87, 0.3);
}

body.dark-mode .status-error {
    background: rgba(185, 28, 28, 0.1);
    color: #fca5a5;
    border-color: rgba(185, 28, 28, 0.3);
}

body.dark-mode .status-warning {
    background: rgba(194, 65, 12, 0.1);
    color: #fdba74;
    border-color: rgba(194, 65, 12, 0.3);
}

/* High Contrast Upload Area */
body.dark-mode .upload-area {
    background: #09090b;
    /* Zinc 950 */
    border: 2px dashed #3f3f46;
    /* Zinc 700 */
}

body.dark-mode .upload-area:hover,
body.dark-mode .upload-area.dragover {
    background: #18181b;
    border-color: var(--primary);
}

body.dark-mode .minimal-card {
    background: #18181b;
    /* Zinc 900 - Lighter than body */
    border: 1px solid #27272a;
    /* Zinc 800 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    /* Depth */
}

/* Dark Mode Tables - Premium Readable */
body.dark-mode .preview-table {
    background: #09090b;
    border: 1px solid #27272a;
    box-shadow: none;
}

body.dark-mode .preview-table th {
    background: #18181b;
    color: #fafafa;
    border-bottom: 1px solid #3f3f46;
    font-weight: 600;
}

body.dark-mode .preview-table td {
    border-bottom: 1px solid #27272a;
    color: #d4d4d8;
    /* Zinc 300 */
}

/* Zebra Striping for Readability */
body.dark-mode .preview-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

body.dark-mode .preview-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Dark Mode Inputs - Visible & Distinct */
body.dark-mode input,
body.dark-mode select,
body.dark-mode .minimal-input,
body.dark-mode .search-input {
    background: #09090b;
    /* Zinc 950 */
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--radius);
    /* Zinc 600 - High Visibility Border */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode .minimal-input:focus,
body.dark-mode .search-input:focus {
    border-color: var(--primary);
    background: #09090b;
    box-shadow: 0 0 0 1px var(--primary);
}

/* Modal Dark Mode */
body.dark-mode .modal-content {
    background: #18181b;
    border: 1px solid #3f3f46;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

body.dark-mode .close-modal {
    background: #27272a;
    color: #e4e4e7;
}

body.dark-mode .filter-btn {
    color: #d4d4d4;
    border-color: #3f3f46;
    background: #18181b;
}

body.dark-mode .filter-btn:hover {
    background: #27272a;
    color: white;
}

/* Standardize Auth Sizing */
.auth-wrapper {
    max-width: 450px;
    margin: 4rem auto;
    padding: 2rem;
    width: 100%;
}

.auth-card {
    padding: 2.5rem;
}

@media (max-width: 768px) {
    .auth-wrapper {
        margin: 2rem auto;
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

body.dark-mode .filter-btn.active {
    background: var(--primary);
    color: #000;
    box-shadow: none;
}

/* Rate Button (GST Calc) */
.rate-btn {
    flex: 1;
    padding: 0.5rem;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.rate-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.rate-btn:hover:not(.active) {
    background: #f1f5f9;
}

body.dark-mode .rate-btn {
    background: #18181b;
    border-color: #3f3f46;
    color: #e5e5e5;
}

body.dark-mode .rate-btn:hover:not(.active) {
    background: #27272a;
}

.icon-box {
    margin-bottom: 1rem;
}

.btn-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-link:hover {
    color: var(--primary-dark);
    gap: 0.75rem;
}


/* New Utility Classes for View Files */
.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-label {
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
}

.hero-btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.section-padding {
    padding: 6rem 5%;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 4rem 1.5rem;
    }
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.tool-card .icon-box {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.step-number {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--tally-blue);
    opacity: 0.2;
    font-weight: 800;
}

.animate-delay-1 .step-number {
    opacity: 0.5;
}

.animate-delay-2 .step-number {
    opacity: 0.8;
}

.heading-center {
    text-align: center;
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .heading-center {
        margin-bottom: 2rem;
    }
}


/* --- 🚀 HIGH-END ANIMATIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section,
.hero,
.grid,
.tool-container {
    width: 100%;
}

/* --- RESPONSIVENESS OVERRIDES --- */

/* Mobile Utility Classes */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 1.5rem 1rem;
    }

    .grid,
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }

    .tool-container {
        margin: 2rem auto;
        padding: 1rem;
    }
}

/* Admin Nav Responsive */
.admin-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    overflow-x: auto;
    /* Enable horizontal scrolling */
    white-space: nowrap;
    /* Prevent wrapping */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.admin-nav-container::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

@media (max-width: 768px) {
    .admin-nav {
        padding: 0.75rem 0;
    }

    .admin-nav h3 {
        font-size: 1.1rem;
        margin-right: 1.5rem;
    }

    .admin-nav a {
        font-size: 0.9rem;
        margin-right: 1rem;
    }

    .admin-nav a.exit-link {
        font-size: 0.85rem;
    }
}

/* Profile Page Responsive Classes */
.profile-header {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--tally-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.profile-info {
    flex-grow: 1;
    min-width: 250px;
}

/* Fix Long Email Overflow */
.profile-info h2 {
    word-break: break-word;
    overflow-wrap: break-word;
}

.profile-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Standard Stats Row */
.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .profile-info {
        width: 100%;
        min-width: 0;
    }

    .profile-meta {
        justify-content: center;
        gap: 0.5rem;
    }

    .profile-actions {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .profile-actions a,
    .profile-actions button {
        width: 100%;
        justify-content: center;
    }

    /* Keep stats row separate but allow wrapping if needed */
    .stats-row {
        flex-direction: row;
        /* Ensure it tries to be a row unless too small */
    }
}

/* Stats Grid Responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    /* allow smaller minimum */
    gap: 1rem;
    margin-bottom: 1.5rem;
}


.grid>div:nth-child(1) {
    animation-delay: 0.1s;
}

.grid>div:nth-child(2) {
    animation-delay: 0.2s;
}

.grid>div:nth-child(3) {
    animation-delay: 0.3s;
}

.grid>div:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.hero h1 {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(56, 189, 248, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    }
}

.btn-primary.animate-pulse {
    animation: pulseGlow 2s infinite;
}

/* --- Task 2: Hero Visibility Fix --- */
.hero h1,
.hero h2 {
    color: var(--text-main);
    /* Fallback */
}

body:not(.dark-mode) .hero h1,
body:not(.dark-mode) .hero h2 {
    color: #1e293b;
    /* legible dark on light bg */
}

body.dark-mode .hero h1,
body.dark-mode .hero h2 {
    color: #f8fafc;
    /* legible light on dark bg */
}

/* --- Task 3: Tools Dark Mode UI Fixes --- */
body.dark-mode .tool-container input,
body.dark-mode .tool-container select,
body.dark-mode .tool-container textarea {
    background-color: #1e1e1e !important;
    color: #e5e5e5 !important;
    border-color: #404040 !important;
}

body.dark-mode .tool-container input:focus,
body.dark-mode .tool-container select:focus,
body.dark-mode .tool-container textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

body.dark-mode .tool-container table {
    background-color: #1e1e1e;
    color: #e5e5e5;
    border-color: #404040;
}

body.dark-mode .tool-container th {
    background-color: #262626;
    color: #fbbf24;
    /* highlight header text */
    border-color: #404040;
}

body.dark-mode .tool-container td {
    border-color: #404040;
}


/* --- Hero Refinement: Visibility & Attraction --- */
.hero {
    position: relative;
    overflow: visible;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(600px, 90vw);
    /* Responsive Glow */
    height: min(600px, 90vw);
    background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, rgba(56, 189, 248, 0) 70%);
    pointer-events: none;
    z-index: -1;
}

.hero-title-main {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 2rem;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.hero-tagline {
    font-size: 0.45em;
    display: block;
    margin-top: 1.5rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 1px;
}

.hero-description {
    font-size: 1.25rem;
    color: #475569;
    max-width: 700px;
    margin: 2.5rem auto !important;
    line-height: 1.6;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Dark Mode Overrides for Hero */
html.dark-mode .hero-title-main {
    color: #f8fafc !important;
    text-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
}

html.dark-mode .hero-tagline {
    color: #94a3b8 !important;
}

html.dark-mode .hero-description {
    color: #cbd5e1 !important;
}

/* Fix global dark mode selector to include html tag */
html.dark-mode body {
    background: var(--bg-main) !important;
    color: var(--text-main) !important;
}


/* ============================================================
   GLOBAL RESPONSIVE REBOOT (Task Fix)
   ============================================================ */

/* 1. Base Container Scaling */
.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* 2. Responsive Grids */
.grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 1.5rem !important;
}

/* 3. Hero Section Fluidity */
.hero {
    padding: 6rem 5% !important;
    text-align: center;
}

.hero-title-main {
    font-size: clamp(2rem, 10vw, 4.5rem) !important;
    width: 100%;
    word-wrap: break-word;
}

.hero-description {
    font-size: clamp(1rem, 4vw, 1.25rem) !important;
    padding: 0 10px;
}

/* 4. Navigation & Hamburger (Unified Fix) */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media screen and (max-width: 991px) {
    .hamburger {
        display: flex !important;
        cursor: pointer;
        z-index: 1002;
        position: relative;
    }

    .logo img {
        height: 32px !important;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px !important;
        height: 100vh;
        background: var(--bg-main);
        padding: 5rem 2rem !important;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        border-left: 1px solid var(--glass-border);
    }

    body.dark-mode .nav-links {
        background: #020617;
        /* Slate 950 for better contrast */
    }

    .nav-links.active {
        right: 0 !important;
    }

    .nav-links li,
    .nav-links a {
        margin: 0.75rem 0 !important;
        width: 100%;
        font-size: 1.1rem;
    }

    /* Tool dropdown on mobile */
    .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        background: rgba(0, 0, 0, 0.05) !important;
        padding-left: 1rem !important;
        box-shadow: none !important;
        margin-top: 0.5rem;
    }

    /* Scaling Fixes */
    .grid,
    .tools-grid,
    .config-grid {
        /* Allow 2 columns on tablet, but ensure they don't get too squashed */
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
        gap: 1.5rem !important;
    }

    @media (max-width: 600px) {

        .grid,
        .tools-grid,
        .config-grid {
            grid-template-columns: 1fr !important;
        }
    }

    .container,
    .tool-container {
        width: 100% !important;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar {
        padding: 0 1rem !important;
    }

    .logo img {
        height: 30px !important;
    }

    .user-badge-container {
        transform: scale(0.7) translateX(-10px);
    }

    .navbar {
        padding: 0 1rem !important;
    }

    .logo img {
        height: 40px !important;
    }

    .user-badge-container {
        transform: scale(0.7) translateX(-10px);
    }

    .hero-title-main {
        font-size: clamp(2rem, 10vw, 3rem) !important;
    }

    /* Standard Grid Stacking */
    /* Standard Grid Stacking - Only stack on mobile (<768px) */
    @media (max-width: 768px) {

        .grid-2,
        .grid-3 {
            grid-template-columns: 1fr !important;
            gap: 1.5rem !important;
        }
    }

    /* Profile Adjustments */
    .profile-header {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1.5rem !important;
    }

    .stats-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    /* Tool Stacking */
    .payslip-container,
    .screen-wrapper .header-grid,
    .meta-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .invoice-paper,
    .payslip-preview {
        padding: 1rem !important;
        width: 100% !important;
        min-width: auto !important;
    }
}

/* 6. Utility Spacing */
section {
    padding: 4rem 15px !important;
}

/* 7. Image Responsiveness */
img {
    max-width: 100%;
    height: auto;
}

/* 8. Table Responsiveness */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.table-responsive table {
    min-width: 600px;
    /* Only force width inside scrollable container */
}

table {
    width: 100%;
    border-collapse: collapse;
}


/* --- Mobile Menu Cross Animation --- */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Skills Grid - Home Page Fix */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 3rem auto 0;
}

/* Ensure Logo sizing is consistent */
.logo {
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
}

/* Responsive spacing for mobile */
@media screen and (max-width: 500px) {
    .hero-title-main {
        font-size: 2rem !important;
    }

    .hero-description {
        font-size: 1rem !important;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin: 0.5rem 0 !important;
    }
}

/* Alert Warning Styles */
.alert-warning {
    background: #fff7ed;
    border-left: 4px solid #f97316;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #c2410c;
    border-radius: 4px;
}

.alert-warning strong {
    color: #c2410c;
    display: block;
    margin-bottom: 0.25rem;
}

.alert-warning span,
.alert-warning a {
    color: #ea580c;
}

.alert-warning a {
    text-decoration: underline;
    font-weight: 600;
}

/* Dark Mode Alert Warning */
body.dark-mode .alert-warning {
    background: rgba(255, 115, 0, 0.1);
    color: #fdba74;
}

body.dark-mode .alert-warning strong {
    color: #fdba74;
}

body.dark-mode .alert-warning span,
body.dark-mode .alert-warning a {
    color: #fed7aa;
}

/* --- NEW RESPONSIVE ADMIN LAYOUT --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #f1f5f9;
    /* Light gray bg for dashboard */
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: #1e293b;
    /* Dark slate */
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    color: white;
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav a.active {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-footer a:hover {
    color: white;
}

/* Main Content Area */
.admin-main {
    flex: 1;
    margin-left: 260px;
    /* Width of sidebar */
    padding: 2rem;
    width: calc(100% - 260px);
}

/* Admin Topbar (Mobile Only mostly, but good structure) */
.admin-topbar {
    display: none;
    /* Hidden on desktop */
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #1e293b;
    color: white;
    position: sticky;
    top: 0;
    z-index: 90;
}

.admin-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive - Mobile/Tablet */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
        /* Hide Sidebar */
        width: 280px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }

    .admin-topbar {
        display: flex;
    }

    /* Overlay */
    .admin-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 95;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
        backdrop-filter: blur(2px);
    }

    .admin-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* --- Auth Page Specific Fixes (Last to Override) --- */
.auth-box {
    max-width: 500px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 2.5rem;
}

.section-fullscreen {
    display: flex;
    /* Ensure flex behavior */
    flex-direction: column;
    justify-content: center;
    align-items: center !important;
    /* Force horizontal centering */
    min-height: 100vh;
    padding: 5rem 1rem;
}

@media (max-width: 768px) {
    .auth-box {
        padding: 1.5rem !important;
        /* Reduced padding on mobile */
        max-width: 100% !important;
    }

    .section-fullscreen {
        justify-content: center;
        padding: 2rem 1rem !important;
        /* Safer vertical padding */
        min-height: 100dvh;
    }
}