/* =========================
   Reset
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =========================
   General
========================= */

body {
    font-family: Arial, sans-serif;
    min-height: 100vh;
    background: #f4f6fb;
    color: #1f2937;
    padding: 30px 15px;
}


/* =========================
   Main App
========================= */

.app {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}


/* =========================
   Header
========================= */

.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.app-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.app-header p {
    color: #6b7280;
    font-size: 15px;
}


/* =========================
   Calculator Card
========================= */

.calculator-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.calculator-card h2,
.results h2 {
    font-size: 20px;
    margin-bottom: 20px;
}


/* =========================
   Form
========================= */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-group input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    background: #ffffff;
    transition: 0.2s;
}

.form-group input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}


/* =========================
   Schedule
========================= */

.schedule {
    display: flex;
    align-items: end;
    gap: 15px;
    margin-top: 20px;
}

.schedule-separator {
    font-size: 24px;
    padding-bottom: 10px;
    color: #6366f1;
}


/* =========================
   Calculate Button
========================= */

/* #calculateBtn {
    width: 100%;
    height: 50px;
    margin-top: 25px;
    border: none;
    border-radius: 10px;
    background: #6366f1;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

#calculateBtn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

#calculateBtn:active {
    transform: translateY(0);
} */

/* =========================
   Buttons
========================= */

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.button-group button {
    flex: 1;
    height: 50px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}


/* Calculate */

#calculateBtn {
    background: #6366f1;
    color: #ffffff;
}

#calculateBtn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}


/* Reset */

#resetBtn {
    background: #e5e7eb;
    color: #374151;
}

#resetBtn:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}


/* Active */

.button-group button:active {
    transform: translateY(0);
}

/* =========================
   Error Message
========================= */

.error-message {
    display: none;
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 14px;
    line-height: 1.5;
}


/* =========================
   Results
========================= */

.results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.results h2 {
    grid-column: 1 / -1;
    margin-bottom: 5px;
}


/* =========================
   Result Card
========================= */

.result-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.result-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    border-radius: 12px;
    font-size: 22px;
    flex-shrink: 0;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-info span {
    font-size: 13px;
    color: #6b7280;
}

.result-info strong {
    font-size: 18px;
    color: #111827;
}

/* =========================
   Footer
========================= */

.app-footer {
    text-align: center;
    margin-top: 30px;
    color: #9ca3af;
    font-size: 13px;
}


/* =========================
   Mobile
========================= */

@media (max-width: 600px) {

    body {
        padding: 20px 12px;
    }

    .app-header h1 {
        font-size: 27px;
    }

    .calculator-card {
        padding: 20px;
    }

    .schedule {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .schedule-separator {
        display: none;
    }

    .results {
        grid-template-columns: 1fr;
    }

    .results h2 {
        margin-top: 5px;
    }
}


/* =========================
   Dashboard
========================= */

.dashboard {
    margin-top: 10px;
}

.dashboard-header {
    margin-bottom: 18px;
}

.dashboard-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.dashboard-header p {
    color: #6b7280;
    font-size: 14px;
}


/* Dashboard Grid */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}


/* Dashboard Card */

.dashboard-card {
    display: flex;
    align-items: center;
    gap: 16px;

        border: 2px solid transparent;


    background: #ffffff;

    padding: 22px;

    border-radius: 18px;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.06);

    transition:
        transform 0.2s,
        box-shadow 0.2s;
}


.dashboard-card:hover {
    border: 2px solid #6366f1;

    transform: translateY(-3px);

    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.09);
}


/* Primary Card */

.primary-card {
    border: 2px solid #63f1c4;
}


/* Dashboard Icon */

.dashboard-icon {
    width: 55px;
    height: 55px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eef2ff;

    border-radius: 15px;

    font-size: 26px;

    flex-shrink: 0;
}


/* Dashboard Content */

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 5px;

    min-width: 0;
}


.dashboard-content span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}


.dashboard-content strong {
    color: #111827;
    font-size: 21px;
    font-weight: 700;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.dashboard-content small {
    color: #9ca3af;
    font-size: 12px;
}


/* =========================
   Dashboard Mobile
========================= */

@media (max-width: 600px) {

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        padding: 18px;
    }

    .dashboard-icon {
        width: 50px;
        height: 50px;
        font-size: 23px;
    }

    .dashboard-content strong {
        font-size: 19px;
    }
}

/* =========================
   Leave History
========================= */

.history-section {
    margin-top: 25px;
}

.history-header {
    margin-bottom: 18px;
}

.history-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.history-header p {
    color: #6b7280;
    font-size: 14px;
}


/* Table Container */

.history-table-wrapper {
    background: #ffffff;
    border-radius: 18px;
    overflow-x: auto;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}


/* Table */

.history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 550px;
}


/* Table Header */

.history-table thead {
    background: #f8f9ff;
}

.history-table th {
    padding: 16px;
    text-align: left;

    color: #6b7280;

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
}


/* Table Body */

.history-table td {
    padding: 16px;

    border-top: 1px solid #f1f1f5;

    color: #374151;

    font-size: 14px;

    white-space: nowrap;
}


/* Row Hover */

.history-table tbody tr {
    transition: background 0.2s;
}

.history-table tbody tr:hover {
    background: #fafaff;
}


/* Leave Number */

.history-table td:first-child {
    font-weight: 700;
    color: #6366f1;
}


/* Status */

.status {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 12px;
    font-weight: 600;
}


/* Completed */

.status.completed {
    background: #dcfce7;
    color: #15803d;
}


/* Current */

.status.current {
    background: #fef3c7;
    color: #b45309;
}


/* Upcoming */

.status.upcoming {
    background: #e0e7ff;
    color: #4338ca;
}


/* Ends After Work */

.status.partial {
    background: #fce7f3;
    color: #be185d;
}


/* Mobile */

@media (max-width: 600px) {

    .history-table-wrapper {
        border-radius: 14px;
    }

    .history-table th,
    .history-table td {
        padding: 13px 12px;
    }

    .history-header h2 {
        font-size: 20px;
    }
}

/* =========================
   Calendar
========================= */

.calendar-section {
    margin-top: 25px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.calendar-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.calendar-header p {
    color: #6b7280;
    font-size: 14px;
}


/* Calendar Navigation */

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-navigation button {
    width: 38px;
    height: 38px;

    border: none;
    border-radius: 10px;

    background: #eef2ff;
    color: #4f46e5;

    font-size: 24px;
    line-height: 1;

    cursor: pointer;

    transition: 0.2s;
}

.calendar-navigation button:hover {
    background: #e0e7ff;
    transform: translateY(-1px);
}

.calendar-navigation strong {
    min-width: 125px;

    text-align: center;

    font-size: 15px;
    color: #374151;
}


/* Calendar Card */

.calendar-card {
    background: #ffffff;

    padding: 20px;

    border-radius: 18px;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.06);
}


/* Week Days */

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays {
    margin-bottom: 8px;
}

.calendar-weekdays div {
    padding: 10px 5px;

    text-align: center;

    color: #9ca3af;

    font-size: 12px;
    font-weight: 600;

    text-transform: uppercase;
}


/* Calendar Day */

.calendar-day {
    min-height: 70px;

    padding: 8px;

    border: 1px solid #f1f1f5;

    display: flex;
    align-items: flex-start;
    justify-content: flex-end;

    position: relative;

    cursor: default;

    transition: 0.2s;
}


/* Empty Days */

.calendar-day.empty {
    background: #fafafa;
}


/* Day Number */

.day-number {
    font-size: 13px;
    font-weight: 600;
}


/* Work Day */

.calendar-day.work {
    background: #6d63f7;
}

.calendar-day.work .day-number {
    color: #edf4ff;
}


/* Leave Day */

.calendar-day.leave {
    background: #61fdaf;
}

.calendar-day.leave .day-number {
    color: #2f3430;
}


/* Today */

.calendar-day.today {
    background: #f163b8;
    color: wheat;
    box-shadow:
        inset 0 0 0 2px #f163b8;
}


/* Work End */

.calendar-day.work-end {
    background: #dc2626 !important;
    box-shadow:
        inset 0 0 0 3px #dc2626;
}


/* Current Leave */

.calendar-day.current-leave {
    background: #fef3c7;
}


/* Next Leave */

/* .calendar-day.next-leave {
    background: #fcff65;
} */
.calendar-day.next-leave {
    background: #edf55a;
    box-shadow:
        inset 0 0 0 3px #edf55a;
}


/* Calendar Legend */

.calendar-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;

    margin-top: 20px;
    padding-top: 18px;

    border-top: 1px solid #f1f1f5;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;

    color: #6b7280;

    font-size: 12px;
}

.legend-color {
    width: 12px;
    height: 12px;

    border-radius: 4px;
}

.legend-color.work {
    /* background: #f8fafc; */
    background: #6d63f7;
    border: 1px solid #d1d5db;
}

.legend-color.leave {
    /* background: #eef2ff; */
    background: #61fdaf;
}

.legend-color.today {
    /* background: #6366f1; */
    background: #f163b8;
}

.legend-color.end {
    background: #dc2626;
}


/* =========================
   Calendar Mobile
========================= */

@media (max-width: 600px) {

    .calendar-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-navigation {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-navigation strong {
        flex: 1;
    }

    .calendar-card {
        padding: 10px;
    }

    .calendar-day {
        min-height: 55px;
        padding: 6px;
    }

    .calendar-weekdays div {
        font-size: 10px;
        padding: 8px 2px;
    }

    .day-number {
        font-size: 12px;
    }

    .calendar-legend {
        gap: 12px;
    }
}