/* IPA Core — programėlės maketas (App_Shell): šoninė juosta kairėje, turinys dešinėje; telefone - meniu per ☰. */

body.ipa-app {
    margin: 0;
    background: var(--ipa-bg-alt, #f2f4f7);
    color: var(--ipa-text, #303640);
    font-family: var(--ipa-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
}
body.ipa-app.admin-bar .ipa-app__sidebar { top: 32px; height: calc(100vh - 32px); }

.ipa-app { min-height: 100vh; }

/* ── Šoninė juosta ── */
.ipa-app__sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 260px;
    height: 100vh;
    box-sizing: border-box;
    background: var(--ipa-bg, #fff);
    border-right: 1px solid var(--ipa-border, #e3e8f0);
    overflow-y: auto;
}
.ipa-app__brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--ipa-border, #e3e8f0);
    color: var(--ipa-text, #303640);
    text-decoration: none;
}
.ipa-app__logo { max-width: 150px; max-height: 44px; height: auto; }
.ipa-app__brand-title { font-size: 1.25rem; font-weight: 700; }
.ipa-app__brand-subtitle { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ipa-text-light, #5a6a85); }

.ipa-app__nav { flex: 1; padding: 12px 12px 8px; }
.ipa-app__section {
    margin: 16px 8px 6px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ipa-text-light, #5a6a85);
}
.ipa-app__menu, .ipa-app__sub { list-style: none; margin: 0; padding: 0; }
.ipa-app__item { margin: 2px 0; }
.ipa-app__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--ipa-text, #303640);
    font-size: .93rem;
    line-height: 1.3;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.ipa-app__link:hover { background: var(--ipa-bg-hover, #f2f4f7); color: var(--ipa-primary, #2a646f); }
.ipa-app__link.is-active { background: color-mix(in srgb, var(--ipa-primary, #2a646f) 12%, transparent); color: var(--ipa-primary, #2a646f); font-weight: 600; }
.ipa-app__icon, .ipa-app__link svg { width: 18px; height: 18px; flex: 0 0 18px; }
.ipa-app__label { flex: 1; }
.ipa-app__badge { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--ipa-primary, #2a646f); color: #fff; font-size: .72rem; font-weight: 600; text-align: center; }
.ipa-app__sub { margin: 2px 0 4px 20px; padding-left: 10px; border-left: 1px solid var(--ipa-border, #e3e8f0); }
.ipa-app__sub .ipa-app__link { padding: 7px 10px; font-size: .88rem; }

.ipa-app__bottom { padding: 8px 12px 16px; border-top: 1px solid var(--ipa-border, #e3e8f0); }
.ipa-app__user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 8px; }
.ipa-app__avatar { border-radius: 50%; flex: 0 0 36px; }
.ipa-app__user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ipa-app__user-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipa-app__user-mail { font-size: .78rem; color: var(--ipa-text-light, #5a6a85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipa-app__logout { display: inline-flex; padding: 6px; border-radius: 6px; color: var(--ipa-text-light, #5a6a85); }
.ipa-app__logout:hover { background: var(--ipa-bg-hover, #f2f4f7); color: #b42318; }
.ipa-app__logout svg { width: 18px; height: 18px; }
.ipa-app__back { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: .82rem; color: var(--ipa-text-light, #5a6a85); text-decoration: none; }
.ipa-app__back svg { width: 14px; height: 14px; }
.ipa-app__back:hover { color: var(--ipa-primary, #2a646f); }

/* ── Turinys ── */
.ipa-app__main { margin-left: 260px; padding: 32px 40px 48px; max-width: 1400px; box-sizing: border-box; }
.ipa-app__title { margin: 0 0 24px; font-size: 1.6rem; line-height: 1.25; color: var(--ipa-text, #303640); }
.ipa-app__content > *:first-child { margin-top: 0; }

/* Telefono viršutinė juosta */
.ipa-app__topbar { display: none; }
.ipa-app__overlay { position: fixed; inset: 0; z-index: 999; background: rgba(15, 23, 42, .4); }

@media (max-width: 1024px) {
    .ipa-app__topbar {
        position: sticky;
        top: 0;
        z-index: 998;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        background: var(--ipa-bg, #fff);
        border-bottom: 1px solid var(--ipa-border, #e3e8f0);
    }
    body.ipa-app.admin-bar .ipa-app__topbar { top: 46px; }
    .ipa-app__toggle { display: inline-flex; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ipa-text, #303640); cursor: pointer; }
    .ipa-app__toggle svg { width: 22px; height: 22px; }
    .ipa-app__topbar-brand { display: flex; align-items: center; gap: 10px; color: var(--ipa-text, #303640); font-weight: 600; text-decoration: none; }
    .ipa-app__topbar-brand img { max-height: 28px; width: auto; }
    .ipa-app__sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
    .ipa-app.is-menu-open .ipa-app__sidebar { transform: none; box-shadow: 0 0 40px rgba(15, 23, 42, .2); }
    .ipa-app__main { margin-left: 0; padding: 20px 16px 40px; }
    .ipa-app__title { font-size: 1.35rem; margin-bottom: 16px; }
}
@media (max-width: 782px) {
    body.ipa-app.admin-bar .ipa-app__sidebar { top: 46px; height: calc(100vh - 46px); }
}

/* ── Prisijungimo puslapis (app-auth.php) ── */
body.ipa-app-auth { margin: 0; min-height: 100vh; background: var(--ipa-bg-alt, #f2f4f7); color: var(--ipa-text, #303640); font-family: var(--ipa-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); }
body.ipa-app button, body.ipa-app input, body.ipa-app select, body.ipa-app textarea,
body.ipa-app-auth button, body.ipa-app-auth input, body.ipa-app-auth select, body.ipa-app-auth textarea { font-family: inherit; }
.ipa-app-auth__page { display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding: 48px 16px 32px; box-sizing: border-box; }
.ipa-app-auth__brand { display: inline-flex; color: var(--ipa-text, #303640); font-size: 1.5rem; font-weight: 700; text-decoration: none; }
.ipa-app-auth__brand img { max-width: 220px; max-height: 64px; height: auto; }
.ipa-app-auth__subtitle { margin-top: 8px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ipa-text-light, #5a6a85); }
.ipa-app-auth__main { width: 100%; display: flex; justify-content: center; margin: 24px 0; }
.ipa-app-auth__main .ipa-auth { min-height: 0; padding: 0; width: 100%; }
.ipa-app-auth__back { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 16px; color: var(--ipa-text-light, #5a6a85); font-size: .9rem; text-decoration: none; }
.ipa-app-auth__back svg { width: 16px; height: 16px; }
.ipa-app-auth__back:hover { color: var(--ipa-primary, #2a646f); }
@media (max-width: 480px) { .ipa-app-auth__page { padding-top: 28px; } }

/* ── Baziniai stiliai (tema programėlėje neįkeliama) ── */
body.ipa-app, body.ipa-app-auth { font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.ipa-app *, body.ipa-app-auth * { box-sizing: border-box; }
.ipa-app__main a:not(.ipa-btn):not([class*="ipa-btn-"]), .ipa-app-auth__main a:not(.ipa-btn):not([class*="ipa-btn-"]) { color: var(--ipa-primary, #2a646f); text-decoration: none; }
.ipa-app__main a:not(.ipa-btn):not([class*="ipa-btn-"]):hover, .ipa-app-auth__main a:not(.ipa-btn):not([class*="ipa-btn-"]):hover { text-decoration: underline; }
.ipa-app__main h1, .ipa-app__main h2, .ipa-app__main h3, .ipa-app__main h4 { line-height: 1.25; color: var(--ipa-text, #303640); }
.ipa-app__main h2 { font-size: 1.3rem; } .ipa-app__main h3 { font-size: 1.1rem; }
.ipa-app__main p { margin: 0 0 1em; }
.ipa-app__main img { max-width: 100%; height: auto; }
.ipa-app__main input[type="text"], .ipa-app__main input[type="search"], .ipa-app__main input[type="email"], .ipa-app__main input[type="tel"],
.ipa-app__main input[type="number"], .ipa-app__main input[type="password"], .ipa-app__main input[type="date"], .ipa-app__main select, .ipa-app__main textarea {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--ipa-border, #e3e8f0);
    border-radius: 8px;
    background: var(--ipa-bg, #fff);
    color: var(--ipa-text, #303640);
    font: inherit;
    font-size: .93rem;
}
.ipa-app__main input:focus, .ipa-app__main select:focus, .ipa-app__main textarea:focus { outline: none; border-color: var(--ipa-primary, #2a646f); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ipa-primary, #2a646f) 15%, transparent); }
.ipa-app__main table { border-collapse: collapse; }
.ipa-app__main hr { border: 0; border-top: 1px solid var(--ipa-border, #e3e8f0); margin: 20px 0; }
