.admin-body {
    background: var(--background);
}

.admin-header {
    border-bottom: 1px solid rgba(180, 146, 111, 0.22);
    background: #fffdf9;
}

.admin-header__inner,
.admin-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.admin-header__inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-nav {
    display: flex;
    gap: 22px;
}

.admin-nav a {
    color: var(--text-muted);
    font-weight: 650;
    text-decoration: none;
}

.admin-nav a:hover {
    color: var(--accent-dark);
}

.admin-shell {
    padding: 48px 0 72px;
}

.admin-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.admin-page-heading h1 {
    margin: 0;
    font-size: 2.35rem;
    letter-spacing: -0.04em;
}

.admin-page-heading p {
    margin: 8px 0 0;
    color: var(--text-muted);
}

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.button--primary {
    color: white;
    background: var(--accent);
    box-shadow: 0 6px 14px rgba(240, 90, 0, 0.18);
}

.button--secondary {
    color: var(--accent-dark);
    border-color: var(--border-strong);
    background: #fff9f4;
}

.admin-panel {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fffdf9;
    box-shadow: var(--shadow);
}

.module-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.module-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.module-table__col--module {
    width: 38%;
}

.module-table__col--status {
    width: 16%;
}

.module-table__col--customer-action {
    width: 22%;
}

.module-table__col--order {
    width: 9%;
}

.module-table__col--actions {
    width: 15%;
}

.module-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.module-table th,
.module-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #eee3d5;
    vertical-align: middle;
}

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

.module-table__actions-heading,
.table-actions-cell {
    text-align: right !important;
}

.table-module {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
}

.table-icon {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    color: var(--accent-dark);
    background: #fff3e8;
}

.table-icon img {
    width: 100%;
    height: 100%;
    display: block;
    padding: 4px;
    object-fit: contain;
}

.table-icon .module-icon {
    width: 22px;
    height: 22px;
}

.table-module__details {
    min-width: 0;
}

.table-module strong,
.table-module span {
    display: block;
}

.table-module strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-module span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-actions-cell {
    display: table-cell;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
}

.table-actions a,
.table-actions button {
    padding: 0;
    border: 0;
    color: var(--accent-dark);
    background: none;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.table-actions a:hover,
.table-actions button:hover {
    color: var(--accent);
    text-decoration: underline;
}

.row-muted {
    opacity: 0.55;
}

.status-pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    color: #287241;
    background: #eaf7ee;
    font-size: 0.77rem;
    font-weight: 700;
}

.status-pill--coming_soon {
    color: #778294;
    background: #f0f2f5;
}

.alert {
    margin: 0 0 18px;
    padding: 13px 16px;
    border-radius: 12px;
}

.alert--success {
    color: #21663a;
    background: #eaf7ee;
}

.alert--error {
    color: #8d2e27;
    background: #fff0ed;
}

.admin-form label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    background: white;
    font: inherit;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    outline: 2px solid rgba(240, 90, 0, 0.16);
    border-color: var(--accent);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.module-editor > label {
    margin-bottom: 18px;
}

.field-hint {
    display: block !important;
    color: var(--text-muted) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

.icon-picker {
    margin: 18px 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.icon-picker legend {
    padding: 0 8px;
    font-weight: 750;
}

.icon-options {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.icon-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.icon-option span {
    min-height: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
}

.icon-option input:checked + span {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: #fff5ed;
    box-shadow: 0 0 0 2px rgba(240, 90, 0, 0.1);
}

.picker-icon {
    width: 28px;
    height: 28px;
}

.icon-option small {
    font-size: 0.69rem;
    text-align: center;
}

.checkbox-field {
    display: flex !important;
    grid-template-columns: auto 1fr !important;
    align-items: center;
    margin: 20px 0;
}

.checkbox-field input {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--background);
}

.login-card {
    width: min(440px, 100%);
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fffdf9;
    box-shadow: 0 18px 50px rgba(77, 54, 35, 0.12);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-brand strong,
.login-brand span {
    display: block;
}

.login-brand span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.login-card h1 {
    margin: 28px 0 6px;
}

.login-card > p {
    margin: 0 0 24px;
    color: var(--text-muted);
}

.login-card .admin-form {
    display: grid;
    gap: 16px;
}

.back-link {
    display: inline-block;
    margin-top: 22px;
    color: var(--text-muted);
    text-decoration: none;
}

.user-mini-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    color: var(--accent);
    background: #fff4ea;
    font-weight: 800;
}

.user-mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.access-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.access-option span {
    display: flex;
    flex-direction: column;
}

.access-option small {
    color: var(--text-muted);
}

.current-graphic {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-graphic img {
    width: 72px;
    height: 72px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 14px;
    object-fit: contain;
}

@media (max-width: 850px) {
    .module-table {
        min-width: 900px;
    }

    .icon-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 700px) {
    .access-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .admin-header__inner,
    .admin-shell {
        width: calc(100% - 24px);
    }

    .admin-nav a:first-child {
        display: none;
    }

    .admin-page-heading {
        align-items: start;
        flex-direction: column;
    }

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

    .icon-options {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* User Management table */

.user-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.user-table__col--user {
    width: 38%;
}

.user-table__col--email {
    width: 25%;
}

.user-table__col--modules {
    width: 10%;
}

.user-table__col--status {
    width: 12%;
}

.user-table__col--actions {
    width: 15%;
}

.user-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.user-table th,
.user-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #eee3d5;
    vertical-align: middle;
}

.user-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-user {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
}

.user-mini-avatar {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    flex: 0 0 48px !important;
    display: grid !important;
    place-items: center;
    overflow: hidden !important;
    border-radius: 50%;
    color: var(--accent);
    background: #fff4ea;
    font-weight: 800;
}

.user-mini-avatar img,
.table-user .user-mini-avatar img {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    display: block !important;
    padding: 0 !important;
    border-radius: 50%;
    object-fit: cover !important;
}

.table-user__details {
    min-width: 0;
}

.table-user__details strong,
.table-user__details span {
    display: block;
}

.table-user__details strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-user__details span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-table__email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-table__actions-heading,
.user-table__actions-cell {
    text-align: right !important;
}

.user-table__actions-cell {
    display: table-cell !important;
}

.user-table__actions-cell .table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

@media (max-width: 850px) {
    .user-table {
        min-width: 820px;
    }
}
