:root {
    --page-a: #6577de;
    --page-b: #7652a8;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: #f7f7fb;
    --text: #17172a;
    --muted: #6f7285;
    --brand: #6957c8;
    --brand-2: #7b48aa;
    --success: #29a765;
    --danger: #c83246;
    --line: rgba(42, 44, 70, 0.12);
    --shadow: 0 10px 26px rgba(25, 23, 55, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    font-family: Tahoma, Arial, sans-serif;
    background:
        linear-gradient(115deg, rgba(74, 111, 221, 0.92), rgba(125, 73, 166, 0.92)),
        linear-gradient(135deg, var(--page-a), var(--page-b));
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

.site-shell {
    width: min(100%, 2048px);
    margin: 0 auto;
    padding: 4px 32px 28px;
}

.brand-panel {
    min-height: 188px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-logo-wrap {
    width: 88px;
    height: 88px;
    padding: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 14px rgba(25, 23, 55, 0.18);
}

.brand-logo,
.login-logo {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}

.brand-logo {
    object-fit: contain;
}

.login-logo {
    object-fit: cover;
}

.brand-panel h1 {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(29, 25, 70, 0.2);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 34px;
    padding: 68px 0 34px;
    direction: ltr;
}

.app-card {
    min-height: 374px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 42px 34px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.app-icon {
    width: min(154px, 100%);
    height: min(154px, 100%);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--badge-bg, #1f2937);
    box-shadow: 12px 12px 0 rgba(213, 220, 232, 0.62), 0 14px 26px rgba(37, 35, 72, 0.13);
    overflow: hidden;
}

.app-icon img,
.admin-app-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-icon span,
.admin-app-preview span {
    color: #fff;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0;
}

.app-card h2 {
    width: 100%;
    min-height: 64px;
    margin: 0;
    color: #2c2d3d;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    word-break: break-word;
}

.download-button {
    width: 100%;
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 15px 20px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(90deg, #5f7edb, #7646a8);
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.download-button.is-disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.contact-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 26px 16px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
    text-align: center;
}

.contact-panel h2 {
    margin: 0;
    font-size: 18px;
}

.contact-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    color: #fff;
    background: #2f3648;
    font-size: 12px;
    font-weight: 700;
}

.contact-button.whatsapp {
    background: var(--success);
}

.phone-link {
    color: #6c5fc5;
    font-size: 12px;
    direction: ltr;
}

.site-footer {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 14px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 10px;
}

.site-footer a {
    opacity: 0.85;
}

.admin-body {
    background: #eef0f7;
}

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

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-panel {
    width: min(100%, 420px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(35, 40, 65, 0.14);
}

.login-panel h1,
.login-panel p {
    margin: 0;
    text-align: center;
}

.login-panel p {
    color: var(--muted);
    font-size: 13px;
}

.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto;
}

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

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(90deg, #5f70d2, #794aa6);
    box-shadow: 0 14px 30px rgba(75, 64, 132, 0.22);
}

.admin-header p,
.admin-header h1 {
    margin: 0;
}

.admin-header p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
}

.admin-header h1 {
    font-size: 24px;
}

.admin-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-header a,
.back-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.back-link {
    color: var(--brand);
    background: #eef0ff;
}

.alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #e8f7ef;
    color: #12663c;
    font-size: 14px;
    font-weight: 700;
}

.alert.error {
    background: #fff0f2;
    color: var(--danger);
}

.admin-section {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #dfe3ef;
    box-shadow: 0 12px 28px rgba(35, 40, 65, 0.08);
}

.admin-section h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-form.compact {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

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

.app-form-grid {
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.35fr) minmax(150px, 1fr) 74px minmax(150px, 1fr);
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #343548;
    font-size: 13px;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 7px;
    border: 1px solid #d7dbea;
    background: #fbfcff;
    color: var(--text);
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: #7365d2;
    box-shadow: 0 0 0 3px rgba(105, 87, 200, 0.12);
}

.check-row {
    width: fit-content;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.sort-field {
    width: 74px;
}

.sort-field input {
    min-height: 38px;
    padding-inline: 8px;
    text-align: center;
}

.primary-button,
.secondary-button,
.danger-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(90deg, #5f70d2, #794aa6);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.secondary-button {
    background: #263044;
}

.danger-button {
    background: var(--danger);
}

.apps-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bulk-apps-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bulk-save-bar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    justify-content: flex-start;
    padding: 14px;
    border: 1px solid #dfe3ef;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(35, 40, 65, 0.12);
}

.hidden-form {
    display: none;
}

.app-admin-card {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fbfcff;
}

.admin-app-preview {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    overflow: hidden;
    background: var(--badge-bg, #1f2937);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.delete-form {
    justify-self: end;
}

@media (max-width: 1500px) {
    .apps-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 26px;
        padding-top: 42px;
    }
}

@media (max-width: 1100px) {
    .apps-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .app-card {
        min-height: 300px;
        gap: 18px;
        padding: 30px 26px 18px;
        border-radius: 16px;
    }

    .app-icon {
        width: 118px;
        height: 118px;
    }

    .app-icon span {
        font-size: 26px;
    }

    .app-card h2 {
        min-height: 48px;
        font-size: 19px;
    }

    .download-button {
        min-height: 48px;
        font-size: 16px;
        padding: 12px 16px;
    }

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

    .app-admin-card {
        grid-template-columns: 58px 1fr;
    }

    .delete-form {
        grid-column: 2;
    }
}

@media (max-width: 720px) {
    .site-shell {
        padding-inline: 12px;
    }

    .brand-panel {
        min-height: 136px;
    }

    .brand-logo-wrap {
        width: 62px;
        height: 62px;
    }

    .brand-panel h1 {
        font-size: 26px;
    }

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

    .app-card {
        min-height: 222px;
        gap: 12px;
        padding: 22px 14px 14px;
        border-radius: 14px;
    }

    .app-icon {
        width: 88px;
        height: 88px;
        box-shadow: 7px 7px 0 rgba(213, 220, 232, 0.62), 0 10px 18px rgba(37, 35, 72, 0.12);
    }

    .app-icon span {
        font-size: 20px;
    }

    .app-card h2 {
        min-height: 42px;
        font-size: 15px;
    }

    .download-button {
        min-height: 40px;
        gap: 7px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .contact-panel {
        padding: 22px 12px;
    }

    .site-footer,
    .admin-header {
        flex-direction: column;
        text-align: center;
    }

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

    .app-admin-card {
        grid-template-columns: 1fr;
    }

    .admin-app-preview {
        margin: 0 auto;
    }

    .delete-form {
        grid-column: auto;
        justify-self: stretch;
    }

    .danger-button,
    .primary-button,
    .secondary-button {
        width: 100%;
    }
}
