/* =========================================================
   SALIHIN SPS e-Attendance
========================================================= */

/* =========================================================
   PAGE TOKENS
========================================================= */

.sps-eattendance-page {
    --eatt-page-bg: #f6faff;
    --eatt-surface: rgba(255, 255, 255, .94);
    --eatt-surface-solid: #ffffff;
    --eatt-surface-soft: rgba(247, 252, 255, .96);
    --eatt-surface-tint: rgba(232, 249, 255, .78);
    --eatt-border: rgba(181, 207, 235, .78);
    --eatt-border-soft: rgba(220, 234, 248, .92);
    --eatt-text: #15213b;
    --eatt-muted: #4f617a;
    --eatt-primary: #2768cf;
    --eatt-primary-2: #1f7ee8;
    --eatt-cyan: #18bfd3;
    --eatt-success: #24a84f;
    --eatt-success-2: #169545;
    --eatt-danger: #de6376;
    --eatt-danger-2: #ef7d91;
    --eatt-radius-page: 18px;
    --eatt-radius-card: 20px;
    --eatt-radius-inner: 18px;
    --eatt-radius-control: 11px;
    --eatt-shadow: 0 16px 42px rgba(28, 78, 136, .10);
    --eatt-shadow-soft: 0 10px 24px rgba(28, 78, 136, .08);
    --eatt-shadow-hover: 0 20px 48px rgba(28, 78, 136, .14);
    --eatt-gradient: linear-gradient(135deg, var(--eatt-cyan) 0%, var(--eatt-primary) 100%);

    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: calc(100vh - 145px);
    padding: 14px;
    border-radius: var(--eatt-radius-page);
    background:
        radial-gradient(circle at 10% 8%, rgba(24, 191, 211, .14), transparent 25%),
        radial-gradient(circle at 88% 2%, rgba(39, 104, 207, .10), transparent 24%),
        linear-gradient(180deg, #f8fcff 0%, var(--eatt-page-bg) 100%);
    color: var(--eatt-text);
}

/*.sps-eattendance-page::before {*/
/*    content: "";*/
/*    position: absolute;*/
/*    inset: 0;*/
/*    z-index: 0;*/
/*    pointer-events: none;*/
/*    background-image:*/
/*        linear-gradient(rgba(24, 191, 211, .035) 1px, transparent 1px),*/
/*        linear-gradient(90deg, rgba(39, 104, 207, .032) 1px, transparent 1px);*/
/*    background-size: 36px 36px;*/
/*    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent 82%);*/
/*}*/

/*.sps-eattendance-page::after {*/
/*    content: "";*/
/*    position: absolute;*/
/*    inset: -24%;*/
/*    z-index: 0;*/
/*    pointer-events: none;*/
/*    background:*/
/*        radial-gradient(circle at 18% 16%, rgba(24, 191, 211, .15), transparent 24%),*/
/*        radial-gradient(circle at 78% 20%, rgba(39, 104, 207, .11), transparent 23%),*/
/*        radial-gradient(circle at 52% 100%, rgba(24, 191, 211, .09), transparent 30%);*/
/*    filter: blur(10px);*/
/*    opacity: .82;*/
/*    animation: eattAmbientShift 13s ease-in-out infinite alternate;*/
/*}*/

.sps-eattendance-shell {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
}

@keyframes eattAmbientShift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: .62;
    }

    100% {
        transform: translate3d(0, -12px, 0) scale(1.03);
        opacity: .95;
    }
}

/* =========================================================
   CARD BASE
========================================================= */

.sps-eatt-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--eatt-border);
    border-radius: var(--eatt-radius-card);
    background: var(--eatt-surface);
    box-shadow: var(--eatt-shadow);
    backdrop-filter: blur(10px);
}

.sps-eatt-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(24, 191, 211, .06), transparent),
        radial-gradient(circle at 96% 0%, rgba(24, 191, 211, .10), transparent 24%);
    opacity: .9;
}

/*    content: "";*/
/*    position: absolute;*/
/*    top: 0;*/
/*    bottom: 0;*/
/*    left: -34%;*/
/*    width: 30%;*/
/*    z-index: 2;*/
/*    pointer-events: none;*/
/*    background: linear-gradient(*/
/*        90deg,*/
/*        transparent 0%,*/
/*        rgba(255, 255, 255, .05) 28%,*/
/*        rgba(24, 191, 211, .12) 50%,*/
/*        rgba(255, 255, 255, .05) 72%,*/
/*        transparent 100%*/
/*    );*/
/*    transform: skewX(-18deg);*/
/*    animation: eattCardScan 8s linear infinite;*/
/*}*/

.sps-eatt-card > * {
    position: relative;
    z-index: 1;
}

@keyframes eattCardScan {
    0% {
        left: -38%;
    }

    100% {
        left: 125%;
    }
}

/* =========================================================
   CARD HEADER
========================================================= */

.sps-eatt-card-head {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--eatt-border);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .96) 0%, var(--eatt-surface-tint) 100%),
        linear-gradient(90deg, rgba(24, 191, 211, .08), transparent 54%);
}

.sps-eatt-title-wrap,
.sps-staff-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sps-eatt-card-head h4,
.sps-staff-head h5 {
    margin: 0 0 4px;
    color: var(--eatt-text);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -.025em;
}

.sps-eatt-card-head h4 {
    font-size: 28px;
}

.sps-staff-head h5 {
    font-size: 18px;
}

.sps-eatt-card-head p,
.sps-staff-head p {
    margin: 0;
    color: var(--eatt-muted);
    font-size: 13px;
    font-weight: 700;
}

/* =========================================================
   ICONS / STATUS
========================================================= */

.sps-eatt-title-icon,
.sps-staff-avatar {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #ffffff;
    background: var(--eatt-gradient);
    box-shadow: 0 14px 28px rgba(36, 106, 205, .24);
    animation: eattIconBreath 4.4s ease-in-out infinite;
}

.sps-eatt-title-icon::after,
.sps-staff-avatar::after {
    content: "";
    position: absolute;
    top: -35%;
    bottom: -35%;
    left: -90%;
    width: 55%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
    transform: skewX(-20deg);
}

.sps-eatt-card:hover .sps-eatt-title-icon::after,
.sps-staff-panel:hover .sps-staff-avatar::after {
    animation: eattIconShine .75s ease;
}

.sps-eatt-title-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
}

.sps-staff-avatar {
    width: 54px;
    height: 54px;
    border-radius: 999px;
}

.sps-eatt-title-icon svg,
.sps-staff-avatar svg {
    width: 29px;
    height: 29px;
    color: currentColor;
    stroke: currentColor;
    stroke-width: 2.35;
}

@keyframes eattIconBreath {
    0%, 100% {
        box-shadow:
            0 10px 22px rgba(23, 126, 207, .20),
            0 0 0 0 rgba(24, 191, 211, 0);
    }

    50% {
        box-shadow:
            0 12px 26px rgba(23, 126, 207, .23),
            0 0 0 5px rgba(24, 191, 211, .06);
    }
}

@keyframes eattIconShine {
    0% {
        left: -90%;
    }

    100% {
        left: 135%;
    }
}

.sps-eatt-status-pill {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid rgba(36, 168, 79, .22);
    border-radius: 999px;
    background: rgba(232, 248, 239, .95);
    color: var(--eatt-success-2);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.sps-eatt-status-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--eatt-success);
    box-shadow: 0 0 0 4px rgba(36, 168, 79, .10);
    animation: eattStatusPulse 2.4s ease-in-out infinite;
}

@keyframes eattStatusPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(36, 168, 79, .10);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(36, 168, 79, .06);
    }
}

/* =========================================================
   FORM / CLOCK LAYOUT
========================================================= */

.sps-eatt-form-body {
    padding: 24px;
}

.sps-eatt-form-grid {
    display: grid;
    grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.05fr);
    gap: 28px;
    align-items: start;
}

.sps-clock-panel {
    display: grid;
    gap: 18px;
}

.sps-clock-display {
    position: relative;
    overflow: hidden;
    min-height: 144px;
    display: grid;
    place-items: center;
    padding: 24px;
    border: 1px solid var(--eatt-border);
    border-radius: var(--eatt-radius-inner);
    background:
        linear-gradient(135deg, rgba(24, 191, 211, .12), rgba(39, 104, 207, .08)),
        rgba(255, 255, 255, .96);
    box-shadow: var(--eatt-shadow-soft);
    text-align: center;
}

.sps-clock-display::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(24, 191, 211, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(39, 104, 207, .05) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: .45;
}

.sps-clock-display::after {
    content: "";
    position: absolute;
    top: -35%;
    left: -20%;
    width: 140%;
    height: 34%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: rotate(-8deg);
    animation: eattClockScan 7s ease-in-out infinite;
}

.sps-clock-display > div {
    position: relative;
    z-index: 1;
}

@keyframes eattClockScan {
    0%, 35% {
        top: -38%;
        opacity: 0;
    }

    50% {
        opacity: .8;
    }

    100% {
        top: 108%;
        opacity: 0;
    }
}

.sps-clock-time {
    display: block;
    margin-bottom: 10px;
    color: var(--eatt-text);
    font-size: clamp(36px, 4vw, 50px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.045em;
}

.sps-clock-date {
    color: var(--eatt-muted);
    font-size: 15px;
    font-weight: 800;
}

.sps-clock-fields,
.sps-clock-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* =========================================================
   FIELD ELEMENTS
========================================================= */

.sps-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--eatt-text);
    font-size: 13px;
    font-weight: 900;
}

.sps-field select,
.sps-field input,
.sps-table-length select,
.sps-table-search input {
    width: 100%;
    border: 1px solid rgba(168, 193, 224, .88);
    border-radius: var(--eatt-radius-control);
    background: var(--eatt-surface-solid);
    color: #26354e;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.sps-field select,
.sps-field input {
    min-height: 44px;
    padding: 0 14px;
    font-size: 13px;
}

.sps-table-length select,
.sps-table-search input {
    height: 38px;
    padding: 0 12px;
}

.sps-field select:focus,
.sps-field input:focus,
.sps-table-length select:focus,
.sps-table-search input:focus {
    border-color: var(--eatt-primary-2);
    box-shadow: 0 0 0 4px rgba(31, 126, 232, .12);
}

/* =========================================================
   BUTTONS
========================================================= */

.sps-eatt-btn {
    position: relative;
    overflow: hidden;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: var(--eatt-radius-control);
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(32, 82, 140, .17);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.sps-eatt-btn::after {
    content: "";
    position: absolute;
    top: -45%;
    bottom: -45%;
    left: -80%;
    width: 45%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
    transform: skewX(-18deg);
    opacity: 0;
}

.sps-eatt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(32, 82, 140, .22);
    filter: saturate(1.05);
}

.sps-eatt-btn:hover::after {
    opacity: 1;
    animation: eattButtonShine .72s ease;
}

@keyframes eattButtonShine {
    0% {
        left: -80%;
    }

    100% {
        left: 135%;
    }
}

.sps-eatt-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.6;
}

.sps-btn-clock-in,
.sps-btn-print {
    background: linear-gradient(135deg, #31bf59, var(--eatt-success-2));
}

.sps-btn-clock-out {
    background: linear-gradient(135deg, var(--eatt-danger-2), var(--eatt-danger));
}

.sps-btn-submit {
    background: linear-gradient(135deg, #3189ee, #1769df);
}

/* =========================================================
   STAFF PANEL
========================================================= */

.sps-staff-panel {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--eatt-border);
    border-radius: var(--eatt-radius-inner);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(247, 252, 255, .95));
    box-shadow: var(--eatt-shadow-soft);
}

.sps-staff-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(24, 191, 211, .06), transparent 45%),
        radial-gradient(circle at 100% 0%, rgba(39, 104, 207, .08), transparent 28%);
}

.sps-staff-panel > * {
    position: relative;
    z-index: 1;
}

.sps-staff-head {
    margin-bottom: 16px;
}

.sps-staff-list {
    display: grid;
    gap: 10px;
}

.sps-staff-row {
    display: grid;
    grid-template-columns: 150px 16px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: #24344f;
    font-size: 14px;
}

.sps-staff-row span:first-child {
    color: #52637d;
    font-weight: 800;
}

.sps-staff-row strong {
    color: var(--eatt-text);
    font-weight: 800;
}

/* =========================================================
   HISTORY / TABLE
========================================================= */

.sps-history-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 150px 150px;
    gap: 12px;
    align-items: end;
    padding: 24px;
    border-bottom: 1px solid var(--eatt-border);
}

.sps-history-tools,
.sps-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sps-history-tools {
    padding: 18px 24px 14px;
}

.sps-table-footer {
    padding: 0 24px 22px;
    color: var(--eatt-muted);
    font-size: 13px;
}

.sps-table-length,
.sps-table-search {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #31425f;
    font-size: 13px;
    font-weight: 700;
}

.sps-table-search input {
    min-width: 190px;
}

.sps-table-wrap {
    overflow-x: auto;
    padding: 0 24px 20px;
}

.sps-eatt-table {
    width: 100%;
    min-width: 980px;
    overflow: hidden;
    border: 1px solid var(--eatt-border-soft);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 14px;
    background: var(--eatt-surface-solid);
}

.sps-eatt-table th,
.sps-eatt-table td {
    padding: 14px 12px;
    border-right: 1px solid var(--eatt-border-soft);
    border-bottom: 1px solid var(--eatt-border-soft);
    color: #24344f;
    font-size: 13px;
    vertical-align: middle;
}

.sps-eatt-table th:last-child,
.sps-eatt-table td:last-child {
    border-right: 0;
}

.sps-eatt-table tr:last-child td {
    border-bottom: 0;
}

.sps-eatt-table th {
    background: linear-gradient(180deg, #fbfdff, #f4faff);
    color: var(--eatt-text);
    font-weight: 900;
    white-space: nowrap;
}

.sps-eatt-table .empty-row td {
    padding: 22px 12px;
    color: #65768e;
    text-align: center;
}

.sps-pagination {
    display: flex;
    gap: 8px;
}

.sps-pagination button {
    height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(168, 193, 224, .88);
    border-radius: 9px;
    background: var(--eatt-surface-solid);
    color: #58687f;
    font-weight: 800;
}

/* =========================================================
   DARK MODE
========================================================= */

[data-bs-theme="dark"] .sps-eattendance-page {
    --eatt-page-bg: #08111d;
    --eatt-surface: rgba(13, 24, 39, .94);
    --eatt-surface-solid: rgba(10, 20, 34, .96);
    --eatt-surface-soft: rgba(17, 31, 49, .96);
    --eatt-surface-tint: rgba(17, 31, 49, .92);
    --eatt-border: rgba(83, 132, 176, .48);
    --eatt-border-soft: rgba(83, 132, 176, .28);
    --eatt-text: #eaf4ff;
    --eatt-muted: #a9b9cb;
    --eatt-shadow: 0 18px 42px rgba(0, 0, 0, .28);
    --eatt-shadow-soft: 0 12px 28px rgba(0, 0, 0, .22);

    background:
        radial-gradient(circle at 10% 8%, rgba(24, 191, 211, .10), transparent 25%),
        radial-gradient(circle at 88% 2%, rgba(39, 104, 207, .10), transparent 24%),
        linear-gradient(180deg, #0b1421 0%, var(--eatt-page-bg) 100%);
}

[data-bs-theme="dark"] .sps-eatt-card-head,
[data-bs-theme="dark"] .sps-clock-display,
[data-bs-theme="dark"] .sps-staff-panel {
    background: linear-gradient(135deg, rgba(17, 31, 49, .98), rgba(13, 24, 39, .96));
}

[data-bs-theme="dark"] .sps-field select,
[data-bs-theme="dark"] .sps-field input,
[data-bs-theme="dark"] .sps-table-length select,
[data-bs-theme="dark"] .sps-table-search input,
[data-bs-theme="dark"] .sps-eatt-table,
[data-bs-theme="dark"] .sps-pagination button {
    background: rgba(9, 18, 31, .96);
    border-color: rgba(107, 151, 190, .35);
    color: #eaf4ff;
}

[data-bs-theme="dark"] .sps-eatt-table th {
    background: linear-gradient(180deg, rgba(17, 31, 49, .98), rgba(13, 24, 39, .96));
    color: #f4f8fc;
}

[data-bs-theme="dark"] .sps-eatt-table td,
[data-bs-theme="dark"] .sps-staff-row,
[data-bs-theme="dark"] .sps-table-length,
[data-bs-theme="dark"] .sps-table-search {
    color: #c8d7e8;
}

[data-bs-theme="dark"] .sps-staff-row strong {
    color: #ffffff;
}

[data-bs-theme="dark"] .sps-eatt-status-pill {
    background: rgba(36, 168, 79, .14);
    color: #6ee08e;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1400px) {
    .sps-eatt-form-grid {
        grid-template-columns: 1fr;
    }

    .sps-staff-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 28px;
    }

    .sps-staff-row {
        grid-template-columns: 128px 12px minmax(0, 1fr);
    }
}

@media (max-width: 991px) {
    .sps-eatt-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .sps-clock-fields,
    .sps-clock-actions,
    .sps-staff-list,
    .sps-history-filters {
        grid-template-columns: 1fr;
    }

    .sps-history-tools {
        align-items: flex-start;
        flex-direction: column;
    }

    .sps-table-search {
        width: 100%;
    }

    .sps-table-search input {
        min-width: 0;
    }
}

@media (max-width: 575px) {
    .sps-eattendance-page {
        padding: 10px;
    }

    .sps-eatt-card-head,
    .sps-eatt-form-body,
    .sps-history-filters,
    .sps-history-tools,
    .sps-table-wrap,
    .sps-table-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .sps-eatt-title-wrap {
        gap: 12px;
    }

    .sps-eatt-title-icon {
        width: 46px;
        height: 46px;
    }

    .sps-eatt-card-head h4 {
        font-size: 23px;
    }

    .sps-staff-row {
        grid-template-columns: 1fr;
        gap: 2px;
        padding-bottom: 8px;
        border-bottom: 1px dashed var(--eatt-border);
    }

    .sps-staff-row span:nth-child(2) {
        display: none;
    }

    .sps-table-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .sps-eattendance-page::after,
    .sps-eatt-card::after,
    .sps-clock-display::after,
    .sps-eatt-title-icon,
    .sps-staff-avatar,
    .sps-eatt-status-pill::before {
        animation: none;
    }

    .sps-eatt-btn,
    .sps-field select,
    .sps-field input,
    .sps-table-length select,
    .sps-table-search input {
        transition: none;
    }
}


/* =========================================================
   ACTIVE MENU
========================================================= */
.main-menu .menu-link.active,
.main-menu .menu-link[aria-current="page"] {
    background: rgba(255, 255, 255, .18);
    color: #ffffff !important;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

.d-none {
    display: none !important;
}
