/* Copyright (c) Zhmara X LLC. All rights reserved.
   Proprietary and confidential. Unauthorized copying of this file, via any medium, is prohibited. See LICENSE.txt. */

/* The admin frame of auth's /admin (auth.zhmarax.com, css/auth.css), copied with the same values: navy top bar with
   the white logo, the orange team badge, the language links, the user and Sign out; the side menu with the orange mark
   on the open page; the white footer. Only the frame: every rule is under .zx-admin and the pages inside keep their own
   look. Logical properties (inline-start/end), so Arabic and Kurdish (right to left) work with the same rules. */

.zx-admin {
    --zx-navy: #252c39;
    --zx-navy-2: #313b4d;
    --zx-orange: #f68d0b;
    --zx-orange-dark: #d97706;
    --zx-blue: #2f6fd6;
    --zx-text: #1d2433;
    --zx-muted: #5b6475;
    --zx-line: #dde2ea;
    --zx-page: #f2f4f8;
    --zx-white: #ffffff;
    --zx-radius: 14px;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--zx-page);
    color: var(--zx-text);
    font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

/* ---- Top bar ---- */
.zx-admin .zx-top {
    background: var(--zx-navy);
    color: var(--zx-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 24px;
}
.zx-admin .zx-brand img { display: block; height: 36px; width: auto; }
.zx-admin .zx-top-end { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; margin-inline-start: auto; }

.zx-admin .zx-lang { display: flex; gap: 4px; }
.zx-admin .zx-lang a { color: #c9d2e3; padding: 4px 8px; border-radius: 6px; font-size: .85rem; text-decoration: none; }
.zx-admin .zx-lang a:hover { background: var(--zx-navy-2); color: var(--zx-white); text-decoration: none; }
.zx-admin .zx-lang a.active { color: var(--zx-white); background: var(--zx-navy-2); }

/* Language: one globe icon; a tap (focus) opens the small list under it, a tap anywhere else closes it. The wrapper
   takes the focus (tabindex -1) so it also opens on phones, where a button tap does not focus the button. */
.zx-admin .zx-lang-menu { position: relative; outline: none; }
.zx-admin .zx-lang-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #3a4a66;
    border-radius: 9px;
    background: transparent;
    color: var(--zx-white);
    font-size: 1.1rem;
    cursor: pointer;
}
.zx-admin .zx-lang-button:hover,
.zx-admin .zx-lang-menu:focus-within .zx-lang-button { background: var(--zx-navy-2); }
.zx-admin .zx-lang-menu .zx-lang {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    z-index: 1100;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
    padding: 6px;
    background: var(--zx-white);
    border-radius: 9px;
    box-shadow: 0 10px 30px rgba(13, 21, 35, .18);
}
.zx-admin .zx-lang-menu:focus-within .zx-lang { display: flex; }
.zx-admin .zx-lang-menu .zx-lang a { color: var(--zx-text); padding: 7px 12px; border-radius: 6px; font-size: .9rem; }
.zx-admin .zx-lang-menu .zx-lang a:hover { background: var(--zx-page); color: var(--zx-navy); }
.zx-admin .zx-lang-menu .zx-lang a.active { background: var(--zx-page); color: var(--zx-navy); font-weight: 700; }

.zx-admin .zx-user { display: inline-flex; align-items: center; gap: 8px; }
.zx-admin .zx-user-name { font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zx-admin .zx-avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; }
.zx-admin .zx-avatar-letter { display: inline-flex; align-items: center; justify-content: center; background: var(--zx-orange); color: var(--zx-white); font-weight: 700; }

.zx-admin .zx-team-badge { background: var(--zx-orange); color: var(--zx-white); border-radius: 999px; padding: 2px 12px; font-size: .78rem; font-weight: 700; }

/* ---- Side menu and page ---- */
.zx-admin .zx-manage {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 24px;
    padding: 32px 24px;
}
.zx-admin .zx-side { display: flex; flex-direction: column; gap: 2px; }
/* The orange team badge, first in the side menu. */
.zx-admin .zx-side-badge { align-self: flex-start; margin-block-end: 10px; margin-inline-start: 14px; }
.zx-admin .zx-side-link { color: var(--zx-text); padding: 9px 14px; border-radius: 9px; font-weight: 500; text-decoration: none; }
.zx-admin .zx-side-link:hover { background: var(--zx-white); color: var(--zx-text); text-decoration: none; }
.zx-admin .zx-side-link.active { background: var(--zx-white); color: var(--zx-navy); font-weight: 700; box-shadow: inset 3px 0 0 var(--zx-orange); }
[dir="rtl"] .zx-admin .zx-side-link.active { box-shadow: inset -3px 0 0 var(--zx-orange); }
/* Sign out at the end of the side menu: a button that looks like the links above it. */
.zx-admin .zx-side-signout { margin: 0; }
.zx-admin .zx-side-signout .zx-side-link { display: block; width: 100%; text-align: start; background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer; }
.zx-admin .zx-side-signout .zx-side-link:hover { background: var(--zx-white); }
@media (max-width: 760px) { .zx-admin .zx-side-signout .zx-side-link:hover { background: var(--zx-page); } }
.zx-admin .zx-manage-main { min-width: 0; }

/* ---- Overview: number cards (white panels like auth's), a card with a page is a link ---- */
.zx-admin .zx-stats-title { font-size: 1.05rem; font-weight: 700; color: var(--zx-navy); margin: 0 0 10px; }
.zx-admin .zx-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 0 0 24px; }
.zx-admin .zx-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--zx-white);
    border: 1px solid transparent;
    border-radius: var(--zx-radius);
    box-shadow: 0 4px 16px rgba(13, 21, 35, .05);
    padding: 18px;
    color: var(--zx-text);
    text-decoration: none;
}
.zx-admin a.zx-stat:hover { border-color: var(--zx-orange); color: var(--zx-text); text-decoration: none; }
.zx-admin .zx-stat strong { font-size: 1.7rem; line-height: 1.2; color: var(--zx-navy); }
.zx-admin .zx-stat span { color: var(--zx-muted); font-size: .88rem; }
.zx-admin .zx-stat-warn strong { color: var(--zx-orange-dark); }

/* ---- Footer ---- */
.zx-admin .zx-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 18px 24px;
    color: var(--zx-muted);
    font-size: .82rem;
    border-top: 1px solid var(--zx-line);
    background: var(--zx-white);
}
.zx-admin .zx-footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.zx-admin .zx-footer-links a { color: var(--zx-muted); text-decoration: none; }
.zx-admin .zx-footer-links a:hover { text-decoration: underline; }

/* The Menu button: only on phones (below). A checkbox (.zx-menu-toggle) so it opens before the page is connected. */
.zx-admin .zx-menu-toggle { display: none; }
.zx-admin .zx-menu-button { display: none; }

/* ---- Phone ---- */
@media (max-width: 760px) {
    .zx-admin .zx-top { padding: 10px 16px; }
    .zx-admin .zx-user-name { display: none; }
    .zx-admin .zx-manage { grid-template-columns: minmax(0, 1fr); padding: 16px 12px; gap: 12px; position: relative; }

    /* The side menu hides behind the Menu button and opens as a list over the page. */
    .zx-admin .zx-menu-button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        padding: 6px 14px;
        min-height: 36px;
        border: 1px solid #3a4a66;
        border-radius: 9px;
        color: var(--zx-white);
        font-size: .88rem;
        font-weight: 600;
        cursor: pointer;
    }
    .zx-admin .zx-menu-button:hover { background: var(--zx-navy-2); }
    .zx-admin .zx-menu-toggle:checked ~ .zx-top .zx-menu-button { background: var(--zx-navy-2); }
    .zx-admin .zx-side {
        display: none;
        position: absolute;
        top: 8px;
        inset-inline: 12px;
        z-index: 1000;
        background: var(--zx-white);
        border-radius: var(--zx-radius);
        box-shadow: 0 10px 30px rgba(13, 21, 35, .18);
        padding: 8px;
        max-height: 75vh;
        overflow-y: auto;
    }
    .zx-admin .zx-menu-toggle:checked ~ .zx-manage .zx-side { display: flex; }
    .zx-admin .zx-side-link:hover, .zx-admin .zx-side-link.active { background: var(--zx-page); }
    .zx-admin .zx-footer { padding: 14px 16px; }
}
