/* Force all text input and textarea to display uppercase */
input[type="text"], input[type="search"], textarea {
    text-transform: uppercase !important;
}
/* Global form field color fix for visibility */
input, select, textarea {
    color: #1e293b !important;
    background: #fff !important;
}
input[disabled], select[disabled], textarea[disabled] {
    color: #64748b !important;
    background: #f3f4f6 !important;
}
/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at 86% 18%, rgba(173, 179, 191, 0.34), transparent 24%),
        linear-gradient(90deg, #222533 0%, #2a2e3b 34%, #414858 72%, #6d7484 100%);
    background-attachment: fixed;
    color: #eef2ff;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0,0,0,0.14) 0%, rgba(0,0,0,0.06) 38%, rgba(255,255,255,0.05) 100%),
        radial-gradient(circle at 20% 18%, rgba(255,255,255,0.04), transparent 20%),
        radial-gradient(circle at 88% 14%, rgba(255,255,255,0.11), transparent 18%);
    pointer-events: none;
    z-index: -1;
}

/* Backgrounds */
.bg-gradient-custom {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe, #f8fafc);
}

.hero-bg {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f3e8ff 100%);
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.15);
    border-radius: 24px;
    transition: transform 0.3s ease;
}

.glass:hover {
    transform: translateY(-5px);
}

/* Buttons */
.gradient-btn {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    transition: all 0.3s ease;
}

.gradient-btn:hover {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.35);
}

.ai-button,
.modern-button {
    background: linear-gradient(135deg, #4f46e5, #22d3ee);
    box-shadow: 0 10px 20px -5px rgb(79 70 229 / 0.35);
    transition: all 0.4s ease;
    border-radius: 9999px;
}

.ai-button:hover,
.modern-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -8px rgb(79 70 229 / 0.45);
}

.ai-whatsapp-button {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 10px 25px rgba(34,197,94,0.3);
    transition: 0.3s;
}

.ai-whatsapp-button:hover {
    transform: scale(1.05);
}

.modern-secondary-button {
    background: white;
    border: 2px solid #64748b;
    color: #1e2937;
    border-radius: 9999px;
    transition: all 0.4s ease;
}

.modern-secondary-button:hover {
    border-color: #6366f1;
    background: #f8fafc;
    transform: translateY(-3px);
}

/* Navbar */
.nav-link {
    color: #475569;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #4f46e5;
    background-color: #f8fafc;
    border-radius: 9999px;
}

/* Cards */
.feature-card {
    transition: all 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.08);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #bfdbfe, transparent);
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    background: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    font-size: 1.1rem;
}

/* Inputs */
.input-focus {
    transition: all 0.3s ease;
}

.input-focus:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

/* Extra */
.ai-glow {
    box-shadow: 0 0 25px rgba(129, 140, 248, 0.5);
}

.logo-gradient {
    background: linear-gradient(to right, #4f46e5, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Typography adjustments: slightly increase letter-spacing on hero heading */
.hero-bg h1 {
    letter-spacing: 0.6px;
}

.hero-bg h1 span {
    letter-spacing: 0.6px;
}

/* Button hover global */
button:hover {
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 640px) {
    .glass {
        padding: 24px 20px;
    }
}

/* Utility: center table cell content horizontally and vertically
   Apply the class `center-all` on a table or container to center its table cells */
.center-all th,
.center-all td {
    text-align: center !important;
    vertical-align: middle !important;
}

/* Also provide a convenience rule for the advances table specifically */
.adv-table.center-all th,
.adv-table.center-all td {
    text-align: center !important;
    vertical-align: middle !important;
}

/* Removed temporary monthSelector offset — spacing handled by header script. */

/* Form card styling */

/* COMPACT FORM STYLES */
.form-card label {
    font-weight: 600;
    color: #0f172a;
    letter-spacing: 0.1px;
    display: inline-block;
    background: rgba(241,245,249,0.9);
    padding: 0.06rem 0.35rem;
    border-radius: 4px;
    margin-bottom: 0.22rem;
    font-size: 13px;
}
.form-card input,
.form-card select,
.form-card textarea {
    border: 1px solid #000000;
    background: #ffffff;
    box-shadow: 0 3px 9px rgba(15, 23, 42, 0.02);
    transition: box-shadow 0.18s ease, border-color 0.12s ease;
    padding: 0.35rem 0.7rem;
    border-radius: 5px;
    font-size: 15px;
    min-height: 34px;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.09);
}
.form-card input::placeholder,
.form-card textarea::placeholder {
    color: #9ca3af; /* slightly darker placeholder for contrast */
}
.form-card .text-red-600 { color: #c2410c; }

/* Sidebar sticky positioning on all screen sizes */
.sidebar {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: var(--site-header-height, 56px);
    z-index: 10040;
    height: fit-content; /* Allow natural height expansion */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.45) rgba(255,255,255,0.08);
    scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    margin: 10px 0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255,255,255,0.58) 0%, rgba(188,196,214,0.78) 100%);
    border-radius: 999px;
    border: 2px solid rgba(58, 64, 79, 0.22);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(205,213,228,0.9) 100%);
}

/* Shared desktop layout for pages that use the app sidebar.
   This prevents the content area from sliding under the sidebar at browser zoom levels. */
body.has-sidebar {
    background: transparent;
}

body.has-sidebar > .sidebar {
    flex: none;
    width: auto;
    max-width: none;
    min-width: 0;
}

body.has-sidebar > main {
    padding-bottom: 1.5rem;
}

body.has-sidebar > main > * {
    min-width: 0;
}

#siteHeader,
#monthSelector {
    background: #d9e7f5 !important;
    border-color: #c4d5e6 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.sidebar {
    background: #dce8f7 !important;
    border-color: #cfdbeb !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#siteHeaderTitle,
.sidebar h3,
.sidebar h4,
#monthSelector span,
.sidebar,
#siteHeader {
    color: #20344b !important;
}

#monthSelector input[type="month"] {
    background: #eef5fc !important;
    color: #20344b !important;
    border: 1px solid #c4d5e6 !important;
    box-shadow: none !important;
}

#monthSelector input[type="month"]::-webkit-calendar-picker-indicator {
    filter: invert(18%) sepia(16%) saturate(690%) hue-rotate(173deg) brightness(91%) contrast(89%);
}

@media (max-width: 767.98px) {
    body.has-sidebar > .sidebar {
        position: static;
        top: auto;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    body.has-sidebar > main {
        width: 100%;
        min-width: 0;
    }
}

.form-card .section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0b1220;
    margin-bottom: 0.5rem;
}
.form-card .hint { color: #6b7280; font-size: 0.875rem; }

/* Enhanced form visuals: rounded gradient border and soft glow around whole form card */
.form-card {
    position: relative;
    border-radius: 18px;
    /* show a thin gradient border around the card using two backgrounds */
    background-image: linear-gradient(white, white), linear-gradient(90deg, #7c3aed, #4f46e5, #60a5fa);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    padding: 0.75rem; /* small outer padding so inner white area sits inside the gradient */
    box-shadow: 0 10px 30px rgba(79,70,229,0.06), 0 4px 12px rgba(2,6,23,0.06);
}
.form-card > form { border-radius: 14px; padding: 1.25rem; background: transparent; }
.form-card label { text-transform: none; }
.form-card input, .form-card select, .form-card textarea {
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
}
.form-card .required-star { color: #ef4444; font-weight: 700; margin-left: 4px; }
.form-section {
    background: #ffffff; /* keep inner sections white to contrast with outer gradient */
    border: 1px solid rgba(59,130,246,0.09);
    padding: 0.75rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}
.form-section .section-title { color: #334155; font-size: 0.95rem; margin-bottom: 0.5rem; }

/* Colored accent around form section on all sides */
.form-section {
    border: 1px solid rgba(59,130,246,0.18);
    box-shadow: 0 8px 30px rgba(59,130,246,0.06), inset 0 0 0 3px rgba(99,102,241,0.03);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

/* Stronger accent when focused/hovered */
.form-section:hover {
    box-shadow: 0 12px 40px rgba(59,130,246,0.10), inset 0 0 0 4px rgba(99,102,241,0.04);
    border-color: rgba(59,130,246,0.28);
}

/* Make active employee table data stand out: bold text for data cells
   Disabled employees keep muted color via existing rules. */
.responsive-table tbody tr:not(.employee-disabled) td {
    font-weight: 600;
    color: #0f172a;
}

/* Layout: keep header and left sidebar fixed on medium+ screens.
   Only the main content area will scroll vertically. Uses --site-header-height
   set by the header script; falls back to 56px. */
@media (min-width: 768px) {
    /* When a sidebar is present, use the top-left strip for sidebar and shift header to the right. */
    body.has-sidebar #siteHeader {
        left: 18rem !important; /* sidebar width (w-72) */
        right: 0 !important;
        width: auto;
    }
    body.has-sidebar #monthSelector {
        margin-left: 18rem;
        width: calc(100% - 18rem);
        max-width: calc(100% - 18rem);
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        padding-right: 1rem;
        z-index: 10040; /* below header (10050) */
    }
    /* Keep the main content area free-flowing; only the employee card becomes the scrollable region */
    #mainContent {
        margin-left: 18rem; /* account for fixed sidebar (w-72 = 18rem) */
        /* do not force full-height/scroll here so page-level UI stays stable */
        height: auto;
        overflow: visible;
    }
    /* Page-specific: when an element with id `employeeCard` is present, make it the scrollable pane
       and reserve space below the fixed header. Adjust the -48px as comfortable vertical padding. */
    #employeeCard {
        height: calc(100vh - var(--site-header-height, 56px) - 48px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1.5rem; /* ensure internal padding remains comfortable */
    }
}


