/* ============================================================
   Controle de Horas — Lumina Design System
   Dark Theme: #050505 bg, orange-500 accents, glass surfaces
   ============================================================ */

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---- Beam animations (background decoration) ---- */
@keyframes beam-fall {
    0%   { transform: translateY(-100%); opacity: 0; }
    5%   { opacity: 0.5; }
    50%  { opacity: 1; }
    95%  { opacity: 0.5; }
    100% { transform: translateY(120vh); opacity: 0; }
}
.beam-1 { animation: beam-fall 6s linear infinite; }
.beam-2 { animation: beam-fall 8s linear infinite 2s; }
.beam-3 { animation: beam-fall 7s linear infinite 4s; }

/* ---- Page section animation ---- */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page-section { animation: fadeSlideIn 0.25s ease; }

/* ---- Glass Cards ---- */
.glass-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.glass-card-inner {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
}

/* ---- Card Header ---- */
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
}

/* ---- Form Controls ---- */
.form-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #737373;
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}
.form-control:focus {
    border-color: #f97316;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.form-control option { background: #141414; color: white; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Custom Select Component (replaces native <select> dropdown) ─── */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}
.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    text-align: left;
    /* inherits all .form-control base styles */
}
.custom-select-trigger:hover {
    border-color: rgba(249,115,22,0.4);
    background: rgba(255,255,255,0.07);
}
.custom-select-trigger.open {
    border-color: #f97316;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.custom-select-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.custom-select-chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: rgba(255,255,255,0.35);
    transition: transform 0.22s ease, color 0.22s;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.custom-select-trigger.open .custom-select-chevron {
    transform: rotate(180deg);
    color: #f97316;
}
/* Dropdown panel – appended to <body> as a portal, position:fixed */
.custom-select-dropdown {
    display: none;
    position: fixed;
    z-index: 99999;
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    /* grow to fit the longest option; never shrink below the trigger width */
    width: max-content !important;
}
.custom-select-dropdown.open { display: block; }
.custom-select-dropdown::-webkit-scrollbar { width: 3px; }
.custom-select-dropdown::-webkit-scrollbar-track { background: transparent; }
.custom-select-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
/* Option rows */
.custom-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    /* consistent indent via pseudo-element placeholder */
    padding-left: 28px;
    position: relative;
    white-space: nowrap;
}
.custom-select-option::before {
    content: '';
    position: absolute;
    left: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f97316;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s, box-shadow 0.15s;
}
.custom-select-option:hover {
    background: rgba(249,115,22,0.09);
    color: rgba(255,255,255,0.9);
}
.custom-select-option.active {
    background: rgba(249,115,22,0.12);
    color: #fff;
    font-weight: 500;
}
.custom-select-option.active::before {
    opacity: 1;
    box-shadow: 0 0 6px rgba(249,115,22,0.5);
}

@keyframes spin-border {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ---- Buttons ---- */
.btn-primary {
    padding: 10px 24px;
    background: radial-gradient(65.28% 65.28% at 50% 100%, rgba(251,191,36,0.8) 0%, rgba(251,191,36,0) 100%),
                linear-gradient(0deg, #ea580c, #ea580c);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary::before {
    content: "";
    position: absolute;
    inset: 1px;
    background: linear-gradient(177.95deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 100%);
    border-radius: 9999px;
    pointer-events: none;
    z-index: 0;
}
.btn-primary > *:not(.points_wrapper) { position: relative; z-index: 2; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(249,115,22,0.45); }

/* ---- Button floating particles ---- */
@keyframes floating-points {
    0%   { transform: translateY(0); }
    85%  { opacity: 0; }
    100% { transform: translateY(-55px); opacity: 0; }
}
.points_wrapper {
    overflow: hidden;
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 1;
}
.points_wrapper .point {
    bottom: -10px;
    position: absolute;
    animation: floating-points infinite ease-in-out;
    pointer-events: none;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 9999px;
}
.points_wrapper .point:nth-child(1) { left: 10%; opacity: 1;   animation-duration: 2.35s; animation-delay: 0.2s;  }
.points_wrapper .point:nth-child(2) { left: 30%; opacity: 0.7; animation-duration: 2.5s;  animation-delay: 0.5s;  }
.points_wrapper .point:nth-child(3) { left: 25%; opacity: 0.8; animation-duration: 2.2s;  animation-delay: 0.1s;  }
.points_wrapper .point:nth-child(4) { left: 44%; opacity: 0.6; animation-duration: 2.05s; }
.points_wrapper .point:nth-child(5) { left: 50%; opacity: 1;   animation-duration: 1.9s;  }
.points_wrapper .point:nth-child(6) { left: 75%; opacity: 0.5; animation-duration: 1.5s;  animation-delay: 1.5s;  }
.points_wrapper .point:nth-child(7) { left: 88%; opacity: 0.9; animation-duration: 2.2s;  animation-delay: 0.2s;  }

.btn-ghost {
    padding: 10px 16px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.65);
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s, color 0.2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: white; }

.btn-glass {
    position: relative;
    overflow: hidden;
    padding: 8px 18px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(255,255,255,0), rgba(255,255,255,0.04));
    color: rgba(255,255,255,0.92);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 0 22px rgba(249,115,22,0.25), 0 6px 32px rgba(249,115,22,0.12);
    transition: transform 0.3s, box-shadow 0.3s;
}
/* Spinning conic gradient border */
.btn-glass::before {
    content: "";
    position: absolute;
    inset: -100%;
    width: 300%;
    height: 300%;
    left: -100%;
    top: -100%;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 80deg, rgba(253,186,116,0.85) 180deg, transparent 280deg, transparent 360deg);
    animation: spin-border 3s linear infinite;
    z-index: 0;
}
/* Inner dark layer — reveals only the 1px border strip */
.btn-glass::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 9999px;
    background: rgba(8,8,8,0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1;
}
.btn-glass > * { position: relative; z-index: 2; }
.btn-glass:hover { transform: scale(1.04); box-shadow: 0 0 48px 8px rgba(249,115,22,0.38); }

.btn-success {
    padding: 8px 14px;
    background: rgba(34,197,94,0.12);
    color: #4ade80;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}
.btn-success:hover { background: rgba(34,197,94,0.22); }

.btn-danger {
    padding: 8px 14px;
    background: rgba(239,68,68,0.12);
    color: #f87171;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}
.btn-danger:hover { background: rgba(239,68,68,0.22); }

.btn-warning-sm {
    padding: 6px 10px;
    background: rgba(251,191,36,0.12);
    color: #fbbf24;
    font-size: 0.8125rem;
    border: 1px solid rgba(251,191,36,0.2);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}
.btn-warning-sm:hover { background: rgba(251,191,36,0.22); }

.btn-danger-sm {
    padding: 6px 10px;
    background: rgba(239,68,68,0.12);
    color: #f87171;
    font-size: 0.8125rem;
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}
.btn-danger-sm:hover { background: rgba(239,68,68,0.22); }

/* ---- Sidebar Navigation ---- */
.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #737373;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.85); }
.nav-item.active {
    background: rgba(249,115,22,0.1);
    color: #f97316;
    border-color: rgba(249,115,22,0.15);
}
.nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* ---- Mobile Bottom Nav ---- */
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    gap: 3px;
    background: transparent;
    border: none;
    color: #525252;
    cursor: pointer;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.mobile-nav-item.active { color: #f97316; }

/* ---- Data Tables ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #525252;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.75);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* ---- Action cell ---- */
.action-cell { display: flex; gap: 6px; align-items: center; }

/* ---- Alerts ---- */
.alert-info-glass {
    padding: 12px 16px;
    background: rgba(249,115,22,0.08);
    border: 1px solid rgba(249,115,22,0.2);
    border-radius: 8px;
    color: rgba(249,115,22,0.9);
    font-size: 0.875rem;
}
.alert-error-glass {
    padding: 12px 16px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 8px;
    color: rgba(239,68,68,0.9);
    font-size: 0.875rem;
}

/* ---- Toast Notifications ---- */
.toast {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(12px);
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeSlideIn 0.2s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.25); color: #4ade80; }
.toast-error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.25);  color: #f87171; }
.toast-info    { background: rgba(249,115,22,0.15); border: 1px solid rgba(249,115,22,0.25); color: #fb923c; }

/* ---- Badges ---- */
.badge {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}
.badge-orange { background: rgba(249,115,22,0.18); color: #fb923c; }
.badge-green  { background: rgba(34,197,94,0.15);  color: #4ade80; }
.badge-blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-gray   { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }

/* ---- Relatório estruturado ---- */
.cliente-grupo-header {
    padding: 14px 18px;
    background: rgba(249,115,22,0.07);
    border-bottom: 1px solid rgba(249,115,22,0.12);
    font-weight: 600;
    font-size: 0.9375rem;
    color: #f97316;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.projeto-grupo-header {
    padding: 10px 20px;
    background: rgba(255,255,255,0.025);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.875rem;
    color: rgba(255,255,255,0.65);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.projeto-grupo { border-bottom: 1px solid rgba(255,255,255,0.04); }
.projeto-grupo:last-child { border-bottom: none; }

/* ---- Stat cards ---- */
.stat-card-accent {
    background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(251,191,36,0.06));
    border: 1px solid rgba(249,115,22,0.15);
}

/* ---- Summary cards inside report ---- */
.summary-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 16px 20px;
}

/* ---- Spacing utilities ---- */
.space-y-4 > * + * { margin-top: 16px; }
.mt-4 { margin-top: 16px; }
.ml-2 { margin-left: 8px; }
.mb-0 { margin-bottom: 0 !important; }

/* ═══════════════════════════════════════
   Flatpickr — dark design-system theme
   ═══════════════════════════════════════ */

/* Reset the default flatpickr base styles we don't want */
.flatpickr-calendar {
    background: #0e0e0e !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06) !important;
    color: rgba(255,255,255,0.9) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
    padding: 10px !important;
    width: auto !important;
}
/* Hide the arrow pointing to the input */
.flatpickr-calendar::before,
.flatpickr-calendar::after { display: none !important; }

/* Month row */
.flatpickr-months { padding: 2px 0 6px !important; }
.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: white !important;
    height: 36px !important;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: rgba(255,255,255,0.4) !important;
    color: rgba(255,255,255,0.4) !important;
    top: 12px !important;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: white !important; }

/* Month / year label */
.flatpickr-current-month {
    color: white !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding-top: 6px !important;
}
.flatpickr-current-month select.flatpickr-monthDropdown-months {
    background: transparent !important;
    color: white !important;
    border: none !important;
    font-weight: 500 !important;
}
.flatpickr-current-month .numInputWrapper input {
    color: white !important;
}
.numInputWrapper span.arrowUp::after  { border-bottom-color: rgba(255,255,255,0.4) !important; }
.numInputWrapper span.arrowDown::after { border-top-color: rgba(255,255,255,0.4) !important; }

/* Weekday headers */
.flatpickr-weekdays { background: transparent !important; }
span.flatpickr-weekday {
    background: transparent !important;
    color: rgba(255,255,255,0.25) !important;
    font-weight: 600 !important;
    font-size: 11px !important;
}

/* Day cells */
.flatpickr-day {
    color: rgba(255,255,255,0.75) !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    height: 34px !important;
    line-height: 33px !important;
    /* Keep flex-basis at 1/7 so exactly 7 days per row — do NOT override max-width alone */
    flex-basis: 14.2857143% !important;
    max-width: 14.2857143% !important;
}
.flatpickr-day:hover,
.flatpickr-day:focus {
    background: rgba(249,115,22,0.15) !important;
    border-color: transparent !important;
    color: white !important;
}
.flatpickr-day.today {
    border-color: rgba(249,115,22,0.55) !important;
    color: #fb923c !important;
    font-weight: 600 !important;
}
.flatpickr-day.today:hover {
    background: rgba(249,115,22,0.15) !important;
    border-color: rgba(249,115,22,0.55) !important;
    color: #fb923c !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: linear-gradient(135deg, #f97316, #fb923c) !important;
    border-color: transparent !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 0 14px rgba(249,115,22,0.45) !important;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: rgba(255,255,255,0.15) !important;
    background: transparent !important;
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: rgba(255,255,255,0.2) !important;
}
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: rgba(249,115,22,0.08) !important;
    color: rgba(255,255,255,0.4) !important;
}

/* The visible alt input — keep form-control appearance */
.flatpickr-input[readonly],
input.flatpickr-input { cursor: pointer !important; }
