/* Hoshen web admin layout.
   Ported from the working MAUI in-app admin (Resources/Raw/admin/Style/site.css),
   which uses a clean flexbox layout — replacing the old inline-block + font-size:0
   approach copied from EMS that left the bare pages (login / boards list) invisible.
   Differences from the MAUI admin:
     - the server adds an #upperPanel header bar (MAUI has none);
     - a fixed root font-size (a resizable browser admin, not a fixed-size TV → no 1vw);
     - extra padding for the bare pages that render straight into #content (no #inner). */

@font-face {
    font-family: 'VarelaRound';
    src: url('VarelaRound-Regular.ttf');
}

/* Fixed root so rem units stay stable while the browser window resizes
   (the MAUI admin uses 1vw because it runs full-screen on a fixed TV). */
html { font-size: 100%; }

html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: 'VarelaRound', Arial, sans-serif;
    font-size: 1rem;
    direction: rtl;
    overflow: hidden;
    background-color: #efefef;
}

/* ---- top header bar (server-only) ---- */
#upperPanel {
    height: 4rem;
    background-color: white;
    padding: 0 2rem;
    line-height: 4rem;
    font-size: 1.5rem;
    color: #2c3e50;
    box-sizing: border-box;
    box-shadow: 0 0.15rem 0.4rem 0 rgba(0,0,0,0.3);
}

#leftPart {
    float: left;
    height: 4rem;
    font-size: 1rem;
}

#leftPart > img {
    vertical-align: middle;
    height: 3rem;
}

#menuToggle {
    display: none;
    float: right;
    font-size: 2rem;
    line-height: 4rem;
    margin-left: 1rem;
    cursor: pointer;
    user-select: none;
}

/* ---- content fills the rest below the header ---- */
#content {
    height: calc(100vh - 4rem);
    overflow-y: auto;
    box-sizing: border-box;
}

/* Bare pages (login, boards list) render directly into #content with no #inner,
   so give them their own breathing room. */
#content > h2,
#content > p { margin: 1.5rem 2rem; color: #2c3e50; }
#content > table { margin: 1rem 2rem; }
#content > input[type=button] { margin: 0 2rem 1.5rem; }

/* ---- two-column board admin (from the MAUI admin) ---- */
#layout { display: flex; height: 100%; }

#menu {
    width: 14rem;
    background: #2c3e50;
    color: #fff;
    padding: 1rem;
    overflow-y: auto;
    box-sizing: border-box;
    height: 100%;
}

#menu h2 { margin-top: 0; }

#menu .buttons { display: flex; flex-direction: column; gap: 0.5rem; }

#menu input[type=button] {
    background: #34495e;
    color: #fff;
    border: 1px solid #1abc9c;
    padding: 0.8rem;
    cursor: pointer;
    font-size: 1rem;
    text-align: right;
}

#menu input[type=button]:hover { background: #1abc9c; }

#inner {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ---- inline forms (.formDiv) — server overrides on top of the shared leopard.css ----
   leopard.css lays each field out as a fixed-width label (45%) with the input floated
   beside it. That fits a wide TV but on a narrower browser the long Hebrew labels here
   ("זמן הצגת מסך שינויים בתפילה" …) overflow and collide with the input. Stack the input
   UNDER its label instead — still two columns, but the label is free to wrap. */
.formDiv > label {
    display: inline-flex;
    flex-direction: column;
    vertical-align: top;
    width: 45%;
    height: auto;
    line-height: 1.3;
    margin: 0.6rem 1%;
    box-sizing: border-box;
}

.formDiv > label > input,
.formDiv > label > select {
    float: none;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.3rem;
}

/* checkboxes shouldn't stretch to the full column width */
.formDiv > label > input[type=checkbox] { width: auto; align-self: flex-start; }

/* The login card is a bare #content page; don't give it leopard's 80vh height. */
#content > .formDiv {
    height: auto;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 0.4rem;
    box-shadow: 0 0.15rem 0.6rem rgba(0,0,0,0.15);
}
#content > .formDiv > label { width: 100%; }

/* menu divider */
#menu hr { border: none; border-top: 1px solid #45617a; margin: 0.5rem 0; }

/* ---- phones / narrow screens: menu becomes a slide-in drawer ---- */
@media (max-width: 56.25rem) {
    #menuToggle { display: block; }
    #upperPanel { padding: 0 1rem; font-size: 1.3rem; }
    #leftPart { font-size: 0; }            /* hide company text, keep the logo */

    #menu {
        position: fixed;
        top: 4rem;
        right: -70vw;
        width: 70vw;
        height: calc(100vh - 4rem);
        transition: right 0.35s ease;
        z-index: 20;
        box-shadow: -0.25rem 0 0.6rem rgba(0,0,0,0.4);
    }
    body.menu-open #menu { right: 0; }
}
