@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

* {
    box-sizing: border-box;
}

:root {
    --navy: #142b43;
    --teal: #0f766e;
    --gold: #c79a3b;
    --line: #d8e1ec;
    --page: #f5f7fb;
    --text: #172033;
    --muted: #607089;
    --danger: #991b1b;
}

html {
    direction: rtl;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Tajawal", Tahoma, Arial, sans-serif;
    background: var(--page);
    color: var(--text);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-panel {
    width: 100%;
    max-width: 440px;
}

.card {
    width: 100%;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-top: 4px solid var(--gold);
    border-radius: 8px;
    box-shadow: 0 14px 38px rgba(20, 43, 67, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--navy);
    color: var(--gold);
    font-weight: 800;
}

.brand-name {
    margin: 0;
    color: var(--navy);
    font-size: 17px;
    font-weight: 800;
}

h1,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: 26px;
    line-height: 1.35;
    color: var(--navy);
}

.muted {
    margin-bottom: 18px;
    color: var(--muted);
    line-height: 1.75;
}

.field {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fbfdff;
    color: var(--text);
    font-family: "Tajawal", Tahoma, Arial, sans-serif;
    font-size: 16px;
}

input:focus {
    border-color: var(--teal);
    outline: 3px solid rgba(15, 118, 110, 0.14);
}

.button {
    width: 100%;
    min-height: 46px;
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.button:hover {
    background: #0f2237;
}

.button.secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--navy);
    background: #eef3f8;
    border: 1px solid var(--line);
}

.button.secondary:hover {
    background: #e4edf6;
}

.stack,
.app-list {
    display: grid;
    gap: 12px;
}

.app-list {
    margin-top: 18px;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: var(--danger);
    background: #fff1f1;
}

.success {
    color: #176130;
    background: #eefaf1;
    border-color: #bde8ca;
}

.secret-box {
    direction: ltr;
    padding: 12px;
    border: 1px dashed #9aa8bb;
    border-radius: 8px;
    background: #f8fafc;
    text-align: center;
    font-weight: 800;
    overflow-wrap: anywhere;
}

#qrcode {
    width: 204px;
    min-height: 204px;
    margin: 12px auto 18px;
    padding: 2px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 18px;
}

.admin-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

.admin-card h2 {
    margin: 0 0 16px;
    font-size: 20px;
    color: var(--navy);
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.admin-table th,
.admin-table td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    vertical-align: top;
}

.admin-table th {
    color: var(--navy);
    background: #f8fafc;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.password-reset-form {
    display: inline-flex;
    gap: 6px;
}

.inline-password {
    width: 150px;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
}

.small-button {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 7px 10px;
    background: #fff;
    color: var(--navy);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.small-button.danger {
    color: var(--danger);
}

.pill {
    display: inline-flex;
    margin: 2px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef3f8;
    color: #24364d;
    font-size: 12px;
    white-space: nowrap;
}

.pill.off {
    background: #fff1f1;
    color: var(--danger);
}

select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fbfdff;
    font: inherit;
}

textarea {
    min-height: 84px;
    resize: vertical;
}

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

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