/*
 * PlacarWeb — sole stylesheet for the rewritten (Fase A+) pages.
 * No Bootstrap, no template-food67: plain CSS Grid/Flexbox layout
 * primitives + the brand tokens/components below. Pages still on the old
 * layout (layout-siderbar.blade.php, not yet rewritten) also load this file
 * layered on top of Bootstrap — those .pw-* classes are additive there and
 * harmless once a page migrates off Bootstrap entirely.
 *
 * Palette verified via the ui-ux-pro-max skill's color-domain search
 * ("modern professional dashboard trustworthy" / "trivia quiz leaderboard"):
 * "Quiz blue + gold leaderboard" — blue brand/primary (unifies what used to
 * be two competing tokens, brand red vs. semantic blue), green for success,
 * amber/gold reserved for the "exact score" achievement badge, red kept only
 * as the danger/error semantic (never brand). Typography (Russo One display
 * + Chakra Petch body) unchanged from the original Fase A design-system pick.
 */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@300;400;500;600;700&family=Russo+One&display=swap');

:root {
    /* Brand tokens (from the skill's verified design system) — unified with
       --pw-primary below so there's exactly one brand blue, not two
       competing "primary" colors. */
    --pw-brand-primary: #2563eb;
    --pw-brand-on-primary: #ffffff;
    --pw-brand-secondary: #3b82f6;
    --pw-brand-background: #eff6ff;
    --pw-brand-foreground: #1e3a8a;
    --pw-brand-border: #dbeafe;
    --pw-font-display: 'Russo One', 'Chakra Petch', sans-serif;
    --pw-font-body: 'Chakra Petch', 'Poppins', sans-serif;

    /* Semantic tokens (outcome badges — kept distinct so a "wrong pick"
       badge never reads as a brand accent) */
    --pw-ink: #0f172a;
    --pw-primary: #2563eb;
    --pw-primary-dark: #1d4ed8;
    --pw-success: #16a34a;
    --pw-success-bg: #dcfce7;
    --pw-danger: #b91c1c;
    --pw-danger-bg: #fee2e2;
    --pw-warning: #d97706;
    --pw-warning-bg: #fef3c7;
    --pw-gold: #b45309;
    --pw-gold-bg: #fde68a;
    --pw-muted: #64748b;
    --pw-border: #e2e8f0;
    --pw-radius: 0.75rem;
}

/* ---------- Scoreboard (exact-score prediction entry) ---------- */

.pw-scoreboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    background: #f8fafc;
    border: 1px solid var(--pw-border);
    border-radius: var(--pw-radius);
}

.pw-scoreboard-time {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--pw-ink);
}

.pw-score-input {
    width: 3.25rem;
    height: 3.25rem;
    min-width: 44px;
    min-height: 44px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pw-ink);
    border: 2px solid var(--pw-border);
    border-radius: 0.5rem;
    -moz-appearance: textfield;
}

.pw-score-input:focus {
    border-color: var(--pw-primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
    outline: none;
}

.pw-score-input::-webkit-outer-spin-button,
.pw-score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pw-scoreboard-x {
    font-weight: 700;
    color: var(--pw-muted);
    font-size: 1.1rem;
}

.pw-score-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.pw-score-quickpicks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
}

.pw-score-quickpick {
    width: 2rem;
    height: 2rem;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--pw-border);
    border-radius: 0.4rem;
    background: #fff;
    color: var(--pw-ink);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 120ms, border-color 120ms, color 120ms;
}

.pw-score-quickpick:hover {
    border-color: var(--pw-primary);
}

.pw-score-quickpick.is-active {
    background: var(--pw-primary);
    border-color: var(--pw-primary);
    color: #fff;
}

.pw-score-input-manual {
    width: 3.75rem;
    height: 2.25rem;
    min-width: 0;
    min-height: 0;
    font-size: 1rem;
    font-weight: 600;
}

.pw-scoreboard.pw-scoreboard-locked {
    background: #fff;
    opacity: 0.9;
}

.pw-scoreboard.pw-scoreboard-acerto-exato {
    background: var(--pw-gold-bg);
    border-color: var(--pw-gold);
}

.pw-scoreboard.pw-scoreboard-acerto {
    background: var(--pw-success-bg);
    border-color: var(--pw-success);
}

.pw-scoreboard.pw-scoreboard-erro {
    background: var(--pw-danger-bg);
    border-color: var(--pw-danger);
}

/* ---------- Tiered outcome badges ---------- */

.pw-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pw-badge-pendente {
    color: var(--pw-muted);
    background: #f1f5f9;
}

.pw-badge-feito {
    color: var(--pw-primary-dark);
    background: #dbeafe;
}

.pw-badge-acerto {
    color: var(--pw-success);
    background: var(--pw-success-bg);
}

.pw-badge-exato {
    color: var(--pw-gold);
    background: var(--pw-gold-bg);
}

.pw-badge-erro {
    color: var(--pw-danger);
    background: var(--pw-danger-bg);
}

/* ---------- Conquistas (achievements) ---------- */

.pw-conquistas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.pw-conquista-item {
    text-align: center;
    padding: 0.9rem 0.5rem;
    border: 1px solid var(--pw-gold);
    background: var(--pw-gold-bg);
    border-radius: var(--pw-radius);
}

.pw-conquista-item.is-locked {
    border-color: var(--pw-border);
    background: #f8fafc;
    filter: grayscale(1);
    opacity: 0.55;
}

.pw-conquista-icone {
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.pw-conquista-nome {
    font-family: var(--pw-font-display);
    font-size: 0.8rem;
}

.pw-conquista-descricao {
    font-size: 0.72rem;
    color: var(--pw-muted);
    margin-top: 0.2rem;
}

/* ---------- Countdown ---------- */

.pw-countdown {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--pw-warning);
    background: var(--pw-warning-bg);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
}

.pw-countdown.pw-countdown-urgente {
    color: var(--pw-danger);
    background: var(--pw-danger-bg);
}

/* ---------- Ranking ---------- */

.pw-rank-row-voce {
    background: #eff6ff !important;
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--pw-primary);
}

.pw-rank-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: #f1f5f9;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Mobile card fallback for ranking tables that carry .pw-table-responsive-cards */
@media (max-width: 575.98px) {
    .pw-table-responsive-cards thead {
        display: none;
    }

    .pw-table-responsive-cards tbody tr {
        display: block;
        border: 1px solid var(--pw-border);
        border-radius: var(--pw-radius);
        margin-bottom: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .pw-table-responsive-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none !important;
        padding: 0.25rem 0 !important;
    }

    .pw-table-responsive-cards tbody td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        text-transform: uppercase;
        color: var(--pw-muted);
        font-weight: 700;
        margin-right: 0.75rem;
    }
}

/* ---------- Typography ---------- */

body {
    font-family: var(--pw-font-body);
}

h1, h2, h3, h4, h5, h6,
.page-title,
.pw-display {
    font-family: var(--pw-font-display);
    letter-spacing: 0.01em;
}

/* ---------- Brand navbar / sidebar accents (dashboard layout) ---------- */

.topbar {
    background: var(--pw-brand-primary) !important;
}

.sidebar-nav ul .sidebar-item.selected > .sidebar-link,
.sidebar-nav ul .sidebar-item .sidebar-link:hover {
    color: var(--pw-brand-primary) !important;
}

.btn-primary {
    background-color: var(--pw-brand-primary);
    border-color: var(--pw-brand-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.pw-wordmark {
    font-family: var(--pw-font-display);
    font-size: 1.25rem;
    letter-spacing: 0.03em;
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pw-wordmark i {
    color: #fbbf24;
}

/* ---------- Header de perfil (avatar + pontuação) ---------- */

.pw-profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--pw-radius);
    color: #fff;
    background: linear-gradient(135deg, var(--pw-brand-secondary) 0%, var(--pw-brand-primary) 60%, #1e3a8a 100%);
}

.pw-profile-avatar {
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--pw-font-display);
    font-size: 1.4rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
}

.pw-profile-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-left: auto;
    text-align: center;
}

.pw-profile-stats .pw-stat-value {
    font-family: var(--pw-font-display);
    font-size: 1.5rem;
    line-height: 1;
}

.pw-profile-stats .pw-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
}

/* ---------- Hero (landing page) ---------- */

.pw-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--pw-brand-on-primary);
    background: radial-gradient(circle at top right, var(--pw-brand-secondary) 0%, var(--pw-brand-primary) 45%, #1e3a8a 100%);
}

.pw-hero-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
}

.pw-hero-nav .pw-logo {
    height: 2.5rem;
    width: auto;
    display: block;
}

.pw-hero-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.25rem;
}

.pw-hero-main h1 {
    font-family: var(--pw-font-display);
    font-size: clamp(2.25rem, 6vw, 4rem);
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    margin-bottom: 1rem;
}

.pw-hero-main p {
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    max-width: 40rem;
    margin: 0 auto 2rem;
    opacity: 0.95;
}

.pw-hero-cta {
    display: inline-block;
    min-height: 44px;
    padding: 0.85rem 2.5rem;
    font-family: var(--pw-font-display);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    background: #fff;
    color: var(--pw-brand-primary);
    border-radius: 999px;
    border: none;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.pw-hero-nav .pw-nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.95rem;
}

.pw-hero-nav .pw-nav-link:hover {
    color: #fff;
}

.pw-hero-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    padding-bottom: 1.5rem;
}

.pw-hero-footer a {
    color: rgba(255, 255, 255, 0.85);
}

.pw-hero-cta:hover,
.pw-hero-cta:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    color: var(--pw-brand-primary);
}

.pw-hero-strip {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    padding: 1.5rem 1.25rem 2.5rem;
    font-family: var(--pw-font-display);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.9;
}

.pw-hero-strip span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

@media (prefers-reduced-motion: no-preference) {
    .pw-hero-main h1,
    .pw-hero-main p,
    .pw-hero-cta {
        animation: pw-fade-up 500ms ease both;
    }

    .pw-hero-main p {
        animation-delay: 100ms;
    }

    .pw-hero-cta {
        animation-delay: 200ms;
    }
}

@keyframes pw-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================================
   Layout shell (dashboard/admin) — replaces Bootstrap grid + template-food67
   ===================================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f8fafc;
    color: var(--pw-ink);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--pw-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.pw-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--pw-ink);
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.pw-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.pw-brand-logo {
    height: 2.25rem;
    width: auto;
    display: block;
}

.pw-sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}

.pw-sidebar-nav {
    flex: 1;
}

.pw-nav-group {
    margin-bottom: 0.5rem;
}

.pw-nav-group-label {
    padding: 0.6rem 1.25rem 0.35rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
}

.pw-nav-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pw-sidebar-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pw-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 15;
}

.pw-liga-sponsor-logo {
    max-height: 2.5rem;
    width: auto;
    display: block;
}

.pw-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.pw-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}

.pw-nav-link.pw-nav-active {
    color: #fff;
    border-left-color: var(--pw-brand-secondary);
    background: rgba(255, 255, 255, 0.08);
}

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

.pw-topbar {
    background: #fff;
    border-bottom: 1px solid var(--pw-border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.pw-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--pw-ink);
}

.pw-content {
    padding: 1.5rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .pw-sidebar-backdrop {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .pw-sidebar {
        position: fixed;
        left: -230px;
        z-index: 20;
        transition: left 180ms ease;
    }

    .pw-sidebar.pw-sidebar-open {
        left: 0;
    }

    .pw-sidebar-close {
        display: block;
    }

    .pw-hamburger {
        display: block;
    }

    .pw-content {
        padding: 1rem;
    }
}

/* =====================================================================
   Cards, grid, buttons, forms
   ===================================================================== */

.pw-card {
    background: #fff;
    border: 1px solid var(--pw-border);
    border-radius: var(--pw-radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 8px rgba(15, 23, 42, 0.03);
}

.pw-card-title {
    font-family: var(--pw-font-display);
    font-size: 1rem;
    margin: 0 0 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--pw-border);
}

.pw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.pw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-family: var(--pw-font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: filter 120ms ease, transform 120ms ease;
}

.pw-btn:hover {
    filter: brightness(0.92);
    text-decoration: none;
}

.pw-btn:disabled,
.pw-btn.pw-btn-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
}

.pw-btn-primary {
    background: var(--pw-brand-primary);
    color: #fff;
}

.pw-btn-secondary {
    background: #fff;
    color: var(--pw-ink);
    border-color: var(--pw-border);
}

.pw-btn-success {
    background: var(--pw-success);
    color: #fff;
}

.pw-btn-sm {
    min-height: 36px;
    padding: 0 0.85rem;
    font-size: 0.8rem;
}

.pw-field {
    margin-bottom: 1rem;
}

.pw-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pw-muted);
    margin-bottom: 0.3rem;
}

.pw-input,
.pw-select {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--pw-border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: var(--pw-font-body);
    background: #fff;
    color: var(--pw-ink);
}

.pw-input:focus,
.pw-select:focus {
    outline: none;
    border-color: var(--pw-brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pw-alert {
    padding: 0.85rem 1rem;
    border-radius: var(--pw-radius);
    border: 1px solid transparent;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.pw-alert-warning {
    background: var(--pw-warning-bg);
    border-color: #fde68a;
    color: var(--pw-warning);
}

.pw-alert-success {
    background: var(--pw-success-bg);
    border-color: #bbf7d0;
    color: var(--pw-success);
}

.pw-alert-danger {
    background: var(--pw-danger-bg);
    border-color: #fecaca;
    color: var(--pw-danger);
}

/* Native <dialog> styling */
dialog.pw-dialog {
    border: none;
    border-radius: var(--pw-radius);
    padding: 0;
    width: min(560px, 92vw);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

dialog.pw-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
}

.pw-dialog-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--pw-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--pw-font-display);
}

.pw-dialog-body {
    padding: 1.25rem;
}

.pw-dialog-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--pw-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Toasts */
#pw-toast-root {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pw-toast {
    min-width: 240px;
    max-width: 320px;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.85rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: pw-fade-up 200ms ease both;
}

.pw-toast-success {
    background: var(--pw-success);
}

.pw-toast-error {
    background: var(--pw-danger);
}

/* =====================================================================
   Admin — list tables, filter toolbar, pagination, switch
   ===================================================================== */

.pw-table-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.pw-table-toolbar form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pw-table-toolbar .pw-field {
    margin-bottom: 0;
    min-width: 220px;
}

/* Bordered, rounded frame around a .pw-table — clips the header's top
   corners and keeps the horizontal-scroll wrapper from Fase A's mobile
   fallback (overflow-x on the same element that owns the border/radius,
   so a wide table scrolls inside a still-rounded frame instead of the
   radius getting clipped by a separate outer wrapper). */
.pw-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--pw-border);
    border-radius: 0.65rem;
}

.pw-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.pw-table th,
.pw-table td {
    padding: 0.7rem 1rem;
    text-align: left;
    vertical-align: middle;
}

.pw-table thead th {
    background: #f8fafc;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pw-muted);
    border-bottom: 1px solid var(--pw-border);
    white-space: nowrap;
}

.pw-table thead th:first-child {
    border-top-left-radius: 0.6rem;
}

.pw-table thead th:last-child {
    border-top-right-radius: 0.6rem;
}

.pw-table tbody td {
    border-bottom: 1px solid var(--pw-border);
    color: var(--pw-ink);
}

.pw-table tbody tr:last-child td {
    border-bottom: none;
}

.pw-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}

.pw-table tbody tr {
    transition: background-color 120ms ease;
}

.pw-table tbody tr:hover {
    background: #f1f5f9;
}

.pw-table tbody tr.pw-row-flash {
    background: var(--pw-warning-bg);
}

.pw-table tbody tr.pw-row-added {
    opacity: 0.6;
    background: #f8fafc;
}

/* Action-button group in a table's last column — right-aligned, tight
   gap, buttons never wrap onto their own lines on a narrow viewport. */
.pw-table-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.pw-table-empty {
    text-align: center;
    color: var(--pw-muted);
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

.pw-pagination {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    margin: 1.25rem 0 0;
    justify-content: center;
}

.pw-pagination li {
    display: flex;
}

.pw-pagination button {
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0 0.65rem;
    border: 1px solid var(--pw-border);
    background: #fff;
    color: var(--pw-ink);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.pw-pagination button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.pw-pagination li.active button {
    background: var(--pw-brand-primary);
    border-color: var(--pw-brand-primary);
    color: #fff;
}

.pw-pagination li.pw-ellipsis {
    min-width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pw-muted);
    font-size: 0.85rem;
}

.pw-switch {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.6rem;
    flex-shrink: 0;
}

.pw-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pw-switch-track {
    position: absolute;
    inset: 0;
    background: var(--pw-danger-bg);
    border: 1px solid var(--pw-danger);
    border-radius: 999px;
    transition: background 150ms ease, border-color 150ms ease;
}

.pw-switch-track::before {
    content: "";
    position: absolute;
    width: 1.15rem;
    height: 1.15rem;
    left: 0.15rem;
    top: 0.2rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 150ms ease;
}

.pw-switch input:checked + .pw-switch-track {
    background: var(--pw-success-bg);
    border-color: var(--pw-success);
}

.pw-switch input:checked + .pw-switch-track::before {
    transform: translateX(1.15rem);
}

.pw-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.pw-checkbox input {
    width: 1.1rem;
    height: 1.1rem;
}

/* =====================================================================
   Auth pages (login, cadastro, senha) — shared two-panel card
   ===================================================================== */

.pw-auth-body {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    margin: 0;
}

.pw-auth-shell {
    width: 100%;
    max-width: 900px;
}

.pw-auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: var(--pw-radius);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.pw-auth-form {
    padding: 2.5rem;
}

.pw-auth-form h1 {
    font-size: 1.3rem;
    margin: 0 0 1.25rem;
}

.pw-auth-brand {
    background: linear-gradient(135deg, var(--pw-brand-secondary) 0%, var(--pw-brand-primary) 60%, #1e3a8a 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.pw-auth-brand-logo {
    width: 11rem;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
}

.pw-auth-links {
    margin-top: 1rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 700px) {
    .pw-auth-card {
        grid-template-columns: 1fr;
    }

    .pw-auth-brand {
        display: none;
    }
}
