/* ==========================================================================
   Leave Tracker - Theme 3: Cloud Pastel (Light Cyan Sky & Curved SaaS)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Primary Accent: Cerulean Cyan */
    --primary: #0891b2;
    --primary-light: #e0f2fe;
    --primary-hover: #0e7490;
    --primary-border: #bae6fd;

    /* Text */
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;

    /* Surfaces & Background: Light Cyan Sky */
    --bg-body: #f0f9ff;
    --bg-card: #ffffff;
    --border-subtle: #e0f2fe;
    --border-card: #cffafe;

    /* Shapes */
    --card-radius: 18px;
    --btn-radius: 10px;
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    font-size: 0.92rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   Top Navbar
   -------------------------------------------------------------------------- */
.navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    box-shadow: 0 2px 12px 0 rgba(8, 145, 178, 0.04);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-main) !important;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    padding: 0;
}

.navbar-brand-logo {
    height: 48px;
    max-height: 48px;
    width: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.navbar-brand-logo:hover {
    transform: scale(1.02);
}

.auto-dismiss-alert {
    transition: opacity 0.6s ease, max-height 0.6s ease, margin 0.6s ease, padding 0.6s ease;
    overflow: hidden;
}

@media (max-width: 576px) {
    .navbar-brand-logo {
        height: 38px;
        max-height: 38px;
    }
}

.navbar-nav .nav-link {
    font-size: 0.88rem;
    font-weight: 500;
    color: #475569 !important;
    padding: 0.45rem 0.85rem !important;
    border-radius: var(--btn-radius);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
    background-color: #f0f9ff;
}

.navbar-nav .nav-link.active {
    color: var(--primary) !important;
    background-color: var(--primary-light);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Cards (Pill / Curved Floating Shapes)
   -------------------------------------------------------------------------- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    box-shadow: 0 4px 20px -2px rgba(8, 145, 178, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.02);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    box-shadow: 0 6px 24px -2px rgba(8, 145, 178, 0.08);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 1.25rem;
}

.card-body {
    padding: 1.2rem;
}

.card-footer {
    border-top: 1px solid var(--border-subtle);
    background-color: transparent;
    border-bottom-left-radius: var(--card-radius) !important;
    border-bottom-right-radius: var(--card-radius) !important;
}

/* Profile / Banner Card */
.profile-banner {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    box-shadow: 0 4px 20px -2px rgba(8, 145, 178, 0.05);
    padding: 1.25rem 1.4rem;
}

/* --------------------------------------------------------------------------
   Metric / Stat Cards
   -------------------------------------------------------------------------- */
.stat-card {
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 14px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.stat-icon.blue { background-color: #e0f2fe; color: #0284c7; }
.stat-icon.green { background-color: #ecfdf5; color: #059669; }
.stat-icon.purple { background-color: #f5f3ff; color: #7c3aed; }
.stat-icon.amber { background-color: #fffbeb; color: #d97706; }
.stat-icon.rose { background-color: #fef2f2; color: #e11d48; }

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    margin-top: 0.25rem;
}

.stat-subtext {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* --------------------------------------------------------------------------
   Soft Modern Pills
   -------------------------------------------------------------------------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 9999px;
    line-height: 1.2;
}

.pill-present {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.pill-wfh {
    background-color: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.pill-weekly-off {
    background-color: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.pill-holiday {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.pill-leave {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.pill-assumed {
    background-color: #f1f5f9;
    color: #475569;
    font-size: 0.72rem;
    border: 1px solid #e2e8f0;
}

.pill-corrected {
    background-color: #fff7ed;
    color: #c2410c;
    font-size: 0.72rem;
    border: 1px solid #fed7aa;
}

.pill-flagged {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-size: 0.72rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table {
    margin-bottom: 0;
    font-size: 0.88rem;
}

.table th {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: #334155;
}

.table tbody tr:hover {
    background-color: #f0f9ff;
}

/* --------------------------------------------------------------------------
   Buttons & Inputs
   -------------------------------------------------------------------------- */
.btn {
    border-radius: var(--btn-radius);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:focus,
.btn:active,
.btn:focus-visible,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: #bae6fd;
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   Colored Action Buttons (Logout, WFH, Sync)
   -------------------------------------------------------------------------- */
.btn-logout {
    background-color: #fff1f2 !important;
    color: #e11d48 !important;
    border: 1px solid #fecdd3 !important;
    font-weight: 600 !important;
    transition: all 0.15s ease;
}

.btn-logout:hover {
    background-color: #e11d48 !important;
    color: #ffffff !important;
    border-color: #e11d48 !important;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

.btn-wfh {
    background-color: #f5f3ff !important;
    color: #7c3aed !important;
    border: 1px solid #ddd6fe !important;
    font-weight: 600 !important;
    transition: all 0.15s ease;
}

.btn-wfh:hover {
    background-color: #7c3aed !important;
    color: #ffffff !important;
    border-color: #7c3aed !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

/* Self-Attendance Action Buttons Group */
.self-attendance-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.self-attendance-actions .btn {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    padding: 0.42rem 1rem !important;
    border-radius: 9px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    transition: all 0.18s ease;
}

.self-attendance-actions .btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-portal {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border: 1px solid #0284c7 !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
    transition: all 0.15s ease;
}

.btn-portal:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
    color: #ffffff !important;
    border-color: #0369a1 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    transform: translateY(-1px);
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 0.88rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

/* Tabs */
.nav-tabs {
    border-bottom: 1px solid var(--border-subtle);
}

.nav-tabs .nav-link {
    border-radius: 10px 10px 0 0;
    color: #64748b;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-color: #e0f2fe #e0f2fe transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    font-weight: 600;
    border-color: var(--border-subtle) var(--border-subtle) #ffffff;
    background-color: #ffffff;
}

/* Modals */
.modal-content {
    border-radius: 18px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 10px 30px rgba(8, 145, 178, 0.12);
}

/* --------------------------------------------------------------------------
   Custom Alert & Confirm Dialog (Self-contained Overlay, Top-most Z-Index)
   -------------------------------------------------------------------------- */
.app-dialog-overlay {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    z-index: 999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.app-dialog-card {
    margin: auto !important;
    background-color: #ffffff !important;
    border-radius: 20px !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.45) !important;
    max-width: 440px !important;
    width: 100% !important;
    padding: 1.75rem 1.5rem !important;
    text-align: center !important;
    position: relative !important;
    z-index: 1000000 !important;
    pointer-events: auto !important;
    animation: appDialogPopIn 0.15s ease-out forwards;
}

@keyframes appDialogPopIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.app-dialog-card .btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    min-width: 90px !important;
    padding: 0.5rem 1.25rem !important;
}

.app-dialog-icon-chip {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    margin-bottom: 0.85rem;
}

.app-dialog-icon-chip.primary {
    background-color: #e0f2fe;
    color: #0284c7;
    border: 2px solid #bae6fd;
}

.app-dialog-icon-chip.success {
    background-color: #ecfdf5;
    color: #059669;
    border: 2px solid #a7f3d0;
}

.app-dialog-icon-chip.warning {
    background-color: #fffbeb;
    color: #d97706;
    border: 2px solid #fde68a;
}

.app-dialog-icon-chip.danger {
    background-color: #fef2f2;
    color: #e11d48;
    border: 2px solid #fecaca;
}

.app-dialog-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.app-dialog-message {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    white-space: pre-line;
    word-break: break-word;
    max-height: 50vh;
    overflow-y: auto;
}

/* Footer */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    background-color: #ffffff;
    padding: 0.85rem 0;
    font-size: 0.8rem;
    color: var(--text-light);
}
