/*
 * Control panel styles.
 *
 * Self contained on purpose: the public site's main.css is a marketing theme
 * and pulling it in here would drag in sliders, animations and layout rules
 * that fight a data-dense admin UI. Brand colours are reused so the panel
 * still reads as Hertz.
 */

:root {
    /* Pulled straight from the public site's main.css so the panel shares the
       exact Hertz palette (yellow-1 on dark, with the site's status colours). */
    --hz-yellow: #ffcc00;
    --hz-yellow-hover: #f0be00;
    --hz-yellow-soft: #fff8d6;
    --hz-dark: #000000;
    --hz-dark-2: #111214;
    --hz-bg: #f6f6f4;
    --hz-surface: #ffffff;
    --hz-border: #e4e4e0;
    --hz-text: #05070a;
    --hz-muted: #6b7280;
    --hz-danger: #d93025;
    --hz-danger-soft: #fff5f8;
    --hz-success: #008009;
    --hz-success-soft: #ebfcea;
    --hz-warning: #923e01;
    --hz-warning-soft: #fff8d6;
    --hz-info: #3554d1;
    /* The site favours gentle rounding (rounded-4 / rounded-8). */
    --hz-radius: 8px;
    --hz-radius-sm: 4px;
    --hz-sidebar-w: 256px;
    --hz-topbar-h: 64px;
}

* {
    box-sizing: border-box;
}

body.hz {
    margin: 0;
    background: var(--hz-bg);
    color: var(--hz-text);
    /* Same primary face as the public site (--font-primary in main.css). */
    font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- Layout ---------- */

.hz-shell {
    display: flex;
    min-height: 100vh;
}

.hz-sidebar {
    width: var(--hz-sidebar-w);
    flex: 0 0 var(--hz-sidebar-w);
    /* The site's footer is solid black; the sidebar echoes it. */
    background: var(--hz-dark);
    color: #fff;
    padding: 0 0 24px;
    display: flex;
    flex-direction: column;
}

.hz-sidebar__logo {
    /* Yellow logo lockup, exactly like the site header (bg-yellow-1). */
    background: var(--hz-yellow);
    height: var(--hz-topbar-h);
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 14px;
}

.hz-sidebar__logo img {
    max-width: 118px;
}

.hz-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
}

.hz-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: var(--hz-radius-sm);
    color: rgba(255, 255, 255, .72);
    font-weight: 500;
    transition: background .18s ease, color .18s ease;
}

.hz-nav a:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.hz-nav a.is-active {
    /* The site's signature: yellow fill, black text — same as its buttons. */
    background: var(--hz-yellow);
    color: var(--hz-dark);
    font-weight: 600;
}

.hz-nav__badge {
    margin-inline-start: auto;
    background: var(--hz-danger);
    color: #fff;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
}

.hz-nav a.is-active .hz-nav__badge {
    background: var(--hz-dark);
    color: var(--hz-yellow);
}

.hz-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.hz-topbar {
    /* Matches the site header bar: solid yellow with dark content. */
    background: var(--hz-yellow);
    height: var(--hz-topbar-h);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.hz-topbar a,
.hz-topbar .hz-mut {
    color: var(--hz-dark) !important;
}

.hz-topbar .hz-btn--ghost {
    background: rgba(0, 0, 0, .07);
    border-color: transparent;
    color: var(--hz-dark);
}

.hz-topbar .hz-btn--ghost:hover {
    background: rgba(0, 0, 0, .14);
}

.hz-lang-toggle svg {
    flex: 0 0 auto;
}

.hz-content {
    padding: 24px;
    flex: 1;
}

.hz-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hz-page-head h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    /* Short yellow underline echoing the site's section titles. */
    position: relative;
    padding-bottom: 8px;
}

.hz-page-head h1::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    width: 42px;
    height: 3px;
    border-radius: 2px;
    background: var(--hz-yellow);
}

/* ---------- Cards & tables ---------- */

.hz-card {
    background: var(--hz-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-radius);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(5, 7, 10, .04);
}

.hz-card__title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hz-border);
}

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

.hz-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.hz-table th,
.hz-table td {
    padding: 11px 12px;
    text-align: start;
    border-bottom: 1px solid var(--hz-border);
    vertical-align: middle;
}

.hz-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--hz-muted);
    font-weight: 600;
}

.hz-table tbody tr:hover {
    background: #fafbfc;
}

.hz-table__thumb {
    width: 48px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
    background: #f2f3f5;
}

.hz-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
}

.hz-sort.is-active {
    color: var(--hz-text);
}

.hz-empty {
    text-align: center;
    padding: 36px 12px;
    color: var(--hz-muted);
}

/* ---------- Stats ---------- */

.hz-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.hz-stat {
    background: var(--hz-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-radius);
    padding: 18px;
    box-shadow: 0 1px 2px rgba(5, 7, 10, .04);
    /* Yellow accent bar on the leading edge, like the site's cards. */
    border-inline-start: 3px solid var(--hz-yellow);
}

.hz-stat__label {
    color: var(--hz-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
}

.hz-stat__value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 6px;
    color: var(--hz-dark);
}

/* ---------- Forms ---------- */

.hz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.hz-field {
    margin-bottom: 16px;
}

.hz-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
}

.hz-input,
.hz-select,
.hz-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-radius-sm);
    background: #fff;
    font: inherit;
    color: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.hz-input:focus,
.hz-select:focus,
.hz-textarea:focus {
    outline: none;
    border-color: var(--hz-yellow);
    /* Soft yellow focus ring instead of a hard outline. */
    box-shadow: 0 0 0 3px rgba(255, 204, 0, .35);
}

.hz-input.is-invalid,
.hz-select.is-invalid,
.hz-textarea.is-invalid {
    border-color: var(--hz-danger);
}

.hz-textarea {
    min-height: 110px;
    resize: vertical;
}

.hz-error {
    color: var(--hz-danger);
    font-size: 12.5px;
    margin-top: 5px;
}

.hz-help {
    color: var(--hz-muted);
    font-size: 12.5px;
    margin-top: 5px;
}

.hz-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
}

.hz-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--hz-yellow);
}

.hz-preview {
    max-height: 90px;
    border-radius: 6px;
    border: 1px solid var(--hz-border);
    background: #f2f3f5;
    padding: 4px;
    margin-bottom: 8px;
}

/* ---------- Rich text editor ---------- */

.hz-editor {
    border: 1px solid var(--hz-border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.hz-editor__bar {
    display: flex;
    gap: 2px;
    padding: 5px;
    border-bottom: 1px solid var(--hz-border);
    background: #fafbfc;
    flex-wrap: wrap;
}

.hz-editor__btn {
    min-width: 30px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    line-height: 1;
    color: var(--hz-text);
}

.hz-editor__btn:hover {
    background: #eef0f3;
    border-color: var(--hz-border);
}

.hz-editor__area {
    min-height: 110px;
    max-height: 340px;
    overflow-y: auto;
    padding: 10px 12px;
    line-height: 1.7;
}

.hz-editor__area:focus {
    outline: 2px solid var(--hz-yellow);
    outline-offset: -2px;
}

.hz-editor__area p {
    margin: 0 0 8px;
}

.hz-editor__area ul,
.hz-editor__area ol {
    margin: 0 0 8px;
    padding-inline-start: 22px;
}

/* ---------- Buttons ---------- */

.hz-btn {
    /* Mirrors the site's .button: flex, weight 500, yellow fill on dark text.
       Padding is tightened from the site's 14px 30px so the dense admin does
       not feel oversized, but the proportions and feel match. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: var(--hz-radius-sm);
    border: 1px solid transparent;
    background: var(--hz-yellow);
    color: var(--hz-dark);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s ease, filter .18s ease, border-color .18s ease;
}

.hz-btn:hover {
    background: var(--hz-yellow-hover);
}

.hz-btn--ghost {
    background: #fff;
    border-color: var(--hz-border);
    color: var(--hz-text);
}

.hz-btn--ghost:hover {
    background: #fff;
    border-color: var(--hz-dark);
}

.hz-btn--danger {
    background: var(--hz-danger);
    color: #fff;
}

.hz-btn--danger:hover {
    background: var(--hz-danger);
    filter: brightness(.92);
}

.hz-btn--sm {
    padding: 6px 12px;
    font-size: 12.5px;
}

.hz-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ---------- Filters ---------- */

.hz-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.hz-filters .hz-field {
    margin-bottom: 0;
    min-width: 150px;
}

/* ---------- Badges & alerts ---------- */

.hz-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eef0f3;
    color: var(--hz-muted);
}

.hz-badge--new {
    background: var(--hz-yellow-soft);
    color: var(--hz-warning);
}

.hz-badge--success,
.hz-badge--confirmed,
.hz-badge--replied,
.hz-badge--active {
    background: var(--hz-success-soft);
    color: var(--hz-success);
}

.hz-badge--danger,
.hz-badge--cancelled,
.hz-badge--inactive,
.hz-badge--rejected {
    background: var(--hz-danger-soft);
    color: var(--hz-danger);
}

/* Rental order statuses. */
.hz-badge--pending {
    background: var(--hz-yellow-soft);
    color: var(--hz-warning);
}

.hz-badge--approved,
.hz-badge--completed {
    background: var(--hz-success-soft);
    color: var(--hz-success);
}

/* ---------- Star ratings ---------- */

.hz-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.hz-star {
    color: #d7d9dd;
    font-size: 15px;
    line-height: 1;
}

.hz-star.is-on {
    color: var(--hz-yellow);
}

/* Interactive input: laid out reversed so a CSS-only hover could fill
   leftwards, but the real fill is driven by account.js. */
.hz-star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
    font-size: 26px;
    line-height: 1;
}

.hz-star-input input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.hz-star-input label {
    color: #d7d9dd;
    cursor: pointer;
    transition: color .12s ease;
}

.hz-star-input label.is-on {
    color: var(--hz-yellow);
}

.hz-star-input input:focus-visible + label {
    outline: 2px solid var(--hz-yellow);
    outline-offset: 2px;
}

.hz-alert {
    padding: 12px 16px;
    border-radius: var(--hz-radius-sm);
    margin-bottom: 16px;
    border: 1px solid transparent;
    /* A left keyline in brand yellow ties alerts to the rest of the panel. */
    border-inline-start-width: 3px;
}

.hz-alert--success {
    background: var(--hz-success-soft);
    border-color: #bfe6bd;
    color: var(--hz-success);
}

.hz-alert--danger {
    background: var(--hz-danger-soft);
    border-color: #f3c9d5;
    color: var(--hz-danger);
}

.hz-alert--warning {
    background: var(--hz-yellow-soft);
    border-color: var(--hz-yellow);
    color: var(--hz-warning);
}

.hz-alert ul {
    margin: 6px 0 0;
    padding-inline-start: 18px;
}

/* ---------- Pagination ---------- */

.hz-pagination {
    margin-top: 16px;
}

.hz-pagination svg {
    width: 16px;
    height: 16px;
}

/* ---------- Definition lists ---------- */

.hz-dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 16px;
    margin: 0;
}

.hz-dl dt {
    color: var(--hz-muted);
    font-weight: 600;
}

.hz-dl dd {
    margin: 0;
    word-break: break-word;
}

/* ---------- Auth screens ---------- */

.hz-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Light, on-brand backdrop: the site's page background with a soft yellow
       glow at the top — no longer a black screen. */
    background:
        radial-gradient(circle at 50% -10%, rgba(255, 204, 0, .35), transparent 55%),
        var(--hz-bg);
    padding: 24px;
}

.hz-auth__card {
    background: #fff;
    border-radius: var(--hz-radius);
    padding: 34px 32px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--hz-border);
    border-top: 4px solid var(--hz-yellow);
    box-shadow: 0 18px 50px rgba(5, 7, 10, .12);
}

.hz-auth__logo {
    text-align: center;
    margin-bottom: 18px;
    /* Yellow lockup band, as the logo sits on in the site header. */
    background: var(--hz-yellow);
    border-radius: var(--hz-radius-sm);
    padding: 14px;
}

.hz-auth__logo img {
    max-width: 130px;
}

.hz-auth__title {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 22px;
}

.hz-auth__links {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
}

.hz-auth__links a {
    color: var(--hz-muted);
    text-decoration: underline;
}

/* ---------- Utilities ---------- */

.hz-mut {
    color: var(--hz-muted);
}

.hz-sm {
    font-size: 12.5px;
}

.hz-mt {
    margin-top: 16px;
}

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

.hz-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e3e5e9;
}

@media (max-width: 900px) {
    .hz-shell {
        flex-direction: column;
    }

    .hz-sidebar {
        width: 100%;
        flex: none;
    }

    .hz-nav {
        display: flex;
        flex-wrap: wrap;
    }

    .hz-dl {
        grid-template-columns: 1fr;
        gap: 4px 0;
    }

    .hz-dl dd {
        margin-bottom: 10px;
    }
}
