﻿.esm-login,
.esm-portal {
    box-sizing: border-box;
    color: #1f2937;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.esm-login {
    display: grid;
    min-height: 70vh;
    place-items: center;
    padding: 24px;
    background: #f3f4f6;
}

.esm-login-panel,
.esm-panel {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.esm-login-panel {
    width: min(420px, 100%);
    padding: 28px;
}

.esm-login-panel h1,
.esm-portal h1,
.esm-portal h2 {
    color: #111827;
    letter-spacing: 0;
    margin: 0 0 10px;
}

.esm-login-panel p,
.esm-muted,
.esm-portal-head p {
    color: #6b7280;
}

.esm-login label,
.esm-form label {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    font-weight: 650;
}

.esm-login input,
.esm-form input,
.esm-form select,
.esm-form textarea {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font: inherit;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

.esm-inline {
    align-items: center;
    display: flex !important;
    gap: 8px;
}

.esm-inline input {
    min-height: 0;
    width: auto;
}

.esm-button {
    align-items: center;
    background: #0f766e;
    border: 1px solid #0f766e;
    border-radius: 6px;
    box-sizing: border-box;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    line-height: 1.2;
    min-height: 44px;
    padding: 10px 14px;
    text-decoration: none;
}

.esm-button:hover,
.esm-button:focus {
    background: #0b5f59;
    border-color: #0b5f59;
    color: #ffffff;
    text-decoration: none;
}

.esm-button-secondary {
    background: #ccfbf1;
    border-color: #14b8a6;
    box-shadow: 0 1px 2px rgba(15, 118, 110, 0.14);
    color: #0f766e;
}

.esm-button-secondary:hover,
.esm-button-secondary:focus {
    background: #99f6e4;
    border-color: #0f766e;
    color: #115e59;
}

.esm-button-danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

.esm-button-danger:hover,
.esm-button-danger:focus {
    background: #fecaca;
    border-color: #fca5a5;
    color: #7f1d1d;
}

.esm-google-login-button {
    align-items: center;
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1f2937;
    gap: 10px;
    width: 100%;
}

.esm-google-login-button::before {
    background: #ffffff;
    border: 4px solid #4285f4;
    border-left-color: #34a853;
    border-radius: 50%;
    border-top-color: #ea4335;
    box-sizing: border-box;
    content: "";
    display: inline-block;
    height: 18px;
    width: 18px;
}

.esm-google-login-button:hover,
.esm-google-login-button:focus {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #111827;
}

.esm-login-divider {
    align-items: center;
    color: #64748b;
    display: flex;
    font-size: 13px;
    font-weight: 700;
    gap: 10px;
    margin: 18px 0;
}

.esm-login-divider::before,
.esm-login-divider::after {
    background: #e2e8f0;
    content: "";
    flex: 1;
    height: 1px;
}

.esm-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    margin: 0 0 16px;
    padding: 12px;
}

.esm-notice-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    color: #047857;
    margin: 0 0 16px;
    padding: 12px;
}

.esm-portal {
    background: #f8fafc;
    border-radius: 8px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

.esm-portal-head,
.esm-month-nav {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.esm-portal-head {
    background: #0f766e;
    border-radius: 8px;
    color: #ffffff;
    padding: 22px;
}

.esm-portal-head h1,
.esm-portal-head p {
    color: #ffffff;
}

.esm-month-nav {
    justify-content: flex-start;
}

.esm-month-picker {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.esm-month-picker label {
    color: #475569;
    display: grid;
    font-size: 13px;
    font-weight: 800;
    gap: 5px;
}

.esm-month-picker select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #1f2937;
    font: inherit;
    min-height: 48px;
    min-width: 150px;
    padding: 10px 12px;
}

.esm-portal .esm-month-picker .esm-month-submit {
    align-items: center;
    background: #0f766e !important;
    border-color: #0f766e !important;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18) !important;
    color: #ffffff !important;
    height: 48px;
    line-height: 1;
    min-height: 48px;
    padding: 0 24px;
}

.esm-portal .esm-month-picker .esm-month-submit:hover,
.esm-portal .esm-month-picker .esm-month-submit:focus {
    background: #0b5f59 !important;
    border-color: #0b5f59 !important;
    color: #ffffff !important;
}

.esm-portal-nav {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    padding: 6px;
}

.esm-portal-nav a {
    border-radius: 6px;
    color: #475569;
    font-weight: 800;
    padding: 10px 14px;
    text-decoration: none;
}

.esm-portal-nav a.active {
    background: #0f766e;
    color: #ffffff;
}

.esm-month-nav a,
.esm-link-button {
    background: none;
    border: 0;
    color: #0f766e;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
    text-decoration: underline;
}

.esm-view[hidden] {
    display: none !important;
}

.esm-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-bottom: 18px;
}

.esm-panel {
    margin-bottom: 18px;
    padding: 18px;
}

.esm-section-head {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.esm-section-head p {
    color: #64748b;
    margin: 0;
}

.esm-legend {
    align-items: center;
    color: #475569;
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 8px;
}

.esm-dot {
    border-radius: 999px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.esm-dot-assignment,
.esm-event-assignment {
    background: #dbeafe;
    color: #1e40af;
}

.esm-dot-time,
.esm-event-time {
    background: #dcfce7;
    color: #166534;
}

.esm-dot-absence,
.esm-event-absence {
    background: #fee2e2;
    color: #991b1b;
}

.esm-dot-google,
.esm-event-google {
    background: #fef3c7;
    color: #92400e;
}

.esm-calendar-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.esm-cal-head {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.esm-cal-day {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    min-height: 128px;
    padding: 8px;
    position: relative;
}

.esm-cal-day.is-today {
    border-color: #0f766e;
    box-shadow: inset 0 0 0 1px #0f766e;
}

.esm-cal-empty {
    background: #f8fafc;
    border-style: dashed;
}

.esm-cal-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.esm-cal-top a {
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.esm-event {
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    gap: 2px;
    font-size: 12px;
    line-height: 1.25;
    margin-top: 5px;
    padding: 6px;
    text-align: left;
    width: 100%;
}

.esm-event span {
    font-weight: 800;
}

.esm-event small {
    color: inherit;
    opacity: 0.78;
}

.esm-add-day {
    align-items: center;
    appearance: none;
    background: #0f766e;
    border: 0;
    border-radius: 999px;
    bottom: 8px;
    box-shadow: 0 10px 18px rgba(15, 118, 110, 0.28);
    color: #ffffff;
    cursor: pointer;
    display: inline-grid !important;
    font-size: 0;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    line-height: 0;
    margin: 0 !important;
    min-height: 34px !important;
    min-width: 34px !important;
    overflow: hidden;
    padding: 0 !important;
    position: absolute;
    right: 8px;
    text-align: center;
    text-indent: 0;
    top: auto;
    vertical-align: middle;
    width: 34px;
}

.esm-add-day::before {
    background: currentColor;
    content: "";
    display: block;
    height: 16px;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
}

.esm-add-day::after {
    background: currentColor;
    content: "";
    display: block;
    height: 3px;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
}

.esm-profile-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.esm-span-2,
.esm-readonly-box {
    grid-column: span 2;
}

.esm-readonly-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 12px;
}

.esm-readonly-box small {
    color: #64748b;
}

.esm-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.esm-list li {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 0;
}

.esm-list li:last-child {
    border-bottom: 0;
}

.esm-list span,
.esm-table small {
    color: #64748b;
}

.esm-table {
    border-collapse: collapse;
    width: 100%;
}

.esm-table th,
.esm-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.esm-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
}

.esm-inline-form {
    display: inline;
}

.esm-modal-open {
    overflow: hidden;
}

.esm-modal-shell {
    align-items: center;
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 22px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 99999;
}

.esm-modal-shell[hidden] {
    display: none;
}

.esm-confirm-shell {
    align-items: center;
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 22px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 100000;
}

.esm-confirm-shell[hidden] {
    display: none;
}

.esm-modal-backdrop {
    background: rgba(15, 23, 42, 0.55);
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.esm-modal {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 44px);
    max-width: 640px;
    overflow: hidden;
    position: relative;
    width: min(100%, 640px);
    z-index: 1;
}

.esm-confirm {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    max-width: 420px;
    padding: 24px;
    position: relative;
    width: min(100%, 420px);
    z-index: 1;
}

.esm-confirm h2 {
    color: #111827;
    margin: 0 0 8px;
}

.esm-confirm p {
    color: #64748b;
    margin: 0 0 20px;
}

.esm-confirm-actions {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.esm-confirm-actions .esm-button {
    width: 100%;
}

.esm-modal-content {
    max-height: calc(100vh - 44px);
    overflow: auto;
}

.esm-modal-close {
    align-items: center;
    appearance: none;
    background: #f1f5f9;
    border: 0;
    border-radius: 999px;
    color: #334155;
    cursor: pointer;
    display: inline-grid !important;
    font-size: 0;
    height: 34px;
    justify-content: center;
    line-height: 0;
    margin: 0 !important;
    min-height: 34px !important;
    min-width: 34px !important;
    overflow: hidden;
    padding: 0 !important;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 34px;
    z-index: 2;
}

.esm-modal-close::before {
    background: currentColor;
    content: "";
    display: block;
    height: 17px;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 2px;
}

.esm-modal-close::after {
    background: currentColor;
    content: "";
    display: block;
    height: 2px;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 17px;
}
.esm-modal-card {
    padding: 24px;
}

.esm-modal-card header {
    border-bottom: 1px solid #e2e8f0;
    margin: 0 0 18px;
    padding: 0 44px 14px 0;
}

.esm-modal-card header p {
    color: #64748b;
    margin: 4px 0 0;
}

.esm-choice-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.esm-choice-card {
    background: #f8fafc;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
    color: #1f2937;
    cursor: pointer;
    display: grid;
    gap: 8px;
    padding: 18px;
    text-align: left;
}

.esm-choice-card strong {
    color: #0f766e;
    font-size: 18px;
}

.esm-choice-card span {
    color: #64748b;
}

.esm-detail-list {
    display: grid;
    gap: 10px;
}

.esm-detail-list div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 10px 12px;
}

.esm-detail-list span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.esm-detail-list strong {
    color: #1f2937;
    font-weight: 700;
    white-space: pre-wrap;
}

.esm-modal .esm-form-footer {
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), #ffffff 34%);
    border-top: 1px solid #e2e8f0;
    bottom: 0;
    box-shadow: 0 -10px 20px rgba(15, 23, 42, 0.06);
    margin: 18px -24px -24px;
    padding: 14px 24px;
    position: sticky;
    z-index: 3;
}

.esm-modal .esm-form-footer .esm-button {
    width: 100%;
}

.esm-modal .esm-form-footer-actions {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.esm-modal .esm-form-footer-actions .esm-button {
    min-height: 46px;
    width: 100%;
}

.esm-modal .esm-delete-button {
    min-height: 46px;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .esm-portal {
        padding: 14px;
    }

    .esm-portal-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .esm-table {
        display: block;
        overflow-x: auto;
    }

    .esm-portal-nav {
        overflow-x: auto;
    }

    .esm-section-head,
    .esm-month-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .esm-month-picker {
        align-items: stretch;
        width: 100%;
    }

    .esm-month-picker label,
    .esm-month-picker select,
    .esm-month-picker button {
        width: 100%;
    }

    .esm-calendar-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .esm-cal-head,
    .esm-cal-empty {
        display: none;
    }

    .esm-cal-day {
        min-height: auto;
        padding-bottom: 50px;
    }

    .esm-cal-top::before {
        content: "Tag";
        color: #64748b;
        font-size: 12px;
        font-weight: 700;
        margin-right: 6px;
    }

    .esm-profile-form {
        grid-template-columns: 1fr;
    }

    .esm-span-2,
    .esm-readonly-box {
        grid-column: span 1;
    }

    .esm-modal-shell {
        align-items: flex-end;
        padding: 0;
    }

    .esm-modal {
        border-radius: 14px 14px 0 0;
        max-height: 88vh;
        max-width: none;
        width: 100%;
    }

    .esm-confirm-shell {
        align-items: flex-end;
        padding: 0;
    }

    .esm-confirm {
        border-radius: 14px 14px 0 0;
        max-width: none;
        padding: 22px 16px max(16px, env(safe-area-inset-bottom));
        width: 100%;
    }

    .esm-modal-content {
        max-height: 88vh;
    }

    .esm-modal-card {
        padding: 22px 16px 18px;
    }

    .esm-modal .esm-form-footer {
        margin: 18px -16px -18px;
        padding: 14px 16px max(14px, env(safe-area-inset-bottom));
    }


    .esm-choice-grid {
        grid-template-columns: 1fr;
    }
}

