:root {
    --primary: #f75a0b;
    --primary-dark: #df4f08;
    --bg: #f4f4f4;
    --white: #ffffff;
    --text: #1f1f1f;
    --text-soft: #666666;
    --border: #e5e5e5;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    --dark: #081118;
    --danger: #d92d20;
    --success: #16a34a;
    --info: #2563eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.4;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
}

.topbar {
    background: var(--primary);
    width: 100%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo-link {
    display: block;
    text-align: center;
    margin-bottom: 18px;
}

.logo-matrix {
    width: 200px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.menu-interno {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.menu-interno a {
    display: inline-block;
    text-decoration: none;
    color: var(--white);
    font-size: 15px;
    font-weight: bold;
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 999px;
    transition: 0.2s ease;
    background: rgba(255,255,255,0.08);
    text-align: center;
}

.menu-interno a:hover,
.menu-interno a.active {
    background: var(--white);
    color: var(--primary);
}

.container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 15px 30px;
    width: 100%;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 2rem;
    line-height: 1.2;
}

.page-header p {
    text-align: center;
    color: var(--text-soft);
}

.box {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    width: 100%;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    display: block;
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.card h2 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.card p {
    color: var(--text-soft);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    font-size: 14px;
    font-weight: bold;
    color: var(--text);
}

input,
select,
textarea,
button {
    padding: 12px 14px;
    font-size: 14px;
    margin: 0;
    border-radius: 8px;
    border: 1px solid #d8d8d8;
    outline: none;
    max-width: 100%;
    font-family: Arial, sans-serif;
}

input,
select,
textarea {
    width: 100%;
    background: #fff;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(247, 90, 11, 0.12);
}

.actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

button,
.btn {
    cursor: pointer;
    background: var(--primary);
    color: var(--white);
    border: none;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 8px;
}

button:hover,
.btn:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #3f3f46;
}

.btn-secondary:hover {
    background: #27272a;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #b42318;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #15803d;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-mobile-cards {
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

th,
td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

th {
    background: var(--primary);
    color: var(--white);
}

tr:nth-child(even) {
    background: #fff8f3;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    background: #fff1e8;
    color: var(--primary);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 18px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card strong {
    display: block;
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.stat-card span {
    color: var(--text-soft);
    font-size: 14px;
}

.mobile-card-list {
    display: grid;
    gap: 12px;
}

.mobile-item {
    background: var(--white);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.mobile-item-row {
    margin-bottom: 8px;
}

.mobile-item-row:last-child {
    margin-bottom: 0;
}

.mobile-item-label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-soft);
    margin-bottom: 2px;
    text-transform: uppercase;
}

.mobile-item-value {
    font-size: 14px;
    color: var(--text);
    word-break: break-word;
}

@media (max-width: 992px) {
    .container {
        max-width: 100%;
        padding: 0 16px 25px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .topbar {
        margin-bottom: 15px;
    }

    .topbar-inner {
        padding: 15px 12px 18px;
    }

    .logo-link {
        margin-bottom: 14px;
    }

    .logo-matrix {
        width: 160px;
    }

    .menu-interno {
        gap: 8px;
    }

    .menu-interno a {
        font-size: 14px;
        padding: 9px 12px;
        flex: 1 1 calc(50% - 8px);
        min-width: 130px;
    }

    .container {
        margin: 20px auto;
        padding: 0 12px 25px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .box {
        padding: 16px;
        border-radius: 10px;
    }

    .grid,
    .form-grid,
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .card {
        padding: 16px;
        border-radius: 10px;
    }

    .card:hover {
        transform: none;
    }

    .table-desktop {
        display: none;
    }

    .table-mobile-cards {
        display: block;
    }

    .table-actions,
    .actions,
    .form-actions {
        flex-direction: column;
    }

    .table-actions .btn,
    .actions .btn,
    .form-actions .btn,
    .form-actions button,
    .actions button {
        width: 100%;
    }

    button,
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .topbar-inner {
        padding: 12px 10px 16px;
    }

    .logo-matrix {
        width: 140px;
    }

    .menu-interno {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .menu-interno a {
        width: 100%;
        min-width: 0;
        font-size: 13px;
        padding: 10px 12px;
    }

    .container {
        padding: 0 10px 20px;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    input,
    select,
    textarea,
    button,
    .btn {
        font-size: 16px;
    }
}