/* Custom styles for Adventure Pro */

.login-error-alert {
    background: linear-gradient(to right, #ef4444, #dc2626);
    /* Red 500 to Red 600 */
    color: #ffffff;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.5rem;
    /* rounded-lg */
    padding: 0.75rem 1rem;
    /* px-4 py-3 */
    font-size: 0.875rem;
    /* text-sm */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    /* shadow-md */
}

/* Employee Avatar Styles */
.employee-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    /* Blue 500 to Blue 600 */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.employee-avatar-text {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    line-height: 1;
    user-select: none;
}

/* Company wizard income grid */
.income-grid-header,
.income-grid-row {
    display: grid;
    grid-template-columns: 70px minmax(180px, 2fr) minmax(160px, 1.4fr) minmax(140px, 1.1fr) 70px 70px 44px;
    gap: 12px;
    align-items: center;
}

.income-grid-simple-header,
.income-grid-simple-row {
    display: grid;
    grid-template-columns: minmax(260px, 2.2fr) minmax(160px, 1.2fr) minmax(140px, 1.1fr) 60px 60px 80px;
    gap: 12px;
    align-items: center;
}

.income-grid-row input,
.income-grid-row select,
.income-grid-simple-row input,
.income-grid-simple-row select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.income-grid-row input[type="checkbox"] {
    width: auto;
}

.income-grid-checkbox {
    display: flex;
    justify-content: center;
}

.income-grid-edit {
    display: flex;
    justify-content: flex-end;
}

/* Wizard primary button */
.wizard-primary {
    background-color: var(--color-brand-500);
    border: 1px solid transparent;
    color: #ffffff;
}

.wizard-primary:hover {
    background-color: var(--color-brand-600);
}

/* Alerts */
.alert {
    background-color: #ffffff;
    border-color: #e5e7eb;
    color: #111827;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534 !important;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b !important;
}

.dark .alert {
    background-color: #111827;
    border-color: #1f2937;
    color: #e5e7eb;
}

.dark .alert-success {
    background-color: rgba(22, 163, 74, 0.12);
    border-color: rgba(34, 197, 94, 0.4);
    color: #6ee7b7 !important;
}

.dark .alert-error {
    background-color: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5 !important;
}

/* Fallback for missing Tailwind red/green classes used in messages and validation */
.bg-red-50 { background-color: #fef2f2 !important; }
.text-red-800 { color: #991b1b !important; }
.border-red-200 { border-color: #fecaca !important; }
.text-red-500 { color: #ef4444 !important; }

.bg-green-50 { background-color: #f0fdf4 !important; }
.text-green-800 { color: #166534 !important; }
.border-green-200 { border-color: #bbf7d0 !important; }

/* Dark mode fallbacks */
.dark .text-red-400 { color: #fca5a5 !important; }
.dark .bg-red-900\/20 { background-color: rgba(127, 29, 29, 0.2) !important; }
.dark .border-red-800 { border-color: #991b1b !important; }

.dark .text-green-400 { color: #4ade80 !important; }
.dark .bg-green-900\/20 { background-color: rgba(20, 83, 45, 0.2) !important; }
.dark .border-green-800 { border-color: #166534 !important; }

/* Custom validation error utility */
.text-error-500 { color: #d92d20 !important; }

/* Attendance Status Button Styles */
.attendance-status-btn {
    transition: all 0.2s ease-in-out;
}

.attendance-status-btn.selected {
    background-color: #2E5022 !important;
    border-color: #2E5022 !important;
    color: #ffffff !important;
}

.attendance-status-btn:not(.selected) {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
}

.attendance-status-btn:not(.selected):hover {
    background-color: #f9fafb !important;
}

/* Dark mode support */
.dark .attendance-status-btn:not(.selected) {
    background-color: #1f2937 !important;
    border-color: #4b5563 !important;
    color: #d1d5db !important;
}

.dark .attendance-status-btn:not(.selected):hover {
    background-color: #374151 !important;
}

/* Salary Pay Button Styles */
.bg-green-600 {
    background-color: #16a34a !important;
}

.bg-green-600:hover {
    background-color: #15803d !important;
}

.text-white {
    color: #ffffff !important;
}

.bg-gray-400 {
    background-color: #9ca3af !important;
}

/* Dark mode salary buttons */
.dark .bg-gray-600 {
    background-color: #4b5563 !important;
}

/* Daily Views Empty State - Padding Fix */
.daily-empty-state {
    margin-top: 24px;
    margin-bottom: 24px;
    padding-top: 48px;
    padding-bottom: 48px;
}

/* Hide number input spinner buttons to prevent scroll value changes */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Dashboard Chart Canvas - Ensure proper height inheritance */
canvas[id$="Chart"] {
    display: block;
    width: 100% !important;
    height: 300px !important;
}

/* ── Driver.js Tour — Fynlo design skin ─────────────────────────────────── */

/* Drop header below the overlay while the tour is active */
.driver-active header {
    z-index: 1 !important;
}

/* Highlight ring — brand green */
.driver-active .driver-active-element {
    outline: 2px solid #2E5022 !important;
    outline-offset: 3px !important;
    border-radius: 6px !important;
}

/*
 * Use double-class selector (.driver-popover.fynlo-popover) for higher
 * specificity than driver.css's single .driver-popover rules — no !important needed.
 * popoverClass: 'fynlo-popover' is set in the JS driver() config.
 */
.driver-popover.fynlo-popover {
    font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
    background: #ffffff;
    border: 1px solid #d1e7c7;
    border-left: 4px solid #2E5022;
    border-radius: 14px;
    box-shadow: 0 20px 40px -8px rgba(46,80,34,.22), 0 4px 12px -2px rgba(0,0,0,.10);
    padding: 20px 22px 18px 20px;
    min-width: 300px;
    max-width: 340px;
    color: #111827;
}

.driver-popover.fynlo-popover .driver-popover-title {
    font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
    line-height: 1.4;
    display: block;
}

.driver-popover.fynlo-popover .driver-popover-description {
    font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.65;
    margin-bottom: 0;
    display: block;
}

.driver-popover.fynlo-popover .driver-popover-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e8f3e3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.driver-popover.fynlo-popover .driver-popover-progress-text {
    font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: .04em;
    zoom: 1;
}

/* Shared button reset */
.driver-popover.fynlo-popover .driver-popover-prev-btn,
.driver-popover.fynlo-popover .driver-popover-next-btn,
.driver-popover.fynlo-popover .driver-popover-done-btn {
    font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    padding: 6px 16px;
    cursor: pointer;
    line-height: 1.5;
    display: inline-block;
    text-shadow: none;
    box-shadow: none;
    transition: background .15s, color .15s, border-color .15s;
}

/* Prev — ghost */
.driver-popover.fynlo-popover .driver-popover-prev-btn {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #d1d5db;
}
.driver-popover.fynlo-popover .driver-popover-prev-btn:hover,
.driver-popover.fynlo-popover .driver-popover-prev-btn:focus {
    background: #f9fafb;
    color: #111827;
    border-color: #9ca3af;
}

/* Next / Done — brand green */
.driver-popover.fynlo-popover .driver-popover-next-btn,
.driver-popover.fynlo-popover .driver-popover-done-btn {
    background: #2E5022;
    color: #ffffff;
    border: 1px solid #2E5022;
}
.driver-popover.fynlo-popover .driver-popover-next-btn:hover,
.driver-popover.fynlo-popover .driver-popover-next-btn:focus,
.driver-popover.fynlo-popover .driver-popover-done-btn:hover,
.driver-popover.fynlo-popover .driver-popover-done-btn:focus {
    background: #25421c;
    border-color: #25421c;
}

/* Close X — only override appearance, not position (driver.js owns top/right) */
.driver-popover.fynlo-popover .driver-popover-close-btn {
    color: #9ca3af;
    cursor: pointer;
    transition: color .15s;
}
.driver-popover.fynlo-popover .driver-popover-close-btn:hover {
    color: #111827;
}

/* Arrow — match white card */
.driver-popover.fynlo-popover .driver-popover-arrow-side-left  { border-right-color: #ffffff; }
.driver-popover.fynlo-popover .driver-popover-arrow-side-right { border-left-color: #ffffff; }
.driver-popover.fynlo-popover .driver-popover-arrow-side-top   { border-bottom-color: #ffffff; }
.driver-popover.fynlo-popover .driver-popover-arrow-side-bottom{ border-top-color: #ffffff; }

/* Dark mode */
.dark .driver-popover.fynlo-popover {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}
.dark .driver-popover.fynlo-popover .driver-popover-title       { color: #f9fafb; }
.dark .driver-popover.fynlo-popover .driver-popover-description { color: #9ca3af; }
.dark .driver-popover.fynlo-popover .driver-popover-footer      { border-top-color: #374151; }
.dark .driver-popover.fynlo-popover .driver-popover-prev-btn    { background: #374151; color: #d1d5db; border-color: #4b5563; }
.dark .driver-popover.fynlo-popover .driver-popover-prev-btn:hover { background: #4b5563; color: #f9fafb; }
.dark .driver-popover.fynlo-popover .driver-popover-arrow-side-left  { border-right-color: #1f2937; }
.dark .driver-popover.fynlo-popover .driver-popover-arrow-side-right { border-left-color: #1f2937; }
.dark .driver-popover.fynlo-popover .driver-popover-arrow-side-top   { border-bottom-color: #1f2937; }
.dark .driver-popover.fynlo-popover .driver-popover-arrow-side-bottom{ border-top-color: #1f2937; }
/* ── End Driver.js Tour ─────────────────────────────────────────────────── */

/* ── Sidebar Redesign ───────────────────────────────────────────────────── */

/* Background & border */
aside.sidebar {
    background-color: #1B2E12 !important;
    border-right-color: #1B2E12 !important;
}

/* Logo / header text */
aside.sidebar .sidebar-header h1 { color: #ffffff !important; }
aside.sidebar .sidebar-header p  { color: rgba(255,255,255,0.45) !important; }

/* Mobile close button */
aside.sidebar button[aria-label="Close sidebar"] {
    color: rgba(255,255,255,0.6) !important;
}
aside.sidebar button[aria-label="Close sidebar"]:hover {
    background-color: rgba(255,255,255,0.08) !important;
    color: #ffffff !important;
}

/* Section group label */
aside.sidebar .menu-group-title {
    color: rgba(255,255,255,0.3) !important;
    letter-spacing: 0.08em;
}

/* ── Parent menu items ── */
aside.sidebar .menu-item-inactive {
    color: rgba(255,255,255,0.68) !important;
}
aside.sidebar .menu-item-inactive:hover {
    background-color: rgba(255,255,255,0.07) !important;
    color: #ffffff !important;
}
aside.sidebar .menu-item-active {
    background-color: rgba(255,255,255,0.11) !important;
    color: #a8d98a !important;
}

/* ── Icons ── */
aside.sidebar .menu-item-icon-inactive {
    fill: rgba(255,255,255,0.5) !important;
}
aside.sidebar .menu-item-inactive:hover .menu-item-icon-inactive {
    fill: rgba(255,255,255,0.85) !important;
}
aside.sidebar .menu-item-icon-active {
    fill: #a8d98a !important;
}

/* ── Chevron arrows ── */
aside.sidebar .menu-item-arrow-inactive {
    stroke: rgba(255,255,255,0.4) !important;
}
aside.sidebar .menu-item-inactive:hover .menu-item-arrow-inactive {
    stroke: rgba(255,255,255,0.8) !important;
}
aside.sidebar .menu-item-arrow-active {
    stroke: #a8d98a !important;
}

/* ── Dropdown sub-items ── */
aside.sidebar .menu-dropdown-item-inactive {
    color: rgba(255,255,255,0.6) !important;
}
aside.sidebar .menu-dropdown-item-inactive:hover {
    background-color: rgba(255,255,255,0.07) !important;
    color: #ffffff !important;
}
aside.sidebar .menu-dropdown-item-active {
    background-color: rgba(168,217,138,0.12) !important;
    color: #a8d98a !important;
    font-weight: 600 !important;
}

/* Active dot — white on dark bg */
aside.sidebar .menu-dropdown-item-active .bg-brand-500,
aside.sidebar .menu-dropdown-item-active .bg-brand-400 {
    background-color: #a8d98a !important;
}

/* ── Reports sub-section headers ── */
aside.sidebar .text-gray-400,
aside.sidebar .text-gray-500 {
    color: rgba(255,255,255,0.3) !important;
}
aside.sidebar .text-gray-400 svg,
aside.sidebar .text-gray-500 svg {
    stroke: rgba(255,255,255,0.3) !important;
}

/* Scrollbar on dark bg */
aside.sidebar ::-webkit-scrollbar-track { background: transparent; }
aside.sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
aside.sidebar ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Report sub-section group labels */
.sidebar-report-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 12px 4px;
    color: rgba(255,255,255,0.32);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    user-select: none;
    line-height: 1;
}
.sidebar-report-group svg {
    stroke: rgba(255,255,255,0.32);
    flex-shrink: 0;
}
.sidebar-report-group-sep {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

/* ── End Sidebar Redesign ───────────────────────────────────────────────── */
