/* ════════════════════════════════════════════════════════════════════════════
   SkuyJadwal - Gaya halaman jadwal (index.html)
   Palet warna didefinisikan di :root. Tata letak dioptimalkan untuk layar HP.
   ════════════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

html {
    /* Ukuran dasar fluid: skala UI mengikuti lebar layar secara mulus.
       14.56px (≈ tampilan lama di HP) → 18.24px di layar lebar. */
    font-size: clamp(14.56px, calc(13.33px + 0.3407vw), 18.24px);
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --bg-color: #f1f6f9;
    --color-1: #021024;
    --color-2: #052659;
    --color-3: #5483b3;
    --color-4: #7da0ca;
    --color-5: #c1e8ff;
    --white: #ffffff;

    /* Warna semantik */
    --success: #28a745;
    --danger: #dc3545;
    --error: #ff4d4d;

    /* Lebar kolom konten utama (dipakai juga untuk menyelaraskan tombol notif) */
    --content-max: 26.875rem;
}

body {
    padding: 1rem 0.625rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 1.25rem));
    background-color: var(--bg-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cdefs%3E%3Cstyle%3E.b%7Bfill:none;stroke:%23052659;stroke-width:0.7;opacity:0.13%7D%3C/style%3E%3C/defs%3E%3C!-- Kawung pattern --%3E%3Ccircle class='b' cx='20' cy='20' r='12'/%3E%3Ccircle class='b' cx='60' cy='20' r='12'/%3E%3Ccircle class='b' cx='20' cy='60' r='12'/%3E%3Ccircle class='b' cx='60' cy='60' r='12'/%3E%3Ccircle class='b' cx='40' cy='40' r='12'/%3E%3Ccircle class='b' cx='0' cy='40' r='12'/%3E%3Ccircle class='b' cx='80' cy='40' r='12'/%3E%3Ccircle class='b' cx='40' cy='0' r='12'/%3E%3Ccircle class='b' cx='40' cy='80' r='12'/%3E%3C!-- inner detail --%3E%3Ccircle class='b' cx='20' cy='20' r='5'/%3E%3Ccircle class='b' cx='60' cy='20' r='5'/%3E%3Ccircle class='b' cx='20' cy='60' r='5'/%3E%3Ccircle class='b' cx='60' cy='60' r='5'/%3E%3Ccircle class='b' cx='40' cy='40' r='5'/%3E%3C!-- diamond accent --%3E%3Cpath class='b' d='M40 28 L52 40 L40 52 L28 40 Z'/%3E%3Cpath class='b' d='M20 8 L28 16 L20 24 L12 16 Z'/%3E%3Cpath class='b' d='M60 8 L68 16 L60 24 L52 16 Z'/%3E%3Cpath class='b' d='M20 56 L28 64 L20 72 L12 64 Z'/%3E%3Cpath class='b' d='M60 56 L68 64 L60 72 L52 64 Z'/%3E%3C/svg%3E");
    background-size: 5rem 5rem;
    color: var(--color-1);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    transition: background 0.5s ease;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 0.625rem 0.9375rem;
    cursor: pointer;
    border-radius: 50%;
    z-index: 3100;
    transition: 0.3s;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.4);
}

.nav-prev {
    left: 0.625rem;
}

.nav-next {
    right: 0.625rem;
}

#modal-counter {
    position: absolute;
    bottom: 1.25rem;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.3125rem 0.9375rem;
    border-radius: 1.25rem;
    font-size: 0.875rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 85%;
    border-radius: 0.9375rem;
    box-shadow: 0 0 1.875rem rgba(0, 0, 0, 0.5);
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-content.fade-anim {
    opacity: 0;
    transform: scale(0.95);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal-overlay.hide-anim {
    opacity: 0;
}

.modal-overlay.hide-anim .modal-content {
    transform: scale(0.85);
    opacity: 0;
}

.modal-content.zoomed {
    cursor: zoom-out;
    transition: transform 0.1s ease !important;
}

.container {
    width: 100%;
    max-width: var(--content-max);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.glass-card {
    background: var(--color-5);
    border: 0.0625rem solid var(--color-4);
    border-radius: 1rem;
    padding: 0.875rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.9375rem rgba(5, 38, 89, 0.05);
}

.header-strip {
    border-top: 0.5rem solid var(--color-2);
    position: relative;
    background: var(--white);
}

#clock {
    font-size: 2.625rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.125rem;
    color: var(--color-2);
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    z-index: 5;
}

#clock:active {
    transform: scale(0.95);
}

#full-date {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-3);
    margin-bottom: 0.5rem;
}

#quote-popup {
    position: absolute;
    top: 4.6875rem;
    left: 50%;
    transform: translate(-50%, -0.625rem) scale(0.9);
    background: var(--white);
    color: var(--color-1);
    padding: 1.125rem;
    border-radius: 1.125rem;
    font-size: 0.875rem;
    text-align: center;
    width: 90%;
    max-width: 20rem;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    border: 0.0625rem solid var(--color-4);
    box-shadow: 0 0.9375rem 2.1875rem rgba(5, 38, 89, 0.1);
}

#quote-popup.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.status-container {
    font-size: 0.75rem;
    background: var(--white);
    padding: 0.5625rem;
    border-radius: 0.75rem;
    margin-top: 0.5rem;
    border: 0.0625rem solid var(--color-4);
}

.status-now {
    color: var(--color-2);
    font-weight: 800;
    margin-bottom: 0.1875rem;
}

.status-next {
    color: var(--color-3);
    font-weight: 600;
    font-size: 0.6875rem;
}

.nav-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
}

.btn-nav {
    background: var(--color-2);
    border: none;
    color: var(--color-5);
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-nav:hover {
    background: var(--color-1);
}

.current-day-box {
    flex-grow: 1;
    padding: 0.5rem;
    font-weight: 700;
    font-size: 0.9375rem;
    background: var(--white);
    border: 0.0625rem solid var(--color-4);
    color: var(--color-1);
}

.week-toggle {
    display: flex;
    gap: 0.625rem;
    justify-content: center;
}

.btn-week {
    background: var(--white);
    border: 0.0625rem solid var(--color-4);
    color: var(--color-3);
    padding: 0.375rem 1.125rem;
    border-radius: 1.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-week.active {
    background: var(--color-3);
    color: var(--white);
    border-color: var(--color-3);
}

.schedule-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.2fr 0.7fr;
    gap: 0.4375rem;
}

.grid-header {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.375rem;
    background: var(--white);
    color: var(--color-2);
    border-radius: 0.5rem;
    text-align: center;
    border-bottom: 0.125rem solid var(--color-4);
}

.grid-column {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.item-box {
    background: var(--white);
    padding: 0.625rem 0.25rem;
    border-radius: 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 0.0625rem solid var(--color-4);
    border-left: 0.25rem solid var(--color-3);
    color: var(--color-1);
    transition: all 0.3s ease;
    flex-direction: column;
    gap: 0.125rem;
    position: relative;
    box-shadow: 0 0.125rem 0.25rem rgba(5, 38, 89, 0.02);
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.item-box:hover {
    background: var(--color-5);
    border-color: var(--color-3);
}

.input-edit {
    width: 100%;
    background: transparent;
    color: var(--color-1);
    border: 0.0625rem solid var(--color-2);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    border-radius: 0.3125rem;
    padding: 0.1875rem 0.125rem;
    font-family: inherit;
}

input[type="time"].input-edit {
    font-size: 0.75rem;
    color-scheme: light;
}

.highlight {
    background: var(--color-2) !important;
    color: var(--color-5) !important;
    border-left: 0.5rem solid var(--color-1) !important;
    z-index: 2;
    box-shadow: 0 0.5rem 1.25rem rgba(5, 38, 89, 0.2);
    animation: pulse-glow-light 2s infinite ease-in-out;
}

@keyframes pulse-glow-light {
    0% {
        box-shadow: 0 0 0.625rem rgba(5, 38, 89, 0.1);
    }

    50% {
        box-shadow: 0 0 1.25rem rgba(5, 38, 89, 0.3);
    }

    100% {
        box-shadow: 0 0 0.625rem rgba(5, 38, 89, 0.1);
    }
}

.task-input-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.task-section p {
    margin-top: 0.875rem !important;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
}

input[type="text"] {
    flex-grow: 1;
    background: var(--white);
    border: 0.125rem solid var(--color-4);
    padding: 0.5625rem;
    border-radius: 0.625rem;
    color: var(--color-1);
    font-weight: 600;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--color-2);
}

.btn-add {
    background: var(--color-2);
    color: var(--color-5);
    border: none;
    width: 2.625rem;
    height: 2.625rem;
    border-radius: 0.625rem;
    font-weight: bold;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-add:hover {
    background: var(--color-1);
}

.task-list {
    list-style: none;
    margin-top: 0.625rem;
}

.task-item {
    background: var(--white);
    padding: 0.5625rem 0.75rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    margin-bottom: 0.375rem;
    border: 0.0625rem solid var(--color-4);
    border-left: 0.25rem solid var(--color-3);
    gap: 0.5rem;
    color: var(--color-1);
    font-weight: 600;
    transition: all 0.4s ease-in-out;
    position: relative;
    padding-bottom: 2.625rem !important;
}

.task-item.done {
    opacity: 0.5;
    border-left-color: var(--color-4);
    background: var(--bg-color);
}

.task-item.done span {
    text-decoration: line-through;
    color: var(--color-3);
}

.task-check-custom {
    width: 1.625rem;
    height: 1.625rem;
    min-width: 1.625rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease;
    /* Reset gaya default <button> */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-check-custom:active {
    transform: scale(0.85);
}

.task-text {
    flex-grow: 1;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    padding-right: 2.1875rem !important;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: anywhere;
    display: block;
}

.task-img {
    display: block;
    max-width: 100%;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    border: 0.0625rem solid var(--color-5);
    cursor: pointer;
}

.schedule-actions {
    text-align: center;
    margin-top: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.btn-save {
    background-color: var(--white);
    color: var(--success);
    border: 0.125rem solid var(--success);
    border-radius: 0.625rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    transition: all 0.1s ease;
    box-shadow: 0 0.3125rem 0 var(--success);
    margin-bottom: 0.0625rem;
    width: 100%;
}

#btn-edit-mode {
    background-color: var(--white);
    color: var(--color-2);
    border: 0.125rem solid var(--color-2);
    border-radius: 0.625rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    transition: all 0.1s ease;
    box-shadow: 0 0.3125rem 0 var(--color-2);
    margin-bottom: 0.0625rem;
    width: 100%;
    animation: fadeInUp 0.8s ease backwards;
}

#btn-edit-mode:active {
    box-shadow: 0 0.125rem 0 var(--color-2);
    transform: translateY(0.25rem);
}

#btn-edit-mode.editing {
    background-color: #fff0f0;
    color: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 0.375rem 0 var(--danger);
}

#btn-edit-mode.editing:active {
    box-shadow: 0 0.125rem 0 var(--danger);
}

.notif-fab {
    position: fixed;
    top: 0.875rem;
    right: 0.875rem;
    background: var(--color-2);
    color: var(--color-5);
    width: 2.625rem;
    height: 2.625rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 0.25rem 0.9375rem rgba(5, 38, 89, 0.3);
    z-index: 999;
    transition: transform 0.2s;
    /* Reset gaya default <button> */
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
}

.modal-card {
    text-align: center;
    position: relative;
    padding: 1.375rem;
    width: 90%;
    max-width: 20rem;
    background: var(--white);
    border-radius: 1.25rem;
    border: 0.0625rem solid var(--color-4);
    box-shadow: 0 0.9375rem 1.875rem rgba(5, 38, 89, 0.1);
}

/* ════════════════════════════════════════════════════════════════
   UNIFIED MODAL ALERT
   Satu container <div id="modal-alert" class="modal-alert"> dipakai untuk
   info, loading (upload/save), dan success — visibilitas sub-elemen
   diatur lewat [data-state="info|loading|success"].
   ════════════════════════════════════════════════════════════════ */
.modal-alert[hidden] { display: none; }

.modal-alert {
    position: fixed;
    inset: 0;
    z-index: 3500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.modal-alert.show { pointer-events: auto; }

.modal-alert-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 16, 36, 0.45);
    backdrop-filter: blur(0.1875rem);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.modal-alert.show .modal-alert-overlay { opacity: 1; }

.modal-alert-card {
    position: relative;
    background: var(--white);
    border: 0.0625rem solid var(--color-4);
    border-radius: 1.5rem;
    width: 82%;
    max-width: 18.75rem;
    text-align: center;
    padding: 1.875rem 1.5rem 1.5rem;
    box-shadow: 0 1.875rem 4.375rem rgba(5, 38, 89, 0.2);
    transform: scale(0.85);
    opacity: 0;
    transition: opacity 0.28s ease, transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-alert.show .modal-alert-card { transform: scale(1); opacity: 1; }

.modal-alert-title {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--color-2);
    margin-bottom: 0.5rem;
    letter-spacing: -0.0125rem;
}

.modal-alert-msg {
    font-size: 0.75rem;
    color: var(--color-3);
    font-weight: 600;
    line-height: 1.55;
    white-space: pre-line;
}

.modal-alert-spinner,
.modal-alert-icon-success,
.modal-alert-sparkles,
.modal-alert-extra,
.modal-alert-bar-wrap { display: none; }

.modal-alert[data-state="info"] .modal-alert-btn { display: block; }

.modal-alert[data-state="loading"] .modal-alert-spinner,
.modal-alert[data-state="loading"] .modal-alert-bar-wrap { display: block; }

.modal-alert[data-state="success"] .modal-alert-icon-success { display: flex; }
.modal-alert[data-state="success"] .modal-alert-sparkles { display: block; }
.modal-alert[data-state="success"] .modal-alert-extra { display: inline-block; }
.modal-alert[data-state="success"] .modal-alert-btn { display: block; }

.modal-alert-spinner {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 0.875rem;
}
.modal-alert-spinner svg {
    animation: spin 1s linear infinite;
    width: 3.25rem;
    height: 3.25rem;
}
.modal-alert-spinner .track { stroke: var(--color-5); }
.modal-alert-spinner .fill { stroke: var(--color-2); stroke-dasharray: 110; stroke-dashoffset: 30; }

@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.modal-alert-bar-wrap {
    margin-top: 0.875rem;
    background: var(--color-5);
    border-radius: 6.1875rem;
    height: 0.375rem;
    overflow: hidden;
}
.modal-alert-bar {
    height: 100%;
    width: 0%;
    border-radius: 6.1875rem;
    background: linear-gradient(90deg, var(--color-3), var(--color-2));
    animation: barGrow 2.5s ease-in-out infinite;
}
@keyframes barGrow {
    0%   { width: 0%;  opacity: 1; }
    70%  { width: 85%; opacity: 1; }
    100% { width: 95%; opacity: 0.7; }
}

.modal-alert-icon-success {
    width: 4.5rem;
    height: 4.5rem;
    background: var(--success);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.125rem;
    box-shadow: 0 0.5rem 1.5625rem rgba(40, 167, 69, 0.4);
    animation: successPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}
@keyframes successPop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-checkmark {
    width: 2.25rem;
    height: 2.25rem;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
.success-checkmark .check-path {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.4s ease 0.35s forwards;
}
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.modal-alert-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 1.5rem;
}
.sparkle {
    position: absolute;
    border-radius: 50%;
    animation: sparkleFly 0.9s ease-out forwards;
    opacity: 0;
}
@keyframes sparkleFly {
    0%   { transform: scale(0) translate(0, 0); opacity: 1; }
    100% { transform: scale(1) translate(var(--sx), var(--sy)); opacity: 0; }
}

.modal-alert-extra {
    background: linear-gradient(135deg, var(--color-2), var(--color-3));
    color: white;
    font-size: 0.6875rem;
    font-weight: 800;
    padding: 0.3125rem 1rem;
    border-radius: 1.25rem;
    letter-spacing: 0.03125rem;
    margin: 0.75rem auto 0;
}

.modal-alert-btn {
    display: none;
    background: var(--color-2);
    color: var(--color-5);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 800;
    font-size: 0.8125rem;
    letter-spacing: 0.03125rem;
    cursor: pointer;
    width: 100%;
    margin-top: 1.125rem;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 0 0.375rem 1.25rem rgba(5, 38, 89, 0.25);
    font-family: inherit;
}
.modal-alert-btn:active { transform: scale(0.97); }

.modal-alert[data-state="success"] .modal-alert-btn {
    background: linear-gradient(135deg, var(--color-2), var(--color-3));
    color: white;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(0.625rem); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════════
   TOAST MINI
   Feedback ringan di pojok bawah untuk aksi kecil (tambah/centang/
   hapus tugas, koneksi pulih). Auto-dismiss setelah ~2 detik.
   ════════════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(0.625rem);
    background: var(--color-2);
    color: white;
    padding: 0.625rem 1.125rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: 0 0.5rem 1.5rem rgba(5, 38, 89, 0.3);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 4000;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}
.toast[hidden] { display: none; }
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

/* ════════════════════════════════════════════════════════════════
   OFFLINE BADGE
   Badge kecil pojok kiri-atas saat navigator.onLine === false.
   ════════════════════════════════════════════════════════════════ */
.offline-badge {
    position: fixed;
    top: 0.875rem;
    left: 0.875rem;
    background: var(--danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.3125rem 0.625rem;
    border-radius: 1rem;
    box-shadow: 0 0.25rem 0.625rem rgba(220, 53, 69, 0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    animation: slideDownBadge 0.3s ease;
}
.offline-badge[hidden] { display: none; }
.offline-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: white;
    border-radius: 50%;
    animation: pulseDot 1.5s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}
@keyframes slideDownBadge {
    from { transform: translateY(-150%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ════════════════════════════════════════════════════════════════
   VERSION FOOTER
   Indikator versi & tanggal build, kecil di bawah tombol logout.
   ════════════════════════════════════════════════════════════════ */
.app-version {
    text-align: center;
    font-size: 0.625rem;
    color: var(--color-4);
    font-weight: 500;
    padding: 0.5rem 0 0;
    opacity: 0.7;
    letter-spacing: 0.0625rem;
}

.btn-delete-row {
    position: absolute;
    top: -0.3125rem;
    left: -0.3125rem;
    background: var(--danger);
    color: white;
    border: 0.125rem solid white;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
}

.btn-delete-task {
    all: unset !important;
    position: absolute !important;
    top: 50% !important;
    right: 0.9375rem !important;
    transform: translateY(-50%) !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem !important;
    min-height: 1.5rem !important;
    background-color: #ffffff !important;
    border: 0.09375rem solid var(--danger) !important;
    color: var(--danger) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.875rem !important;
    font-weight: bold !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
    z-index: 10 !important;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.1) !important;
}

.btn-delete-task:active {
    transform: scale(0.9);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(1.25rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card,
.nav-day,
.week-toggle,
.schedule-grid,
.task-section {
    animation: fadeInUp 0.8s ease backwards;
}

.glass-card {
    animation-delay: 0.1s;
}

.nav-day {
    animation-delay: 0.2s;
}

.week-toggle {
    animation-delay: 0.3s;
}

.schedule-grid {
    animation-delay: 0.4s;
}

.task-section {
    animation-delay: 0.5s;
}

#btn-edit-mode {
    animation-delay: 0.6s;
}

#task-input {
    flex-grow: 1;
    background: var(--white);
    border: 0.125rem solid var(--color-4);
    padding: 0.5625rem;
    border-radius: 0.625rem;
    color: var(--color-1);
    font-weight: 600;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 0.75rem;
    height: 2.5rem;
    transition: border-color 0.3s;
}

#task-input:focus {
    border-color: var(--color-2);
    height: 2.5rem;
}

@keyframes slideSwap {
    0% {
        opacity: 0;
        transform: translateX(1.5625rem);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-swap {
    animation: slideSwap 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}

.confetti-piece {
    position: fixed;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 0.125rem;
    z-index: 9999;
    pointer-events: none;
    animation: flyOut 0.8s ease-out forwards;
}

@keyframes flyOut {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--x), var(--y)) scale(0.5);
        opacity: 0;
    }
}

.btn-save-small {
    flex: 1;
    max-width: 8.125rem;
    background: var(--white);
    color: var(--success);
    border: 0.125rem solid var(--success);
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 0.1875rem 0 var(--success);
    margin-top: 0.875rem;
    transition: all 0.1s;
}

.btn-cancel-small {
    flex: 1;
    max-width: 8.125rem;
    background: var(--white);
    color: var(--danger);
    border: 0.125rem solid var(--danger);
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 0.1875rem 0 var(--danger);
    margin-top: 0.875rem;
    transition: all 0.1s;
}

.btn-save-small:active,
.btn-cancel-small:active {
    box-shadow: 0 0.0625rem 0;
    transform: translateY(0.1875rem);
}

.slide-down {
    transform: translateY(1.875rem);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-selector {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeInUp 0.8s ease;
}

.btn-copy-mini {
    position: absolute;
    bottom: 0.5rem;
    left: 2.75rem;
    background: #f0f4f8;
    border: 0.0625rem solid var(--color-4);
    border-radius: 0.375rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-2);
    z-index: 5;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.3125rem;
}

.task-date {
    font-size: 0.625rem;
    color: var(--color-3);
    margin-top: 0.25rem;
    margin-bottom: 0.3125rem;
    font-weight: 600;
    opacity: 0.8;
}

.task-besok {
    border-left: 0.375rem solid #FFD700 !important;
    background: linear-gradient(to right, #fffdf0, #ffffff) !important;
    box-shadow: 0 0.25rem 0.9375rem rgba(212, 175, 55, 0.2) !important;
    position: relative;
}

.task-besok::after {
    content: 'BESOK';
    position: absolute;
    top: 0.3125rem;
    right: 0.5rem;
    font-size: 0.5rem;
    font-weight: 800;
    color: #b8860b;
    background: #fff9e6;
    padding: 0.0625rem 0.25rem;
    border-radius: 0.25rem;
    border: 0.0625rem solid #FFD700;
    z-index: 2;
}

.task-besok .task-text {
    padding-right: 2.1875rem !important;
}

.task-hariini {
    border-left: 0.375rem solid #FFD700 !important;
    background: linear-gradient(to right, #fffdf0, #ffffff) !important;
    box-shadow: 0 0.25rem 0.9375rem rgba(212, 175, 55, 0.2) !important;
    position: relative;
}

.task-hariini::after {
    content: 'HARI INI';
    position: absolute;
    top: 0.3125rem;
    right: 0.5rem;
    font-size: 0.5rem;
    font-weight: 800;
    color: #b8860b;
    background: #fff9e6;
    padding: 0.0625rem 0.25rem;
    border-radius: 0.25rem;
    border: 0.0625rem solid #FFD700;
    z-index: 2;
}

.task-hariini .task-text {
    padding-right: 2.1875rem !important;
}

/* Tugas HARI INI/BESOK yang sudah dicentang: badge tetap, tapi redup */
.task-besok.done,
.task-hariini.done {
    background: linear-gradient(to right, #fdf8e0, #f8f8f8) !important;
    box-shadow: none !important;
    border-left: 0.375rem solid #c8a800 !important;
}

/* ════════════════════════════════════════════════════════════════
   TOMBOL NOTIFIKASI (lonceng)
   Satu SVG yang berisi bell + slash. Slash di-toggle via
   [data-notif="on|off"] di tombol-nya. Saat klik, seluruh ikon
   melakukan animasi goyang sekali.
   ════════════════════════════════════════════════════════════════ */
.notif-icon {
    display: block;
    transform-origin: center top;
}

.notif-bell {
    transition: opacity 0.2s ease;
}

.notif-fab[data-notif="off"] .notif-bell {
    opacity: 0.55;
}

/* Slash di-draw dengan stroke-dashoffset agar muncul "menggambar garis"
   saat notifikasi dimatikan, dan menghilang gradual saat dinyalakan. */
.notif-slash {
    opacity: 0;
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    transition: opacity 0.2s ease, stroke-dashoffset 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notif-fab[data-notif="off"] .notif-slash {
    opacity: 1;
    stroke-dashoffset: 0;
}

/* Animasi goyang lonceng saat di-klik (untuk kedua arah ON↔OFF). */
.notif-fab.notif-swing .notif-icon {
    animation: bellSwing 0.6s ease-in-out;
}

@keyframes bellSwing {
    0%, 100% { transform: rotate(0); }
    20%      { transform: rotate(14deg); }
    40%      { transform: rotate(-10deg); }
    60%      { transform: rotate(6deg); }
    80%      { transform: rotate(-3deg); }
}

/* ════════════════════════════════════════════════════════════════════════════
   Komponen reusable
   ════════════════════════════════════════════════════════════════════════════ */

/* Tombol "Keluar" (dipakai di tampilan user maupun panel admin) */
.btn-logout {
    background-color: var(--white);
    color: var(--color-2);
    border: 0.125rem solid var(--color-2);
    border-radius: 0.625rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 0.3125rem 0 var(--color-2);
    transition: all 0.1s ease;
}

.btn-logout:active {
    box-shadow: 0 0.125rem 0 var(--color-2);
    transform: translateY(0.1875rem);
}

/* Grid pilihan kelas pada panel admin (responsif) */
.admin-class-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ------------------------------------------------------------------------
   KOMPONEN UI (mengganti inline style yang sebelumnya tersebar di HTML/JS)
   ------------------------------------------------------------------------ */

.doc-overlay { z-index: 4000; }

.header-strip-top { margin-top: 0; }

.task-link {
    color: #5483b3;
    text-decoration: underline;
}

.item-box-editing { position: relative; }
.jam-sep { font-size: 0.625rem; }
.jam-display {
    font-size: 0.75rem;
    letter-spacing: -0.0125rem;
}

/* Doc preview modal */
.doc-modal-card {
    max-width: 95%;
    width: 56.25rem;
    height: 85vh;
    padding: 0.625rem;
    display: flex;
    flex-direction: column;
}
.doc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem;
}
.doc-modal-title {
    font-size: 0.875rem;
    color: var(--color-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: bold;
}
.doc-modal-iframe {
    width: 100%;
    flex-grow: 1;
    border: none;
    border-radius: 0.625rem;
}
.btn-danger-sm {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.3125rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
}

.modal-bg-tap {
    position: absolute;
    inset: 0;
    z-index: 3050;
}
.modal-content--top { z-index: 3100; }

/* Container utama (admin selector & main content) */
.admin-selector {
    display: none;
    flex-direction: column;
    gap: 0.9375rem;
}
.admin-selector.show { display: flex; }
.main-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    align-items: center;
}
.admin-header-h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-2);
    margin-bottom: 0.3125rem;
}
.admin-header-p {
    font-size: 0.8125rem;
    color: var(--color-3);
    font-weight: 600;
}
.admin-class-btn {
    cursor: pointer;
    background: var(--white);
}
.btn-logout-mt { margin-top: 1.25rem; }

.back-btn-wrap {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    padding: 0 0.3125rem;
}
.btn-back-admin {
    display: none;
    background: var(--color-2);
    color: white;
    border: none;
    padding: 0.6875rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 0.3125rem 0 var(--color-1);
    font-size: 0.8125rem;
    letter-spacing: 0.01875rem;
    transition: all 0.1s ease;
    font-family: inherit;
}
.btn-back-admin.show { display: inline-flex; }

/* Edit jadwal controls */
.edit-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    margin-top: 2.1875rem;
    width: 100%;
}
.edit-controls.show { display: flex; }
.edit-controls-row {
    display: flex;
    gap: 1.25rem;
    width: 100%;
    justify-content: center;
}
.btn-add-row {
    background: var(--color-2);
    color: var(--color-5);
    border: none;
    padding: 0.625rem 1.375rem;
    border-radius: 0.625rem;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.8125rem;
    width: auto;
    font-family: inherit;
}

/* Task section helpers */
.task-section-label {
    font-size: 0.8125rem;
    font-weight: bold;
    margin-bottom: 0.3125rem;
    color: var(--color-2);
}
.task-input-hint {
    display: block;
    font-size: 0.6875rem;
    color: var(--color-3);
    font-weight: 500;
    margin-top: 0.25rem;
    margin-left: 0.3125rem;
    line-height: 1.4;
}

/* Layout helpers generik */
.w-full { width: 100%; }
.btn-keluar-wrap {
    margin-top: 0.3125rem;
    padding: 0 0.625rem 1.875rem 0.625rem;
    width: 100%;
}

/* Image preview untuk tugas baru (sebelum upload) */
.image-preview-container {
    display: none;
    margin-top: 0.625rem;
    text-align: left;
    flex-wrap: wrap;
    gap: 0.3125rem;
}
.image-preview-container.show { display: flex; }
.preview-item { position: relative; }
.preview-thumb {
    width: 3.75rem;
    height: 3.75rem;
    object-fit: cover;
    border-radius: 0.5rem;
}
.preview-thumb--icon {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.preview-thumb--audio { background: #5483b3; }
.preview-thumb--doc   { background: #7da0ca; }
.preview-remove {
    position: absolute;
    top: -0.3125rem;
    right: -0.3125rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

/* Lampiran di item tugas (after upload) */
.task-attachments-photos {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.625rem;
    width: 100%;
}
.task-attachments-others {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.625rem;
    width: 100%;
}
.task-thumb {
    width: 5rem;
    height: 5rem;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 0.0625rem solid var(--color-4);
    cursor: pointer;
}
.task-audio-wrap {
    width: 100%;
    background: #f8f9fa;
    padding: 0.625rem;
    border-radius: 0.625rem;
    border: 0.0625rem solid var(--color-4);
}
.task-audio-name {
    font-size: 0.6875rem;
    margin-bottom: 0.3125rem;
    color: var(--color-2);
    font-weight: bold;
}
.task-audio-control { width: 100%; height: 2.1875rem; }
.task-video-wrap {
    width: 100%;
    border-radius: 0.625rem;
    overflow: hidden;
    border: 0.0625rem solid var(--color-4);
}
.task-video-control {
    width: 100%;
    max-height: 12.5rem;
    background: #000;
}
.task-doc-wrap {
    background: #e1e8f0;
    padding: 0.75rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 0.09375rem solid #7da0ca;
    cursor: pointer;
}
.task-doc-icon { font-size: 1.5rem; }
.task-doc-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.task-doc-name {
    font-size: 0.6875rem;
    color: #052659;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
}
.task-doc-hint {
    font-size: 0.5625rem;
    font-style: italic;
    color: #3b6ea5;
    margin-top: 0.125rem;
}

/* Task item internal layout (mengganti cssText inline di JS) */
.task-item {
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    padding-bottom: 0.9375rem;
}
.task-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.625rem;
}
.task-text-col {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.task-date-block {
    display: block;
    margin-bottom: 0;
}
.task-date-rel {
    opacity: 0.6;
    font-style: italic;
    display: block;
    margin-top: 0.0625rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE - Tablet & Desktop
   Skala UI diatur oleh font-size fluid pada <html> (clamp). Media query di sini
   hanya menata ulang lebar konten & jumlah kolom, bukan skala.
   ════════════════════════════════════════════════════════════════════════════ */

/* Tablet (≥ 768px) */
@media (min-width: 768px) {
    body {
        padding-top: 1.75rem;
    }

    :root {
        --content-max: 35rem;
    }

    .schedule-grid {
        gap: 0.625rem;
    }

    /* Panel admin: 3 kolom kelas */
    .admin-class-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop (≥ 1024px) */
@media (min-width: 1024px) {
    body {
        padding-top: 2.25rem;
    }

    :root {
        --content-max: 37.5rem;
    }

    /* Selaraskan tombol notif dengan tepi kanan kartu konten yang terpusat */
    .notif-fab {
        top: 1.5rem;
        right: calc(50% - 18.75rem);
    }

    /* Panel admin: 4 kolom kelas */
    .admin-class-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Hover yang lebih jelas di perangkat berpenunjuk */
    .item-box:hover {
        transform: translateY(-0.0625rem);
    }
}

/* Ponsel kecil (≤ 360px): rapatkan agar tidak sesak */
@media (max-width: 360px) {
    .container {
        gap: 0.5rem;
    }

    .schedule-grid {
        gap: 0.3125rem;
    }

    .btn-week {
        padding: 0.375rem 0.875rem;
    }

    #clock {
        font-size: 2.375rem;
    }
}

/* Hormati preferensi pengguna yang ingin mengurangi animasi */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   Indikator fokus keyboard (hanya tampil saat navigasi dengan Tab)
   ════════════════════════════════════════════════════════════════════════════ */
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 0.125rem solid var(--color-2);
    outline-offset: 0.125rem;
}
