/* =========================================================
   SMART NURSERY TRACKING
   SETTINGS PAGE
========================================================= */


/* =========================================================
   PAGE INTRO
========================================================= */

.settings-content {
    padding-bottom: 30px;
}

.settings-intro {
    margin-bottom: 24px;
}

.settings-intro .welcome-label {
    display: inline-block;
    margin-bottom: 7px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #166534;
}

.settings-intro h2 {
    margin: 0 0 7px;

    font-size: 24px;
    font-weight: 700;
    color: #172033;
}

.settings-intro p {
    margin: 0;

    font-size: 14px;
    line-height: 1.6;
    color: #64748b;
}


/* =========================================================
   SETTINGS LAYOUT
========================================================= */

.settings-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 22px;

    align-items: start;
}


/* =========================================================
   SETTINGS MENU
========================================================= */

.settings-menu {
    position: sticky;
    top: 20px;

    display: flex;
    flex-direction: column;
    gap: 5px;

    padding: 10px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
}

.settings-menu-item {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 11px 12px;

    border: none;
    border-radius: 8px;

    background: transparent;

    color: #64748b;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;

    text-align: left;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.settings-menu-item span {
    width: 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 15px;
}

.settings-menu-item:hover {
    background: #f0fdf4;
    color: #166534;
}

.settings-menu-item.active {
    background: #dcfce7;
    color: #166534;

    font-weight: 600;
}


/* =========================================================
   SETTINGS PANEL
========================================================= */

.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;

    min-width: 0;
}


/* =========================================================
   SETTINGS SECTION
========================================================= */

.settings-section {
    padding: 24px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
}

.settings-section-heading {
    margin-bottom: 22px;
}

.settings-section-heading .card-label {
    display: block;
    margin-bottom: 6px;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;

    color: #166534;
}

.settings-section-heading h3 {
    margin: 0 0 6px;

    font-size: 17px;
    font-weight: 700;

    color: #172033;
}

.settings-section-heading p {
    margin: 0;

    font-size: 13px;
    line-height: 1.6;

    color: #64748b;
}


/* =========================================================
   PROFILE
========================================================= */

.settings-profile {
    display: flex;
    align-items: center;
    gap: 15px;

    margin-bottom: 25px;
    padding-bottom: 22px;

    border-bottom: 1px solid #eef2f7;
}

.large-profile-avatar {
    width: 64px;
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: #166534;
    color: #ffffff;

    font-size: 19px;
    font-weight: 700;
}

.settings-profile strong {
    display: block;

    margin-bottom: 3px;

    font-size: 14px;
    font-weight: 700;

    color: #172033;
}

.settings-profile span {
    display: block;

    margin-bottom: 7px;

    font-size: 12px;
    color: #64748b;
}

.change-photo {
    padding: 0;

    border: none;
    background: transparent;

    color: #166534;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.change-photo:hover {
    text-decoration: underline;
}


/* =========================================================
   FORM
========================================================= */

.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.settings-form-group label {
    font-size: 12px;
    font-weight: 600;

    color: #334155;
}

.settings-form-group input,
.settings-form-group select {
    width: 100%;
    height: 42px;

    padding: 0 12px;

    border: 1px solid #dbe3ea;
    border-radius: 8px;

    background: #ffffff;

    color: #172033;

    font-family: inherit;
    font-size: 13px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.settings-form-group input::placeholder {
    color: #94a3b8;
}

.settings-form-group input:focus,
.settings-form-group select:focus {
    border-color: #16a34a;

    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.08);
}


/* =========================================================
   BUTTONS
========================================================= */

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 22px;
    padding-top: 20px;

    border-top: 1px solid #eef2f7;
}

.secondary-button,
.save-button,
.outline-button {
    min-height: 40px;

    padding: 0 16px;

    border-radius: 8px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.secondary-button {
    border: 1px solid #dbe3ea;
    background: #ffffff;

    color: #64748b;
}

.secondary-button:hover {
    background: #f8fafc;
    color: #334155;
}

.save-button {
    border: 1px solid #166534;
    background: #166534;

    color: #ffffff;
}

.save-button:hover {
    background: #14532d;
    border-color: #14532d;

    transform: translateY(-1px);
}

.outline-button {
    border: 1px solid #166534;
    background: #ffffff;

    color: #166534;
}

.outline-button:hover {
    background: #f0fdf4;
}


/* =========================================================
   SECURITY ROWS
========================================================= */

.security-row,
.notification-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 17px 0;

    border-bottom: 1px solid #eef2f7;
}

.security-row:first-of-type,
.notification-setting:first-of-type {
    padding-top: 0;
}

.security-row:last-child,
.notification-setting:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.security-row strong,
.notification-setting strong {
    display: block;

    margin-bottom: 4px;

    font-size: 13px;
    font-weight: 600;

    color: #172033;
}

.security-row span,
.notification-setting span {
    display: block;

    font-size: 12px;
    line-height: 1.5;

    color: #64748b;
}


/* =========================================================
   TOGGLE
========================================================= */

.toggle {
    position: relative;

    display: inline-block;

    width: 42px;
    height: 23px;

    flex-shrink: 0;

    cursor: pointer;
}

.toggle input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;

    border-radius: 999px;

    background: #cbd5e1;

    transition: background-color 0.2s ease;
}

.toggle-slider::before {
    content: "";

    position: absolute;

    width: 17px;
    height: 17px;

    left: 3px;
    top: 3px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);

    transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-slider {
    background: #16a34a;
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(19px);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {

    .settings-layout {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 16px;
    }

    .settings-section {
        padding: 20px;
    }

}


@media (max-width: 780px) {

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-menu {
        position: static;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 560px) {

    .settings-intro h2 {
        font-size: 20px;
    }

    .settings-menu {
        grid-template-columns: 1fr;
    }

    .settings-section {
        padding: 17px;
    }

    .settings-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .settings-profile {
        align-items: flex-start;
    }

    .security-row,
    .notification-setting {
        align-items: flex-start;
    }

    .settings-actions {
        flex-direction: column-reverse;
    }

    .secondary-button,
    .save-button {
        width: 100%;
    }

}
/* =========================================================
   USERS & ROLES
========================================================= */

.users-table-wrapper {
    display: flex;
    flex-direction: column;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    overflow: hidden;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 14px;

    min-height: 72px;
    padding: 12px 15px;

    background: #ffffff;

    border-bottom: 1px solid #eef2f7;
}

.user-row:last-child {
    border-bottom: none;
}

.user-avatar {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: #dcfce7;
    color: #166534;

    font-size: 12px;
    font-weight: 700;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details strong {
    display: block;

    margin-bottom: 3px;

    font-size: 13px;
    font-weight: 600;

    color: #172033;
}

.user-details span {
    display: block;

    overflow: hidden;

    font-size: 12px;
    color: #64748b;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   ROLE BADGES
========================================================= */

.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 26px;

    padding: 0 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 600;

    white-space: nowrap;
}

.role-badge.admin {
    background: #dcfce7;
    color: #166534;
}

.role-badge.user {
    background: #eff6ff;
    color: #1d4ed8;
}

.role-badge.inspector {
    background: #fef3c7;
    color: #92400e;
}


/* =========================================================
   USERS RESPONSIVE
========================================================= */

@media (max-width: 650px) {

    .user-row {
        flex-wrap: wrap;

        padding: 14px;
    }

    .user-details {
        min-width: calc(100% - 55px);
    }

    .role-badge {
        margin-left: 52px;
    }

    .user-row .outline-button {
        margin-left: auto;
    }

}


@media (max-width: 430px) {

    .user-row {
        display: grid;
        grid-template-columns: auto 1fr;
    }

    .user-details {
        min-width: 0;
    }

    .role-badge {
        margin-left: 0;
    }

    .user-row .outline-button {
        margin-left: 0;
        justify-self: start;
    }

}

/* =========================================================
   PROFESSIONAL SETTINGS MODALS
========================================================= */

.settings-modal-overlay {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(15, 23, 42, 0.52);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.settings-modal-overlay.active {
    display: flex;
}


/* =========================================================
   MODAL CONTAINER
========================================================= */

.settings-modal {
    position: relative;

    width: 100%;
    max-width: 520px;

    max-height: calc(100vh - 48px);

    display: flex;
    flex-direction: column;

    background: #ffffff;

    border: 1px solid rgba(226, 232, 240, 0.9);

    border-radius: 16px;

    box-shadow:
        0 25px 60px rgba(15, 23, 42, 0.20),
        0 8px 20px rgba(15, 23, 42, 0.08);

    overflow: hidden;

    animation: settingsModalEnter 0.22s ease;
}


@keyframes settingsModalEnter {

    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* =========================================================
   MODAL HEADER
========================================================= */

.settings-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 22px 24px 20px;

    border-bottom: 1px solid #eef2f7;

    background: #ffffff;
}

.settings-modal-heading {
    min-width: 0;
}

.settings-modal-header .card-label {
    display: inline-flex;
    align-items: center;

    margin-bottom: 7px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1.1px;

    color: #166534;
}

.settings-modal-header h3 {
    margin: 0 0 6px;

    font-size: 18px;
    font-weight: 700;

    line-height: 1.3;

    color: #172033;
}

.settings-modal-header p {
    max-width: 420px;

    margin: 0;

    font-size: 12px;
    line-height: 1.55;

    color: #64748b;
}


/* =========================================================
   MODAL CLOSE BUTTON
========================================================= */

.settings-modal-close {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 0;

    border: 1px solid #e2e8f0;
    border-radius: 8px;

    background: #ffffff;

    color: #64748b;

    font-family: inherit;
    font-size: 21px;
    font-weight: 400;

    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.settings-modal-close:hover {
    border-color: #fecaca;

    background: #fef2f2;

    color: #b91c1c;

    transform: rotate(2deg);
}

.settings-modal-close:focus-visible {
    outline: 3px solid rgba(22, 101, 52, 0.12);
    outline-offset: 2px;
}


/* =========================================================
   MODAL BODY
========================================================= */

.settings-modal-body {
    display: flex;
    flex-direction: column;
    gap: 18px;

    padding: 24px;

    overflow-y: auto;
}


/* =========================================================
   MODAL FORM GROUP
========================================================= */

.settings-modal .settings-form-group {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.settings-modal .settings-form-group label {
    font-size: 12px;
    font-weight: 600;

    color: #334155;
}

.settings-modal .settings-form-group input,
.settings-modal .settings-form-group select,
.settings-modal .settings-form-group textarea {
    width: 100%;

    min-height: 43px;

    padding: 10px 12px;

    border: 1px solid #dbe3ea;
    border-radius: 8px;

    background: #ffffff;

    color: #172033;

    font-family: inherit;
    font-size: 13px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.settings-modal .settings-form-group textarea {
    min-height: 100px;

    resize: vertical;
}

.settings-modal .settings-form-group input::placeholder,
.settings-modal .settings-form-group textarea::placeholder {
    color: #94a3b8;
}

.settings-modal .settings-form-group input:focus,
.settings-modal .settings-form-group select:focus,
.settings-modal .settings-form-group textarea:focus {
    border-color: #16a34a;

    box-shadow:
        0 0 0 3px rgba(22, 163, 74, 0.08);
}


/* =========================================================
   MODAL FOOTER
========================================================= */

.settings-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    padding: 16px 24px;

    border-top: 1px solid #eef2f7;

    background: #fafbfc;
}


/* =========================================================
   MODAL BUTTONS
========================================================= */

.settings-modal-footer .secondary-button,
.settings-modal-footer .save-button {
    min-width: 105px;
    min-height: 40px;

    padding: 0 16px;

    border-radius: 8px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.settings-modal-footer .secondary-button {
    border: 1px solid #dbe3ea;

    background: #ffffff;

    color: #475569;
}

.settings-modal-footer .secondary-button:hover {
    background: #f8fafc;

    border-color: #cbd5e1;

    color: #334155;
}

.settings-modal-footer .save-button {
    border: 1px solid #166534;

    background: #166534;

    color: #ffffff;

    box-shadow:
        0 3px 8px rgba(22, 101, 52, 0.14);
}

.settings-modal-footer .save-button:hover {
    background: #14532d;

    border-color: #14532d;

    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(22, 101, 52, 0.20);
}


/* =========================================================
   MODAL STATUS / HELPER MESSAGE
========================================================= */

.settings-modal-message {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 11px 12px;

    border-radius: 8px;

    background: #f0fdf4;

    border: 1px solid #bbf7d0;

    color: #166534;

    font-size: 12px;
    line-height: 1.5;
}

.settings-modal-message.warning {
    background: #fffbeb;

    border-color: #fde68a;

    color: #92400e;
}

.settings-modal-message.error {
    background: #fef2f2;

    border-color: #fecaca;

    color: #b91c1c;
}


/* =========================================================
   MODAL RESPONSIVE
========================================================= */

@media (max-width: 600px) {

    .settings-modal-overlay {
        align-items: flex-end;

        padding: 0;
    }

    .settings-modal {
        max-width: none;

        max-height: 90vh;

        border-radius: 16px 16px 0 0;

        animation: settingsModalMobileEnter 0.22s ease;
    }


    @keyframes settingsModalMobileEnter {

        from {
            opacity: 0;
            transform: translateY(25px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }

    }


    .settings-modal-header {
        padding: 19px 18px 17px;
    }

    .settings-modal-body {
        padding: 19px 18px;
    }

    .settings-modal-footer {
        padding: 15px 18px;
    }

}


@media (max-width: 420px) {

    .settings-modal-footer {
        flex-direction: column-reverse;
    }

    .settings-modal-footer button {
        width: 100%;
    }

}

/* =========================================
   USER ACCOUNT STATUS
========================================= */

.user-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.user-status-badge.active {
    color: #176b3a;
    background: #eaf7ef;
    border-color: #c8ead5;
}

.user-status-badge.suspended {
    color: #a33a3a;
    background: #fceeee;
    border-color: #f3caca;
}

/* =========================================
   DELETE CONFIRMATION MODAL
========================================= */

.delete-confirmation-modal {
    max-width: 520px;
}


.delete-confirmation-modal .settings-modal-message.warning {
    border: 1px solid #f1d5a8;
    background: #fff8ec;
    color: #704c17;
}


.delete-confirmation-modal
.settings-modal-message.warning > span {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: #f5d79f;
    color: #704c17;

    font-size: 18px;
    font-weight: 800;
}


.delete-confirm-button {
    border: 1px solid #c94b4b;

    background: #c94b4b;
    color: #ffffff;

    padding: 10px 18px;

    border-radius: 8px;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.delete-confirm-button:hover {
    background: #ad3838;
    border-color: #ad3838;
}


.delete-confirm-button:active {
    transform: translateY(1px);
}