@import url('https://fonts.googleapis.com/css2?family=Exo:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-deep: #0b0e13;
    --bg-dark: #0f1319;
    --bg-card: #151a22;
    --bg-card-hover: #1a2130;
    --bg-sidebar: #0d1118;
    --bg-elevated: #1c2430;
    --primary: #E55B00;
    --primary-dark: #C44E00;
    --primary-soft: rgba(229, 91, 0, 0.15);
    --primary-glow: rgba(229, 91, 0, 0.35);
    --text-main: #f0f3f7;
    --text-muted: #8b97a8;
    --border: #243041;
    --border-light: #2e3d52;
    --accent: #FF7A1A;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --transition: 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
    font-family: 'Exo', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input, select, textarea {
    font-family: 'Exo', sans-serif;
}

/* ========== LAYOUT ========== */
.app-shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at top right, rgba(229, 91, 0, 0.08), transparent 50%),
        var(--bg-dark);
}

.app-topbar {
    height: 64px;
    background: linear-gradient(90deg, #E55B00 0%, #C44E00 55%, #A34200 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
}

.app-brand-divider {
    width: 1px;
    height: 34px;
    background: rgba(255, 255, 255, 0.35);
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.app-brand-text strong {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.app-brand-text span {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.62rem;
    letter-spacing: 1.6px;
    font-weight: 600;
    margin-top: 2px;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-bell {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.app-bell .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: #1a2330;
    border-radius: 999px;
    padding: 4px 12px 4px 4px;
    min-height: 42px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.app-profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E55B00, #A34200);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.app-profile-meta strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a2330;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.app-profile-pill > i {
    font-size: 0.7rem;
    color: #6b7788;
}

.wrapper {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0d1118 0%, #0a0d12 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.sidebar-company {
    flex-shrink: 0;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-company-name {
    color: var(--text-main);
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: 0.6px;
    line-height: 1.3;
    margin-bottom: 10px;
}

.sidebar-plan-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.sidebar-plan-badge i {
    font-size: 0.68rem;
}

.sidebar-header {
    padding: 28px 22px;
    border-bottom: 1px solid var(--border);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #A34200);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--primary-glow);
    flex-shrink: 0;
}

.brand-icon i {
    color: #fff;
    font-size: 1.15rem;
}

.brand-text h2 {
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.brand-text p {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-top: 3px;
    font-weight: 500;
}

.sidebar-user {
    margin: 18px 16px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #A34200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

.sidebar-user .info strong {
    display: block;
    font-size: 0.85rem;
}

.sidebar-user .info span {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}

.nav-menu {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 10px;
    overflow-x: hidden;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 12px 14px 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.nav-item {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.92rem;
    border-left: none !important;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--accent);
}

body.plan-locked .sidebar-plan-badge.is-expired,
.sidebar-plan-badge.is-expired {
    background: rgba(231, 76, 60, 0.9);
}

.nav-item i {
    margin-right: 0;
    font-size: 1rem;
    width: 20px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .premium-tag {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f39c12, #d68910);
    color: #1a1205;
}

.nav-group {
    margin-bottom: 4px;
}

.nav-toggle {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}

.nav-toggle > span {
    flex: 1;
    text-align: left;
}

.nav-toggle .nav-chevron {
    margin-left: auto;
    margin-right: 0 !important;
    width: auto;
    min-width: auto;
    font-size: 0.7rem;
    opacity: 0.75;
    transition: transform 0.25s ease;
}

.nav-group.is-open .nav-toggle .nav-chevron {
    transform: rotate(180deg);
}

.nav-group.is-open .nav-toggle {
    color: var(--accent);
    background: rgba(229, 91, 0, 0.12);
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.nav-submenu {
    display: none;
    padding: 2px 0 8px 0;
}

.nav-group.is-open .nav-submenu {
    display: block;
}

.nav-subitem {
    padding: 10px 14px 10px 44px !important;
    font-size: 0.86rem !important;
    position: relative;
    gap: 8px !important;
}

.nav-subitem::before {
    content: '';
    position: absolute;
    left: 26px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-light);
    transform: translateY(-50%);
}

.nav-subitem.active::before,
.nav-subitem:hover::before {
    background: var(--primary);
}

.nav-subitem .premium-tag {
    margin-left: auto;
}

.nav-subitem-label {
    color: inherit;
    font-family: 'Exo', sans-serif;
    font-size: 14px;
}

body.plan-locked .nav-group:not([data-nav-group="config"]),
body.plan-locked .nav-menu > .nav-item[data-page] {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.35);
}

body.plan-locked .nav-group[data-nav-group="config"] {
    opacity: 1;
    pointer-events: auto;
    filter: none;
}

body.plan-locked .nav-group[data-nav-group="config"] .nav-item.nav-subitem[data-page]:not([data-page="config-plano"]) {
    opacity: 0.38;
    pointer-events: none;
}

body.plan-locked .nav-menu::before {
    content: 'Menu bloqueado — renove o plano';
    display: block;
    margin: 0 8px 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #ff8f84;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
}

.config-row {
    display: grid;
    grid-template-columns: 1.4fr 140px 160px 44px;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
}

.config-row .form-group {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .config-row {
        grid-template-columns: 1fr;
    }
}

.commission-form-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 18px;
}

.commission-list-wrap {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.commission-list-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.commission-list-wrap .empty-list {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-deep);
    border: 1px dashed var(--border);
    border-radius: 12px;
}

@media (max-width: 900px) {
    .commission-form-row {
        grid-template-columns: 1fr;
    }
}

/* ========== CONFIG TABS ========== */
.config-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow-x: auto;
}

.config-tab {
    flex: 1;
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.config-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.config-tab.is-active {
    background: var(--primary-soft);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(229, 91, 0, 0.35);
}

.config-tab-panel {
    display: none;
}

.config-tab-panel.is-active {
    display: block;
}

@media (max-width: 640px) {
    .config-tabs {
        flex-direction: column;
    }

    .config-tab {
        justify-content: flex-start;
    }
}

/* ========== PLANO / ASSINATURA (empresa) ========== */
.plan-expired-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    margin-bottom: 18px;
    border-radius: 12px;
    border: 1px solid rgba(231, 76, 60, 0.45);
    background: rgba(231, 76, 60, 0.12);
}

.plan-expired-banner[hidden] {
    display: none !important;
}

.plan-expired-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plan-expired-banner strong {
    display: block;
    color: #ff8f84;
    margin-bottom: 4px;
}

.plan-expired-banner p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.current-plan-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 28px;
}

.current-plan-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
}

.current-plan-empty i {
    font-size: 1.4rem;
    color: var(--primary);
}

.current-plan-empty strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 4px;
}

.current-plan-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.current-plan-label {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.current-plan-head h3 {
    font-size: 1.35rem;
    margin-bottom: 6px;
}

.current-plan-head p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0;
}

.current-plan-side {
    text-align: right;
}

.plan-status-pill {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.plan-status-active {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
}

.plan-status-expired {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

.plan-status-expiring {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
}

.plan-status-none {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.current-plan-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.current-plan-price small,
.plan-offer-price small {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}

.current-plan-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.current-plan-meta .lbl {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}

.current-plan-meta strong {
    font-size: 0.95rem;
}

.current-plan-meta .text-danger {
    color: var(--danger);
}

.current-plan-cta {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(229, 91, 0, 0.12);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.plan-section-title {
    font-size: 1rem;
    margin: 0 0 14px;
    color: var(--text-main);
}

.plans-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.plan-offer-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
}

.plan-offer-card:hover {
    border-color: rgba(229, 91, 0, 0.55);
}

.plan-offer-card.is-renew {
    border-color: rgba(243, 156, 18, 0.55);
}

.plan-offer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.plan-offer-top h4 {
    margin: 0;
    font-size: 1.05rem;
}

.plan-renew-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(243, 156, 18, 0.18);
    color: #f39c12;
}

.plan-offer-desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    min-height: 2.4em;
}

.plan-offer-price {
    font-size: 1.35rem;
    font-weight: 800;
}

.plan-modules-mini {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.plan-modules-mini li {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-modules-mini li i {
    color: var(--success);
    font-size: 0.7rem;
}

.plan-modules-mini li.more {
    color: var(--accent);
    font-weight: 600;
}

.plan-offer-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.plan-offer-actions .btn-primary,
.plan-offer-actions .btn-secondary {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.8rem;
}

@media (max-width: 700px) {
    .current-plan-meta {
        grid-template-columns: 1fr;
    }

    .current-plan-side {
        text-align: left;
    }
}

/* ========== ACCESS CONTROL ========== */
.access-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 22px;
    align-items: start;
}

.access-sidebar {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.access-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--border);
}

.access-sidebar-head h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.access-profile-list {
    display: flex;
    flex-direction: column;
    max-height: 520px;
    overflow-y: auto;
}

.access-profile-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.access-profile-item strong {
    font-size: 0.9rem;
}

.access-profile-item span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.access-profile-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.access-profile-item.is-active {
    background: var(--primary-soft);
    box-shadow: inset 3px 0 0 var(--primary);
}

.access-perms-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 14px;
}

.access-perms-head h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.access-perm-actions {
    display: flex;
    gap: 8px;
}

.permission-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.permission-group {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.permission-group-title {
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 12px;
}

.permission-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 14px;
}

.permission-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-main);
}

.permission-check input {
    width: auto;
    accent-color: var(--primary);
}

@media (max-width: 960px) {
    .access-layout {
        grid-template-columns: 1fr;
    }

    .access-profile-list {
        max-height: 220px;
    }
}

.premium-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(243, 156, 18, 0.12);
    border: 1px solid rgba(243, 156, 18, 0.35);
    color: #f5b041;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.hub-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    cursor: pointer;
    transition: 0.25s ease;
    text-align: left;
}

.hub-card:hover {
    border-color: rgba(229, 91, 0, 0.55);
    transform: translateY(-2px);
}

.hub-card i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.hub-card h4 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.hub-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.damage-areas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.damage-chip {
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--text-main);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    font-family: inherit;
}

.damage-chip.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--accent);
}

.item-list-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    background: var(--bg-deep);
    position: relative;
}

.photo-attach {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.photo-attach .preview {
    width: 88px;
    height: 88px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--bg-card);
    display: none;
}

.photo-attach .preview.is-visible {
    display: block;
}

.photo-attach label.file-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px dashed var(--border-light);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
}

.photo-attach label.file-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.photo-attach input[type="file"] {
    display: none;
}

.photo-attach .file-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.damage-photo-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    margin-top: 6px;
}

.sidebar-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.sidebar-footer .nav-item {
    margin-bottom: 0;
}

/* ========== TOP BAR ========== */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.top-bar {
    height: 72px;
    background: rgba(13, 17, 24, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-top-bar {
    display: none !important;
}

@media (max-width: 900px) {
    .app-profile-meta {
        display: none;
    }

    .app-brand-text span {
        display: none;
    }

    body {
        overflow: auto;
        overflow-x: hidden;
    }

    .app-shell {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .wrapper {
        overflow: visible;
    }

    .sidebar {
        height: auto;
        max-height: none;
        position: relative;
        overflow: visible;
    }

    .main-content {
        overflow: visible;
    }

    #content {
        overflow: visible;
    }
}

.top-bar-left h3 {
    font-weight: 700;
    font-size: 1.15rem;
}

.top-bar-left .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: 50%;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 40px;
    cursor: pointer;
    transition: var(--transition);
}

.user-profile:hover {
    border-color: var(--border-light);
}

.user-profile img,
.user-profile .avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-circle {
    background: linear-gradient(135deg, var(--primary), #A34200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.user-profile .name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-profile .role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ========== CONTENT ========== */
#content {
    padding: 28px 32px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 18px 18px 22px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.stat-card .stat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.stat-card .stat-row-value {
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 0;
    flex-shrink: 0;
}

.stat-card h4 {
    font-size: 0.84rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0;
    line-height: 1.25;
}

.stat-card h2 {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
}

.stat-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    text-align: right;
    line-height: 1.3;
    min-width: 0;
}

/* ========== DASHBOARD ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 360px));
    gap: 18px;
    margin-bottom: 24px;
}

.mobile-buttons {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.btn-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    padding: 28px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-main);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    min-height: 120px;
}

.btn-app:hover,
.btn-app:active {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.btn-app i {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.btn-app span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ========== LIST / SEARCH ========== */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.page-heading .icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.3rem;
}

.page-heading h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.page-heading p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    width: 360px;
    max-width: 100%;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    margin-left: 10px;
    outline: none;
    font-size: 0.9rem;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.btn-add,
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-add:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
    filter: brightness(1.08);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Remove setas do input number (ano etc.) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.form-group input::placeholder {
    color: #5a6575;
}

.form-row {
    display: flex;
    gap: 18px;
    margin-bottom: 4px;
}

.form-row .form-group {
    flex: 1;
}

/* ========== TABLES ========== */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .sidebar {
        width: 230px;
    }

    #content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .dashboard-grid.pc-stats {
        display: none;
    }

    .mobile-buttons {
        display: grid;
    }

    .top-bar {
        padding: 0 16px;
        height: 64px;
    }

    .user-profile .name,
    .user-profile .role {
        display: none;
    }

    .search-bar {
        width: 100%;
    }

    .list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-add {
        width: 100%;
        justify-content: center;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    #content {
        padding: 16px;
    }
}

/* ========== EXPANDABLE LIST CARDS ========== */
.expand-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expand-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.expand-card:hover {
    border-color: rgba(229, 91, 0, 0.45);
}

.expand-card.is-open {
    border-color: rgba(229, 91, 0, 0.55);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.expand-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
}

.expand-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #E55B00, #A34200);
}

.expand-identity {
    min-width: 160px;
    flex-shrink: 0;
}

.expand-identity h4 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 3px;
}

.expand-identity p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.expand-cols {
    flex: 1;
    display: flex;
    justify-content: space-around;
    gap: 12px;
}

.expand-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.expand-col .lbl {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.expand-col .val {
    font-weight: 600;
    font-size: 0.9rem;
}

.expand-chevron {
    color: var(--text-muted);
    width: 28px;
    text-align: center;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.expand-card.is-open .expand-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.expand-card-body {
    display: none;
    border-top: 1px solid var(--border);
    padding: 20px 22px 18px;
    background: rgba(0, 0, 0, 0.18);
    animation: expandIn 0.2s ease;
}

.expand-card.is-open .expand-card-body {
    display: block;
}

@keyframes expandIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.expand-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px 20px;
    margin-bottom: 18px;
}

.expand-detail-item .lbl {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.expand-detail-item .val {
    font-weight: 600;
    font-size: 0.92rem;
}

.expand-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

.expand-actions .btn-primary,
.expand-actions .btn-secondary,
.expand-actions .btn-danger {
    padding: 10px 18px;
    font-size: 0.82rem;
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: var(--transition);
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 0.12);
}

/* ========== FORM PAGE (sem popup) ========== */
.view-panel { display: none; }
.view-panel.is-active { display: block; }

/* ========== MARKETING ========== */
.mkt-info-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid rgba(37, 211, 102, 0.28);
    background: rgba(37, 211, 102, 0.08);
}

.mkt-info-card > i {
    font-size: 1.35rem;
    color: #25D366;
    margin-top: 2px;
}

.mkt-info-card strong {
    display: block;
    margin-bottom: 4px;
}

.mkt-info-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.mkt-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.mkt-var-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

button.mkt-var-chip:hover {
    border-color: var(--primary);
}

.mkt-preview {
    white-space: pre-wrap;
    font-size: 0.86rem;
    color: var(--text-muted);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    line-height: 1.45;
}

.mkt-notices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.mkt-notice-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mkt-notice-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.mkt-notice-head h4 {
    margin: 0 0 4px;
    font-size: 0.98rem;
}

.mkt-notice-head p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mkt-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.mkt-switch input {
    width: auto;
}

.mkt-notice-card textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
}

.pit-chrono {
    font-variant-numeric: tabular-nums;
    font-family: 'Exo', monospace, sans-serif;
    letter-spacing: 0.5px;
}

.pit-chrono.is-running {
    color: #e67e22;
    font-weight: 800;
}

.form-page {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: var(--shadow);
}

.form-page-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.form-page-top .title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.form-page-top h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.form-page-top p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-page-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* Stepper padrão */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    width: 25%;
}

.step-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-deep);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: var(--text-muted);
    transition: 0.25s ease;
}

.step.active .step-icon {
    background: linear-gradient(135deg, #E55B00, #A34200);
    border-color: #E55B00;
    color: #fff;
    box-shadow: 0 0 20px rgba(229, 91, 0, 0.45);
}

.step.completed .step-icon {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.step-label { text-align: center; }
.step-label strong { display: block; font-size: 0.85rem; }
.step-label span { font-size: 0.7rem; color: var(--text-muted); }

.form-alert {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.vehicle-block {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.vehicle-block h5 {
    font-size: 0.85rem;
    margin-bottom: 12px;
    color: var(--accent);
}

.vehicle-block .remove-vehicle {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .expand-cols {
        display: none;
    }

    .expand-identity {
        flex: 1;
        min-width: 0;
    }

    .expand-actions {
        flex-direction: column;
    }

    .expand-actions button {
        width: 100%;
        justify-content: center;
    }

    .stepper::before { display: none; }
    .step-label span { display: none; }
    .step-label strong { font-size: 0.7rem; }
    .form-page { padding: 18px; }
    .form-page-footer { justify-content: stretch; }
    .form-page-footer button { flex: 1; justify-content: center; }
}
