/* ============================================================
   Família Orun — Painel Admin (estética colmeia)
   ============================================================ */

:root {
    --honey-bg:        #111111;
    --honey-bg-alt:    #1a1a1a;
    --honey-surface:   #1f1d18;
    --honey-surface-2: #272318;
    --honey-border:    rgba(232,191,74,0.18);
    --honey-border-2:  rgba(255,255,255,0.08);
    --honey-text:      #f3ecd7;
    --honey-soft:      rgba(243,236,215,0.65);
    --honey-mute:      rgba(243,236,215,0.40);

    --honey-gold:      #D4A017;
    --honey-gold-2:    #E8A020;
    --honey-gold-3:    #E8BF4A;
    --honey-gold-dark: #B8880F;

    --ok:    #2fb27a;
    --err:   #e04a4a;
    --warn:  #e8a020;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --sidebar-w: 260px;
    --topbar-h:  88px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--honey-bg);
    color: var(--honey-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--honey-gold-3); text-decoration: none; }
a:hover { color: var(--honey-gold-2); }

/* ------------------------------------------------------------
   Padrão hexagonal de fundo (reusa a ideia da home)
   ------------------------------------------------------------ */
.admin-body {
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212,160,23,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(232,160,32,0.06) 0%, transparent 55%),
        var(--honey-bg);
    position: relative;
}
.admin-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(60deg, rgba(232,191,74,0.03) 25%, transparent 25.5%, transparent 75%, rgba(232,191,74,0.03) 75%),
        linear-gradient(-60deg, rgba(232,191,74,0.03) 25%, transparent 25.5%, transparent 75%, rgba(232,191,74,0.03) 75%);
    background-size: 40px 70px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}

/* ------------------------------------------------------------
   Shell
   ------------------------------------------------------------ */
.admin-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------ */
.admin-sidebar {
    background: linear-gradient(180deg, rgba(31,29,24,0.95), rgba(17,17,17,0.95));
    border-right: 1px solid var(--honey-border);
    backdrop-filter: blur(8px);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.6rem 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--honey-border);
    color: var(--honey-text);
}
.admin-logo__hex {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--honey-gold), var(--honey-gold-2));
    color: #111;
    font-size: 1.2rem;
    clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
    flex: none;
}
.admin-logo__text strong { display: block; font-size: 0.98rem; font-weight: 700; }
.admin-logo__text small { display: block; font-size: 0.72rem; color: var(--honey-soft); letter-spacing: 0.1em; text-transform: uppercase; }

.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav__item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-md);
    color: var(--honey-soft);
    font-weight: 500;
    font-size: 0.93rem;
    transition: var(--transition);
    border: 1px solid transparent;
}
.admin-nav__item i { width: 18px; text-align: center; color: var(--honey-gold-3); }
.admin-nav__hex {
    width: 8px;
    height: 9px;
    background: var(--honey-gold);
    clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
    opacity: 0.6;
    flex: none;
}
.admin-nav__item:hover {
    background: rgba(212,160,23,0.07);
    color: var(--honey-text);
}
.admin-nav__item.is-active {
    background: linear-gradient(90deg, rgba(212,160,23,0.15), rgba(212,160,23,0.02));
    color: var(--honey-text);
    border-color: var(--honey-border);
}
.admin-nav__item.is-active .admin-nav__hex { opacity: 1; }

.admin-sidebar__foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--honey-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.admin-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
}
.admin-user i { font-size: 1.6rem; color: var(--honey-gold-2); }
.admin-user strong { display: block; font-weight: 600; color: var(--honey-text); }
.admin-user small { display: block; color: var(--honey-soft); font-size: 0.72rem; }
.admin-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: transparent;
    border: 1px solid var(--honey-border);
    border-radius: var(--radius-md);
    color: var(--honey-soft);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}
.admin-logout:hover { color: var(--err); border-color: rgba(224,74,74,0.4); background: rgba(224,74,74,0.05); }

/* ------------------------------------------------------------
   Main
   ------------------------------------------------------------ */
.admin-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.admin-topbar {
    min-height: var(--topbar-h);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-bottom: 1px solid var(--honey-border-2);
    background: rgba(17,17,17,0.6);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 5;
}
.admin-topbar__title h1 { font-size: 1.35rem; font-weight: 700; color: var(--honey-text); }
.admin-topbar__title p  { font-size: 0.9rem;  color: var(--honey-soft); margin-top: 0.2rem; }
.admin-topbar__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.admin-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.admin-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-top: 1px solid var(--honey-border-2);
    font-size: 0.8rem;
    color: var(--honey-mute);
}

/* ------------------------------------------------------------
   Flash
   ------------------------------------------------------------ */
.admin-flash {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    margin: 1.25rem 2rem 0;
    border: 1px solid transparent;
}
.admin-flash--success { background: rgba(47,178,122,0.1);  border-color: rgba(47,178,122,0.3);  color: #7de0b0; }
.admin-flash--error   { background: rgba(224,74,74,0.08);  border-color: rgba(224,74,74,0.35);  color: #ffb4b4; }
.admin-flash--warn    { background: rgba(232,160,32,0.08); border-color: rgba(232,160,32,0.35); color: var(--honey-gold-3); }

/* ------------------------------------------------------------
   Cards / Panels
   ------------------------------------------------------------ */
.panel {
    background: var(--honey-surface);
    border: 1px solid var(--honey-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
}
.panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 60% at 100% 0%, rgba(232,191,74,0.06) 0%, transparent 60%);
    pointer-events: none;
}
.panel > * { position: relative; z-index: 1; }

.panel__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--honey-border-2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--honey-gold-3);
}

/* Dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.stat-card {
    background: var(--honey-surface);
    border: 1px solid var(--honey-border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 100px;
    height: 100px;
    background: var(--honey-gold);
    opacity: 0.08;
    clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
}
.stat-card__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--honey-soft); }
.stat-card__value { font-size: 2.2rem; font-weight: 800; color: var(--honey-gold-3); margin: 0.3rem 0 0.1rem; }
.stat-card__foot  { font-size: 0.82rem; color: var(--honey-mute); }

/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.91rem;
}
.admin-table thead th {
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--honey-soft);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--honey-border);
}
.admin-table tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--honey-border-2);
    vertical-align: middle;
}
.admin-table tbody tr { transition: background var(--transition); }
.admin-table tbody tr:hover { background: rgba(212,160,23,0.05); }
.admin-table .t-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

.color-swatch {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    vertical-align: middle;
    clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.6rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge--gold   { background: linear-gradient(135deg, var(--honey-gold), var(--honey-gold-2)); color: #111; }
.badge--on     { background: rgba(47,178,122,0.15); color: #7de0b0; border: 1px solid rgba(47,178,122,0.3); }
.badge--off    { background: rgba(255,255,255,0.06); color: var(--honey-mute); border: 1px solid var(--honey-border-2); }
.badge--ghost  { background: transparent; color: var(--honey-soft); border: 1px solid var(--honey-border); }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.btn--primary {
    background: linear-gradient(135deg, var(--honey-gold), var(--honey-gold-2));
    color: #111;
}
.btn--primary:hover { filter: brightness(1.1); transform: translateY(-1px); color: #111; }
.btn--ghost {
    background: transparent;
    color: var(--honey-text);
    border-color: var(--honey-border);
}
.btn--ghost:hover { background: rgba(212,160,23,0.06); border-color: var(--honey-gold); color: var(--honey-text); }
.btn--danger {
    background: transparent;
    color: #ffb4b4;
    border-color: rgba(224,74,74,0.3);
}
.btn--danger:hover { background: rgba(224,74,74,0.08); border-color: var(--err); color: #fff; }
.btn--sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem 1.2rem;
}
.form-field { display: flex; flex-direction: column; gap: 0.4rem; grid-column: span 12; }
.form-field--6 { grid-column: span 6; }
.form-field--4 { grid-column: span 4; }
.form-field--3 { grid-column: span 3; }
.form-field--2 { grid-column: span 2; }

@media (max-width: 720px) {
    .form-field--6, .form-field--4, .form-field--3, .form-field--2 { grid-column: span 12; }
}

.form-field > label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--honey-soft);
}
.form-field > label .req { color: var(--err); }
.form-field small { color: var(--honey-mute); font-size: 0.78rem; }

.input, .textarea, .select {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--honey-border-2);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.9rem;
    color: var(--honey-text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--honey-gold);
    background: rgba(0,0,0,0.35);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.15);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23E8BF4A' d='M6 8 0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.2rem;
}

.input[type="color"] {
    height: 52px;
    padding: 0.3rem;
    cursor: pointer;
}

.form-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border-radius: 100px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--honey-border-2);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    user-select: none;
}
.form-check input { accent-color: var(--honey-gold); }
.form-check:hover { border-color: var(--honey-gold); background: rgba(212,160,23,0.06); }
.form-check input:checked ~ span { color: var(--honey-gold-3); font-weight: 600; }
.form-check:has(input:checked) { border-color: var(--honey-gold); background: rgba(212,160,23,0.08); }

.form-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--honey-text);
    cursor: pointer;
}
.form-toggle input { accent-color: var(--honey-gold); width: 18px; height: 18px; }

.form-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--honey-border-2);
    flex-wrap: wrap;
}

/* ------------------------------------------------------------
   Login
   ------------------------------------------------------------ */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    position: relative;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--honey-surface);
    border: 1px solid var(--honey-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem 2rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232,191,74,0.09) 0%, transparent 70%);
    pointer-events: none;
    border-radius: inherit;
}
.login-hex {
    width: 82px;
    height: 82px;
    margin: -70px auto 1rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--honey-gold), var(--honey-gold-2));
    color: #111;
    font-size: 1.6rem;
    clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
    box-shadow: 0 10px 30px rgba(212,160,23,0.3);
    position: relative;
    z-index: 2;
}
.login-card h1 { font-size: 1.35rem; text-align: center; font-weight: 700; }
.login-card .sub { text-align: center; color: var(--honey-soft); font-size: 0.9rem; margin: 0.3rem 0 1.5rem; }
.login-card .form-actions { justify-content: center; border: none; padding: 0; margin-top: 1rem; }
.login-card .btn { width: 100%; justify-content: center; }
.login-error {
    background: rgba(224,74,74,0.08);
    border: 1px solid rgba(224,74,74,0.35);
    color: #ffb4b4;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.login-mod-link {
    display: block;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--honey-mute);
    text-decoration: none;
}
.login-mod-link:hover {
    color: var(--honey-gold-3);
}

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--honey-soft);
}
.empty i { font-size: 2rem; color: var(--honey-gold-2); opacity: 0.6; margin-bottom: 0.5rem; }

/* ------------------------------------------------------------
   Delete confirm
   ------------------------------------------------------------ */
.confirm-card {
    max-width: 520px;
    margin: 2rem auto;
    text-align: center;
}
.confirm-card .icon-warn {
    width: 68px;
    height: 68px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    background: rgba(224,74,74,0.1);
    color: var(--err);
    font-size: 1.6rem;
    border-radius: 50%;
    border: 1px solid rgba(224,74,74,0.3);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--honey-border);
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .admin-logo { padding: 0; margin: 0; border: none; }
    .admin-nav { flex-direction: row; flex-wrap: wrap; flex: 1; justify-content: center; }
    .admin-nav__item { padding: 0.55rem 0.75rem; }
    .admin-nav__item span:last-child { display: none; }
    .admin-sidebar__foot { margin: 0; padding: 0; border: none; flex-direction: row; }
    .admin-user small { display: none; }
    .admin-topbar { padding: 1rem 1.25rem; flex-direction: column; align-items: flex-start; }
    .admin-content { padding: 1.25rem; }
}

/* Tabela responsiva via scroll horizontal em mobile */
.table-wrap { overflow-x: auto; }
