:root {
    --bg: #f3f6fb;
    --panel: #ffffff;
    --panel-soft: #f8fbff;
    --line: #d7e1ee;
    --line-strong: #c6d2e1;
    --text: #17212b;
    --muted: #667085;
    --primary: #155eef;
    --primary-dark: #0049d6;
    --danger: #d92d20;
    --danger-dark: #b42318;
    --success-bg: #ecfdf3;
    --success-border: #abefc6;
    --success-text: #067647;
    --error-bg: #fef3f2;
    --error-border: #fecdca;
    --error-text: #b42318;
    --radius: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
    --shadow-soft: 0 4px 12px rgba(15, 23, 42, 0.05);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Rubik", "Heebo", "Segoe UI", Arial, sans-serif;
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.rtl-app,
.rtl-modal,
.rtl-text {
    direction: rtl;
    text-align: right;
}

.ltr-field {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

    .ltr-field::placeholder {
        text-align: left;
    }

/* =========================================================
   GLOBAL LAYOUT
   ========================================================= */

.page-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 24px;
}

.page-title-card,
.list-panel,
.details-panel,
.requests-page-card,
.login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.page-title-card {
    padding: 16px 20px;
    margin-bottom: 14px;
}

.page-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #1e293b;
}

.empty-panel {
    padding: 24px 12px;
    text-align: right;
}

.empty-title {
    margin-bottom: 6px;
    font-size: 1.04rem;
    font-weight: 900;
}

.empty-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.message-error,
.message-success,
.success-box {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.94rem;
}

.message-error {
    border: 1px solid var(--error-border);
    background: var(--error-bg);
    color: var(--error-text);
}

.message-success,
.success-box {
    border: 1px solid var(--success-border);
    background: var(--success-bg);
    color: var(--success-text);
}

.muted-text {
    color: var(--muted);
}

.multiline-value {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.65;
    max-width: 100%;
}

/* =========================================================
   TOP BAR
   ========================================================= */

.top-userbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.user-chip,
.role-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.user-chip {
    background: #eef2ff;
    color: #3730a3;
}

.role-chip {
    color: var(--muted);
    background: #f8fafc;
}

.top-userbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}

    .back-link:hover {
        background: #eef3f9;
    }

/* =========================================================
   INPUTS
   ========================================================= */

.search-input,
.text-input,
.text-area,
.login-input,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font-size: 0.97rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

    textarea.text-area,
    textarea {
        resize: vertical;
        min-height: 110px;
    }

        .search-input:focus,
        .text-input:focus,
        .text-area:focus,
        .login-input:focus,
        textarea:focus,
        select:focus,
        input[type="text"]:focus,
        input[type="email"]:focus,
        input[type="password"]:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.12);
            background: #fff;
        }

/* =========================================================
   BUTTONS
   ========================================================= */

.primary-btn,
.secondary-btn,
.danger-btn,
.icon-btn,
.login-btn,
.copy-btn,
.small-btn,
.admin-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

    .primary-btn:active,
    .secondary-btn:active,
    .danger-btn:active,
    .copy-btn:active,
    .admin-toolbar-btn:active {
        transform: translateY(1px);
    }

.primary-btn {
    color: #fff;
    background: var(--primary);
    border: 1px solid var(--primary);
}

    .primary-btn:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
    }

.secondary-btn,
.icon-btn,
.copy-btn,
.small-btn {
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
}

    .secondary-btn:hover,
    .icon-btn:hover,
    .copy-btn:hover,
    .small-btn:hover {
        background: #f8fafc;
    }

.danger-btn {
    color: #fff;
    background: var(--danger);
    border: 1px solid var(--danger);
}

    .danger-btn:hover {
        background: var(--danger-dark);
        border-color: var(--danger-dark);
    }

.copy-btn,
.small-btn {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.84rem;
}

.admin-toolbar-btn {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

    .admin-toolbar-btn:hover {
        background: #ffedd5;
        border-color: #fdba74;
    }

button:disabled,
.login-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* =========================================================
   SEARCH / TOOLBAR
   ========================================================= */

.searchbar-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.searchbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.search-inline-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.search-input {
    min-width: 240px;
    max-width: 360px;
}

.toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar-right,
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* =========================================================
   ADOPTERS LIST PAGE
   ========================================================= */

.main-layout {
    display: grid;
    grid-template-columns: minmax(520px, 1.04fr) minmax(400px, 0.96fr);
    gap: 22px;
    align-items: start;
}

.list-panel {
    min-width: 0;
    padding: 18px;
}

.details-panel {
    min-width: 0;
    min-height: 520px;
    padding: 22px;
}

.list-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.list-panel-title {
    margin: 0;
    font-size: 1.04rem;
    font-weight: 900;
}

.list-panel-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
}

.table-wrap {
    width: 100%;
    overflow-x: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.adopter-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

    .adopter-table thead th {
        padding: 14px 14px;
        background: #f8fbff;
        border-bottom: 1px solid var(--line);
        font-size: 0.95rem;
        font-weight: 900;
        color: #1e293b;
        text-align: right;
        vertical-align: middle;
        white-space: nowrap;
    }

    .adopter-table tbody td {
        padding: 12px 14px;
        border-bottom: 1px solid #e7edf5;
        vertical-align: middle;
        text-align: right;
        background: #fff;
        font-size: 0.96rem;
        line-height: 1.45;
    }

    .adopter-table tbody tr:last-child td {
        border-bottom: none;
    }

    .adopter-table tbody tr:hover td {
        background: #fafcff;
    }

.selected-row td {
    background: #eef4ff !important;
}

.adopter-table th:nth-child(1),
.adopter-table td:nth-child(1) {
    width: 49%;
}

.adopter-table th:nth-child(2),
.adopter-table td:nth-child(2) {
    width: 26%;
}

.adopter-table th:nth-child(3),
.adopter-table td:nth-child(3) {
    width: 25%;
}

.adopter-table td:nth-child(1) {
    font-size: 0.98rem;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.adopter-table td:nth-child(2) {
    white-space: nowrap;
}

.adopter-table td:nth-child(3),
.adopter-table th:nth-child(3) {
    white-space: nowrap;
    overflow: visible;
}

.phone-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.phone-extra {
    color: var(--muted);
    font-size: 0.88rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef4ff;
    border: 1px solid #c7d7fe;
    color: #194185;
    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    max-width: none;
}

.phone-chip,
.compact-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid #d8dee8;
    border-radius: 999px;
    background: #f8fafc;
    color: #1f2a37;
    font-size: 0.94rem;
    font-weight: 800;
    white-space: nowrap;
    direction: ltr;
    unicode-bidi: plaintext;
    text-decoration: none;
    user-select: text;
    -webkit-user-select: text;
}

.phone-chip {
    cursor: text;
}

.phone-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.phone-chip-wrap-top {
    margin-top: 4px;
}

.detail-phone-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.details-section-title {
    margin: 0 0 18px 0;
    font-size: 1.24rem;
    font-weight: 900;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 16px;
}

.details-card {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--panel-soft);
}

    .details-card strong {
        display: block;
        margin-bottom: 7px;
    }

.details-card-full {
    grid-column: 1 / -1;
}

.details-card div,
.section-block div {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.section-block {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

    .section-block h4 {
        margin: 0 0 10px 0;
        font-size: 1rem;
    }

.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================================================
   MODALS
   ========================================================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
}

.modal-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 32px));
    max-height: 90vh;
    overflow: auto;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    z-index: 1001;
}

    .modal-card h3 {
        margin: 0 0 16px 0;
    }

.modal-card-sm {
    width: min(520px, calc(100vw - 32px));
}

.modal-card-image {
    width: min(960px, calc(100vw - 32px));
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 15px;
}

    .form-row label {
        font-size: 0.94rem;
        font-weight: 800;
    }

.field-hint {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.55;
}

.field-warning {
    margin-top: 6px;
    color: #b26a00;
    font-size: 0.85rem;
    line-height: 1.55;
}

/* =========================================================
   PHONE EDIT ROWS
   ========================================================= */

.phone-edit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.phone-prefix-select {
    width: 110px;
    flex: 0 0 110px;
}

.phone-rest-input {
    flex: 1 1 auto;
    min-width: 0;
}

.phone-remove-btn {
    flex: 0 0 auto;
}

/* =========================================================
   IMAGES
   ========================================================= */

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.thumb-item {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    background: #f3f4f6;
}

.thumb-name {
    margin-top: 8px;
    font-size: 0.88rem;
    word-break: break-word;
}

.image-viewer {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0 4px;
    flex-wrap: wrap;
}

.page-indicator {
    font-weight: 800;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
}

.login-card {
    width: 100%;
    max-width: 520px;
    padding: 24px;
}

.login-title {
    margin: 0 0 20px 0;
    font-size: 2rem;
    line-height: 1.2;
}

.login-form-row {
    margin-bottom: 16px;
}

.login-label {
    display: block;
    margin-bottom: 8px;
    color: #1f2937;
    font-weight: 800;
}

.login-input {
    height: 48px;
}

.login-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 20px;
}

.login-btn {
    min-width: 140px;
    height: 46px;
    border: none;
    background: var(--primary);
    color: #fff;
}

.login-error {
    margin-top: 12px;
    color: #b42318;
    font-size: 0.95rem;
}

.login-disclaimer-box {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.login-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92rem;
}

.login-disclaimer-text {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.request-access-link {
    margin-top: 14px;
    text-align: center;
}

.request-access-btn {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
}

    .request-access-btn:hover {
        text-decoration: underline;
    }

/* =========================================================
   MOBILE DETAILS SHEET
   ========================================================= */

.mobile-details-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1200;
}

.mobile-details-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 22px 22px 0 0;
    padding: 14px 14px 18px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
    z-index: 1201;
}

.mobile-sheet-handle {
    width: 54px;
    height: 5px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: #d0d5dd;
}

.mobile-details-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    background: #fff;
}

.mobile-details-title {
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.4;
}

/* =========================================================
   ACCESS REQUESTS PAGE
   ========================================================= */

.requests-page-card {
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.requests-list-desktop {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.request-card-row {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    padding: 16px;
}

.request-card-main {
    display: grid;
    grid-template-columns: minmax(250px, 1.35fr) minmax(220px, 1.1fr) minmax(140px, 0.75fr) minmax(260px, 1.15fr) minmax(130px, 0.7fr);
    gap: 16px;
    align-items: start;
}

.request-field {
    min-width: 0;
}

.request-label {
    margin-bottom: 8px;
    font-size: 0.84rem;
    font-weight: 900;
    color: var(--muted);
    line-height: 1.3;
}

.request-value {
    font-size: 0.97rem;
    line-height: 1.55;
    color: var(--text);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.request-email .request-value {
    padding-top: 10px;
}

.email-cell {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
}

.request-reason-text {
    white-space: pre-wrap;
}

.request-role-select {
    width: 100%;
    min-height: 46px;
    font-weight: 700;
}

.request-note-input {
    width: 100%;
    min-height: 92px;
    max-height: 160px;
    resize: vertical;
    line-height: 1.5;
    font-size: 0.94rem;
    padding: 10px 12px;
}

.request-actions {
    min-width: 0;
}

.request-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .request-actions-stack .primary-btn,
    .request-actions-stack .danger-btn {
        width: 100%;
        min-height: 44px;
    }

.requests-mobile-list {
    display: none;
}

.request-mobile-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    padding: 14px;
    margin-bottom: 12px;
}

.request-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.request-mobile-field {
    min-width: 0;
}

.request-mobile-field-full {
    grid-column: 1 / -1;
}

.request-mobile-label {
    margin-bottom: 6px;
    font-size: 0.84rem;
    font-weight: 900;
    color: var(--muted);
}

.request-mobile-value {
    font-size: 0.95rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.request-mobile-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

    .request-mobile-actions button {
        flex: 1 1 0;
        min-height: 44px;
    }


/* =========================================================
   STATUS HELP MODAL
   ========================================================= */

.status-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 48px 16px 16px;
    z-index: 5000;
    overflow-y: auto;
}

.status-modal {
    width: min(680px, 100%);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    padding: 24px;
    margin: 0 auto;
    border: 1px solid var(--line);
    direction: rtl;
    text-align: right;
}

.status-help {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.status-block {
    background: #f7f8fb;
    border: 1px solid #e3e8f3;
    border-radius: 14px;
    padding: 14px 16px;
    text-align: right;
}

    .status-block h4 {
        margin: 0 0 6px 0;
        font-weight: 900;
        line-height: 1.35;
    }

    .status-block p {
        margin: 0;
        line-height: 1.55;
    }

    .status-block h4 {
        display: flex;
        flex-direction: row-reverse;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
    }

.status-note {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #666;
    text-align: right;
}

/* =========================================================
   TABLET 
   ========================================================= */

@media (max-width: 1180px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .details-panel {
        min-height: auto;
    }

    .request-card-main {
        grid-template-columns: 1fr 1fr;
    }

    .request-actions {
        grid-column: 1 / -1;
    }

    .request-actions-stack {
        flex-direction: row;
    }

        .request-actions-stack .primary-btn,
        .request-actions-stack .danger-btn {
            width: auto;
            min-width: 140px;
        }
}

/* =========================================================
   MOBILE / TABLET
   ========================================================= */

@media (max-width: 900px) {
    .page-shell {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 10px;
    }

    .top-userbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .user-meta {
        width: 100%;
        justify-content: space-between;
    }

    .top-userbar-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

        .top-userbar-actions .secondary-btn,
        .back-link {
            width: 100%;
            justify-content: center;
        }

    .page-title-card {
        padding: 12px 14px;
        margin-bottom: 12px;
    }

    .page-title {
        font-size: 1.28rem;
        text-align: center;
    }

    .searchbar-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .search-inline-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

        .search-inline-group .secondary-btn {
            width: 100%;
        }

    .search-input {
        width: 100%;
        max-width: 100%;
    }

    .toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-right,
    .toolbar-left {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

        .toolbar-right .primary-btn,
        .toolbar-right .secondary-btn,
        .toolbar-left .secondary-btn,
        .toolbar-left .admin-toolbar-btn {
            width: 100%;
            min-height: 50px;
            font-size: 0.98rem;
        }

    .list-panel,
    .details-panel,
    .requests-page-card {
        padding: 10px;
        border-radius: 18px;
    }

    .desktop-details-panel {
        display: none;
    }

    .list-panel-header {
        margin-bottom: 10px;
    }

    .table-wrap {
        overflow: visible;
        margin-top: 4px;
        border: none;
        background: transparent;
    }

    .adopter-table {
        width: 100%;
        border: none;
        background: transparent;
        table-layout: auto;
    }

        .adopter-table thead {
            display: none;
        }

        .adopter-table,
        .adopter-table tbody,
        .adopter-table tr,
        .adopter-table td {
            display: block;
            width: 100%;
        }

            .adopter-table tr {
                margin-bottom: 10px;
                padding: 12px;
                border: 1px solid var(--line);
                border-radius: 16px;
                background: #fff;
                box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
            }

            .adopter-table td {
                width: 100% !important;
                padding: 0;
                border: none;
                text-align: right;
                white-space: normal !important;
                overflow: visible !important;
            }

                .adopter-table td + td {
                    margin-top: 8px;
                }

                .adopter-table td:nth-child(1) {
                    font-size: 1rem;
                    font-weight: 900;
                    color: var(--text);
                }

    .status-badge {
        font-size: 0.86rem;
        padding: 6px 12px;
    }

    .pagination-bar {
        gap: 10px;
        padding: 10px 0 2px;
    }

        .pagination-bar .secondary-btn {
            flex: 1 1 140px;
        }

    .modal-card,
    .modal-card-sm,
    .modal-card-image {
        width: calc(100vw - 20px);
        max-height: 92vh;
        padding: 16px;
        border-radius: 16px;
    }

    .modal-actions {
        flex-direction: column;
    }

        .modal-actions .primary-btn,
        .modal-actions .secondary-btn,
        .modal-actions .danger-btn {
            width: 100%;
        }

    .phone-edit-row {
        flex-direction: column;
        align-items: stretch;
    }

    .phone-prefix-select,
    .phone-rest-input,
    .phone-remove-btn {
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
    }

    .thumb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .requests-list-desktop {
        display: none;
    }

    .requests-mobile-list {
        display: block;
    }

    .status-modal-overlay {
        padding: 16px 12px;
    }

    .status-modal {
        padding: 18px;
        border-radius: 14px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 8px;
    }

    .user-chip,
    .role-chip {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .details-card-full {
        grid-column: auto;
    }

    .details-section-title {
        margin-bottom: 10px;
        font-size: 1.08rem;
    }

    .section-block {
        margin-top: 14px;
        padding-top: 12px;
    }

    .thumb-grid {
        grid-template-columns: 1fr;
    }

    .login-page {
        padding: 20px 12px;
    }

    .login-card {
        max-width: 100%;
        padding: 18px;
        border-radius: 14px;
    }

    .login-title {
        font-size: 1.7rem;
    }

    .login-btn {
        width: 100%;
    }

    .login-actions {
        display: block;
    }

    .login-checkbox-row {
        font-size: 0.88rem;
    }

    .login-disclaimer-text {
        font-size: 0.84rem;
    }

    .request-mobile-grid {
        grid-template-columns: 1fr;
    }

    .request-mobile-field-full {
        grid-column: auto;
    }

    .request-mobile-actions {
        flex-direction: column;
    }

        .request-mobile-actions button {
            width: 100%;
        }
}

/* =========================================================
   DESKTOP-ONLY MOBILE SHEET HIDE
   ========================================================= */

@media (min-width: 901px) {
    .mobile-details-backdrop,
    .mobile-details-sheet {
        display: none;
    }
}

/* LOGIN PAGE */
/* =========================================================
   AUTH PAGES
   ========================================================= */

.auth-page {
    min-height: 100vh;
    background: #f3f6fb;
    padding: 40px 16px;
}

.auth-title-card {
    width: 100%;
    max-width: 560px;
    margin: 0 auto 20px auto;
    background: #ffffff;
    border: 1px solid #d6deea;
    border-radius: 24px;
    padding: 18px 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.auth-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: #183153;
    text-align: right;
}

.auth-card {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #d6deea;
    border-radius: 24px;
    padding: 28px 24px 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

    .auth-form-group label {
        font-size: 1.05rem;
        font-weight: 700;
        color: #183153;
    }

.auth-input {
    width: 100%;
    height: 52px;
    border: 1px solid #c8d4e3;
    border-radius: 16px;
    padding: 0 16px;
    font-size: 1rem;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

    .auth-input:focus {
        border-color: #7da2f7;
        box-shadow: 0 0 0 4px rgba(125, 162, 247, 0.15);
    }

.login-disclaimer {
    margin: 12px 0 18px;
    padding: 0 6px;
    color: #1f2937;
    font-size: 1.02rem;
    line-height: 1.9;
    text-align: right;
}

.disclaimer-accept {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
}

    .disclaimer-accept input[type="checkbox"] {
        margin-top: 4px;
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
    }

    .disclaimer-accept label {
        margin: 0;
        color: #1f2937;
        font-size: 1rem;
        line-height: 1.6;
        cursor: pointer;
    }

.auth-actions {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.auth-btn {
    min-width: 132px;
    height: 46px;
}

.forgot-link {
    margin-top: 14px;
    padding: 0;
    background: transparent;
    border: none;
    color: #183153;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

    .forgot-link:hover {
        opacity: 0.85;
    }

.message-error {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #f0b4b4;
    background: #fff4f4;
    color: #a12626;
    font-size: 0.96rem;
    line-height: 1.5;
}

/* Keep email/password visually LTR */
.ltr-field {
    direction: ltr;
    text-align: left;
}

/* Mobile */
@media (max-width: 640px) {
    .auth-page {
        padding: 20px 12px 28px;
    }

    .auth-title-card {
        border-radius: 20px;
        padding: 16px 18px;
        margin-bottom: 14px;
    }

    .auth-title {
        font-size: 1.7rem;
    }

    .auth-card {
        border-radius: 20px;
        padding: 20px 16px 18px;
    }

    .auth-input {
        height: 48px;
        border-radius: 14px;
        font-size: 0.98rem;
    }

    .login-disclaimer {
        font-size: 0.96rem;
        line-height: 1.75;
        padding: 0;
    }

    .disclaimer-accept label {
        font-size: 0.95rem;
    }

    .auth-actions {
        flex-direction: row;
        gap: 10px;
    }

    .auth-btn {
        flex: 1 1 0;
        min-width: 0;
    }

    .forgot-link {
        margin-top: 12px;
        font-size: 0.96rem;
    }
}