/* ============================================================
   ADS styles - Leave: leave management module base
   Split out of the former monolithic style.css WITHOUT code changes.
   Files are linked in numeric order (see Core/templates/_styles.html) so
   the cascade is identical to the old single file.
   ============================================================ */

/* ============================================================
   Leave Management Module
   ============================================================ */
.ts-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.ts-card h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: var(--gray-900);
}
.ts-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.ts-form-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    min-width: 90px;
}
.ts-input, .ts-select, .ts-textarea {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--text);
    background: var(--white);
}
.ts-textarea { width: 100%; resize: vertical; font-family: inherit; }
.ts-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.ts-btn-primary { background: var(--green); border-color: var(--green); color: var(--white); }
.ts-btn-primary:hover { background: var(--green-dark); }
.ts-btn-sm { padding: 6px 10px; font-size: 12px; }
.ts-badge-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
}
.ts-badge-status.pending  { background:#fff7ed; color:#c2410c; }
.ts-badge-status.approved { background:#fef2f2; color:#b91c1c; }
.ts-badge-status.rejected { background:#f3f4f6; color:#6b7280; }
.ts-badge-status.cancelled{ background:#f3f4f6; color:#9ca3af; }

/* Dashboard leave calendar - compact two-panel design (shrunk) */
.lcal-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; border-radius: 14px; }
.lcal-wrap {
    display: grid;
    grid-template-columns: 82px 1fr;
    grid-template-rows: 1fr;
    min-height: 148px;
    flex: 1 1 auto;
}

/* Left green info panel */
.lcal-side {
    background: linear-gradient(160deg, #16a34a, #15803d);
    color: #fff;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}
.lcal-side-top { font-size: 10px; opacity: 0.9; margin-bottom: 5px; }
.lcal-side-daynum {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
}
.lcal-side-dayname {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    opacity: 0.9;
    margin: 4px 0 0 0;
}

/* Legend footer strip, spans the full width of the calendar card
   underneath both the green side panel and the date grid. */
.lcal-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 7px 12px;
    border-top: 1px solid var(--gray-100, #f3f4f6);
    background: var(--gray-50, #fafafa);
}
.lcal-footer-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--gray-400);
    flex-shrink: 0;
}
.leave-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    font-size: 10px;
    color: var(--gray-600, #4b5563);
    flex: 1;
}
.leave-calendar-legend .legend-swatch {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Right compact calendar panel */
.lcal-main { padding: 8px 10px; display: flex; flex-direction: column; justify-content: center; gap: 3px; height: 100%; box-sizing: border-box; }
.lcal-main-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 3px;
}
.lcal-month-label { font-size: 11px; font-weight: 700; color: var(--gray-900); min-width: 76px; text-align: center; }
.lcal-nav-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 8px;
    cursor: pointer;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.lcal-nav-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.lcal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    font-size: 9px;
    font-weight: 700;
    color: var(--gray-400);
    text-align: center;
    margin-bottom: 2px;
}
.lcal-weekdays span { display: flex; align-items: center; justify-content: center; }
.leave-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(20px, 1fr);
    gap: 2px 2px;
}
.leave-calendar-grid .lcal-cell {
    width: 100%;
    height: 100%;
    max-width: 26px;
    max-height: 26px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--gray-800, var(--gray-700));
    cursor: pointer;
    border: none;
    background: none !important;
    position: relative;
    transition: background 0.12s ease, color 0.12s ease;
}
.leave-calendar-grid .lcal-cell.lcal-has-event {
    background: var(--lcal-bg-color, transparent) !important;
    color: var(--lcal-text-color, var(--gray-800));
}
.leave-calendar-grid .lcal-cell::after {
    content: '';
    position: absolute;
    bottom: 1px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--lcal-dot-color, transparent);
}
.leave-calendar-grid .lcal-cell.lcal-has-event::after { background: none; }
.leave-calendar-grid .lcal-cell:hover { background: var(--gray-100) !important; }
.leave-calendar-grid .lcal-cell.lcal-empty { visibility: hidden; cursor: default; }
.leave-calendar-grid .lcal-cell.lcal-today {
    background: #16a34a !important;
    color: #fff;
}
.leave-calendar-grid .lcal-cell.lcal-today::after { background: #fff; }

@media (max-width: 640px) {

    .lcal-card { max-width: 100%; }
    .lcal-wrap { grid-template-columns: 72px 1fr; min-height: 130px; }
    .lcal-side { padding: 7px 6px; }
    .lcal-side-daynum { font-size: 22px; }
}
