/* =============================================================
   Aramat · Tema de administración (estilo Dason)
   Shell de dashboard: sidebar de marca + topbar + tarjetas.
   Reutiliza Bootstrap 5 para los controles de formulario.
   ============================================================= */
:root {
    --brand: #1c4a42;
    --brand-dark: #143a33;
    --brand-light: #2a6157;
    --ad-bg: #f4f5f7;
    --ad-card: #ffffff;
    --ad-border: #e8ebee;
    --ad-muted: #8a94a6;
    --ad-sidebar-w: 250px;
    --ad-topbar-h: 70px;
}

body.ad-body {
    margin: 0;
    background: var(--ad-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    color: #3c4257;
}

/* ---------- Sidebar ---------- */
.ad-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--ad-sidebar-w);
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #cfe0dc;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}
.ad-sidebar__brand {
    height: var(--ad-topbar-h);
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 1.25rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.ad-sidebar__brand i { font-size: 1.4rem; }
.ad-sidebar__brand small {
    display: block;
    font-size: .5rem;
    letter-spacing: 3px;
    opacity: .7;
    font-weight: 400;
}
.ad-sidebar__logo {
    max-height: 42px;
    max-width: 190px;
    object-fit: contain;
}
.ad-sidebar__label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.4);
    padding: 1.25rem 1.5rem .5rem;
}
.ad-nav { list-style: none; margin: 0; padding: 0 .75rem; }
.ad-nav a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    margin-bottom: .15rem;
    border-radius: .4rem;
    color: #cfe0dc;
    text-decoration: none;
    font-size: .92rem;
    transition: background .15s, color .15s;
}
.ad-nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.ad-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.ad-nav a.active { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- Topbar ---------- */
.ad-topbar {
    position: fixed;
    top: 0; right: 0; left: var(--ad-sidebar-w);
    height: var(--ad-topbar-h);
    background: var(--ad-card);
    border-bottom: 1px solid var(--ad-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1030;
}
.ad-topbar__title { font-size: 1.05rem; font-weight: 600; color: #3c4257; margin: 0; }
.ad-topbar__right { display: flex; align-items: center; gap: .75rem; }
.ad-user {
    display: flex; align-items: center; gap: .5rem;
    font-size: .9rem; color: #3c4257;
}
.ad-user__avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.ad-burger {
    display: none;
    background: none; border: none;
    font-size: 1.4rem; color: #3c4257; cursor: pointer;
    margin-right: .5rem;
}

/* ---------- Content ---------- */
.ad-content {
    margin-left: var(--ad-sidebar-w);
    padding: calc(var(--ad-topbar-h) + 1.5rem) 1.75rem 6rem;
    min-height: 100vh;
}
.ad-content > .ad-card { scroll-margin-top: calc(var(--ad-topbar-h) + 1rem); }

.ad-card {
    background: var(--ad-card);
    border: 1px solid var(--ad-border);
    border-radius: .5rem;
    box-shadow: 0 1px 3px rgba(56,65,74,.06);
    margin-bottom: 1.5rem;
}
.ad-card__header {
    display: flex; align-items: center; gap: .6rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ad-border);
    font-weight: 600;
    color: #3c4257;
}
.ad-card__header i { color: var(--brand); font-size: 1.15rem; }
.ad-card__body { padding: 1.25rem; }

.ad-subitem {
    border: 1px solid var(--ad-border);
    border-radius: .5rem;
    padding: 1rem;
    background: #fbfcfd;
    height: 100%;
}

/* ---------- Save bar ---------- */
.ad-savebar {
    position: fixed;
    right: 0; bottom: 0; left: var(--ad-sidebar-w);
    background: var(--ad-card);
    border-top: 1px solid var(--ad-border);
    padding: .85rem 1.75rem;
    display: flex; justify-content: flex-end;
    z-index: 1020;
}

/* ---------- Botones de marca ---------- */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { color: var(--brand); border-color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }
.text-brand { color: var(--brand) !important; }

.form-label.small, .ad-card__body .form-label { font-weight: 500; color: #5b6472; }
.img-thumbnail { border-color: var(--ad-border); }

/* ---------- Selector visual de íconos ---------- */
.icon-picker__trigger {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-align: left;
    background: #fff;
    cursor: pointer;
}
.icon-picker__trigger:hover { border-color: var(--brand); }
.icon-picker__preview { font-size: 1.15rem; color: var(--brand); }
.icon-picker__name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #3c4257;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: .5rem;
}
.icon-grid__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .75rem .4rem;
    border: 1px solid var(--ad-border);
    border-radius: .5rem;
    background: #fff;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
.icon-grid__item i { font-size: 1.5rem; color: var(--brand); }
.icon-grid__item span {
    font-size: .7rem;
    color: #5b6472;
    text-align: center;
    line-height: 1.15;
}
.icon-grid__item:hover {
    border-color: var(--brand);
    background: #f0f6f4;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(28,74,66,.12);
}

/* ---------- Overlay móvil ---------- */
.ad-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1035;
}

/* ---------- Auth (login) estilo Dason ---------- */
.ad-auth {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(1200px 500px at 100% 0, rgba(28,74,66,.18), transparent),
        var(--ad-bg);
    padding: 1.5rem;
}
.ad-auth__card {
    width: 100%; max-width: 420px;
    background: var(--ad-card);
    border: 1px solid var(--ad-border);
    border-radius: .6rem;
    box-shadow: 0 10px 40px rgba(56,65,74,.12);
    overflow: hidden;
}
.ad-auth__head {
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-light) 100%);
    color: #fff;
    padding: 1.75rem;
    text-align: center;
}
.ad-auth__head i { font-size: 2rem; }
.ad-auth__logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: .5rem;
    padding: .5rem .75rem;
}
.ad-auth__logo-wrap img {
    max-height: 48px;
    max-width: 200px;
    object-fit: contain;
    display: block;
}
.ad-auth__body { padding: 1.75rem; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .ad-sidebar { transform: translateX(-100%); }
    .ad-sidebar.show { transform: translateX(0); }
    .ad-topbar { left: 0; }
    .ad-content { margin-left: 0; }
    .ad-savebar { left: 0; }
    .ad-burger { display: inline-block; }
    body.ad-sidebar-open .ad-overlay { display: block; }
}
