/* =============================================
   AttendX — Global Styles
   ============================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #0a0f1a; color: #f1f5f9; overflow-x: hidden; }
h1, h2, h3, h4, h5, h6 { font-family: 'Space Grotesk', sans-serif; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111827; }
::-webkit-scrollbar-thumb { background: #374357; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 20px rgba(16,185,129,0.15); } 50% { box-shadow: 0 0 40px rgba(16,185,129,0.3); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes gradient-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.animate-fade { animation: fadeIn 0.4s ease-out both; }
.animate-scale { animation: scaleIn 0.3s ease-out both; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 3s ease-in-out infinite; }

/* Login background */
.login-bg {
    background: linear-gradient(135deg, #0a0f1a 0%, #111827 40%, #0a0f1a 100%);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}
.login-bg::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(16,185,129,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(6,182,212,0.06) 0%, transparent 50%);
    pointer-events: none;
}

/* Glass card */
.glass-card {
    background: rgba(26, 35, 50, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(42, 53, 72, 0.6);
}

/* Card hover */
.card-hover { transition: all 0.3s ease; }
.card-hover:hover { transform: translateY(-2px); border-color: rgba(16, 185, 129, 0.3); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3); }

/* Stat card */
.stat-card {
    position: relative;
    overflow: visible;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
}
.stat-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -40%;
    width: 180%;
    height: 180%;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}
.stat-card[data-color="emerald"] { border-color: rgba(16,185,129,0.22); }
.stat-card[data-color="amber"] { border-color: rgba(245,158,11,0.22); }
.stat-card[data-color="cyan"] { border-color: rgba(6,182,212,0.22); }
.stat-card[data-color="red"] { border-color: rgba(239,68,68,0.22); }

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

@media (max-width: 639px) {
    .dashboard-cards {
        gap: 12px;
    }
}

@media (min-width: 640px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }
}

@media (min-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

.dashboard-card {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.16);
}
.card-icon-inner { font-size: 18px; }
.card-value { font-size: 1.9rem; font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #f8fafc; margin-bottom: 0.75rem; }
.card-heading { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.card-label { font-size: 0.8rem; color: #cbd5e1; margin: 0; }
.card-subtitle { font-size: 0.78rem; color: #94a3b8; margin: 0; }
.card-icon.emerald-icon { background-color: rgba(16,185,129,0.16); }
.card-icon.amber-icon { background-color: rgba(245,158,11,0.18); }
.card-icon.cyan-icon { background-color: rgba(6,182,212,0.18); }
.card-icon.red-icon { background-color: rgba(239,68,68,0.18); }
.card-icon.emerald-icon .card-icon-inner { color: #34d399; }
.card-icon.amber-icon .card-icon-inner { color: #fbbf24; }
.card-icon.cyan-icon .card-icon-inner { color: #38bdf8; }
.card-icon.red-icon .card-icon-inner { color: #f87171; }

.tooltip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: rgba(148,163,184,0.16);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.tooltip-badge:hover {
    background: rgba(148,163,184,0.28);
}

/* Sidebar */

/* Sidebar */
.sidebar-item { transition: all 0.2s ease; position: relative; }
.sidebar-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #10b981; border-radius: 0 2px 2px 0; transform: scaleY(0); transition: transform 0.2s ease; }
.sidebar-item:hover { background: rgba(16, 185, 129, 0.08); }
.sidebar-item.active { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.sidebar-item.active::before { transform: scaleY(1); }

.sidebar-desktop { transform: translateX(-100%); position: fixed; z-index: 50; }
@media (min-width: 768px) {
    .sidebar-desktop { transform: translateX(0); position: static; z-index: auto; }
}
.sidebar-desktop.open { transform: translateX(0); }

/* Modal overlay */
.modal-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay .glass-card {
    width: min(100%, 760px);
    max-height: calc(100vh - 48px);
    margin: auto;
}

@media (max-width: 640px) {
    .modal-overlay { padding: 12px; }
    .modal-overlay .glass-card {
        width: min(100%, 100%);
        max-width: 100%;
        border-radius: 20px;
    }
}

/* Input field */
.input-field {
    background: #111827;
    border: 1px solid #2a3548;
    color: #f1f5f9;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s;
    width: 100%;
    font-family: 'DM Sans', sans-serif;
}
.input-field:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }
.input-field::placeholder { color: #64748b; }
input[type="date"].holiday-date-input::-webkit-calendar-picker-indicator {
    filter: invert(74%) sepia(34%) saturate(3701%) hue-rotate(150deg) brightness(96%) contrast(90%);
}
input[type="date"].holiday-date-input::-webkit-inner-spin-button,
input[type="date"].holiday-date-input::-webkit-clear-button {
    display: none;
}
select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Buttons */
.btn-primary { background: linear-gradient(135deg, #059669, #10b981); color: #fff; padding: 10px 20px; border-radius: 8px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; font-family: 'DM Sans', sans-serif; font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); }
.btn-secondary { background: #1f2b3d; color: #f1f5f9; padding: 10px 20px; border-radius: 8px; font-weight: 500; border: 1px solid #2a3548; cursor: pointer; transition: all 0.2s; font-family: 'DM Sans', sans-serif; font-size: 14px; }
.btn-secondary:hover { background: #2a3548; }
.btn-gradient { background: linear-gradient(135deg, #2563eb, #7c3aed) !important; color: #fff !important; padding: 10px 20px !important; border-radius: 10px !important; font-weight: 600 !important; border: none !important; cursor: pointer !important; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; font-family: 'DM Sans', sans-serif !important; font-size: 14px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 0.5rem !important; text-decoration: none !important; }
.btn-gradient:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(59, 130, 246, 0.24); }
.btn-gradient-secondary { background: linear-gradient(135deg, #f97316, #f59e0b) !important; color: #fff !important; padding: 10px 20px !important; border-radius: 10px !important; font-weight: 600 !important; border: none !important; cursor: pointer !important; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; font-family: 'DM Sans', sans-serif !important; font-size: 14px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 0.5rem !important; text-decoration: none !important; }
.btn-gradient-secondary:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(249, 115, 22, 0.22); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; padding: 10px 20px; border-radius: 8px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; font-family: 'DM Sans', sans-serif; font-size: 14px; }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Drop zone */
.drop-zone { border: 2px dashed #2a3548; transition: all 0.3s ease; }
.drop-zone.drag-over { border-color: #10b981; background: rgba(16, 185, 129, 0.05); }
.drop-zone:hover { border-color: #374357; }

/* Table */
table { border-collapse: separate; border-spacing: 0; }
th { position: sticky; top: 0; z-index: 5; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}