* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f6f8;
    color: #1f2937;
}

a {
    color: #2563eb;
    text-decoration: none;
}

.topbar {
    min-height: 60px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111827;
    color: #fff;
}

.topbar a {
    color: #fff;
    margin-left: 18px;
}

.topbar-company {
    color: #9ca3af;
}

.topbar-user {
    display: flex;
    align-items: center;
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 35px auto;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.auth-card {
    max-width: 460px;
    margin: 60px auto;
}

h1, h2 {
    margin-top: 0;
}

label {
    display: block;
    font-weight: 600;
    margin: 16px 0 7px;
}

input, select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 15px;
    background: #fff;
    font-family: inherit;
}

button, .button-link, .button-secondary, .button-small, .button-support {
    display: inline-block;
    border: 0;
    border-radius: 7px;
    padding: 10px 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

button, .button-link, .button-small, .button-support {
    background: #2563eb;
    color: #fff;
}

button {
    margin-top: 20px;
    width: 100%;
}

.button-secondary {
    background: #e5e7eb;
    color: #374151;
}

.button-small {
    padding: 7px 11px;
    font-size: 13px;
}

.button-support {
    background: #7c3aed;
}

.muted {
    color: #6b7280;
}

.center {
    text-align: center;
}

.alert {
    padding: 12px;
    border-radius: 7px;
    margin: 15px 0;
}

.error {
    background: #fee2e2;
    color: #991b1b;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat span {
    display: block;
    color: #6b7280;
    margin-bottom: 8px;
}

.stat strong {
    font-size: 30px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-form {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-actions button {
    width: auto;
    margin-top: 0;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.data-table th {
    font-size: 13px;
    color: #6b7280;
}

.data-table small {
    display: block;
    margin-top: 3px;
    color: #6b7280;
}

.empty {
    text-align: center !important;
    color: #6b7280;
    padding: 30px !important;
}

.status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #e5e7eb;
}

.status-ativa { background: #dcfce7; color: #166534; }
.status-cancelada { background: #e5e7eb; color: #374151; }
.status-trial { background: #fef3c7; color: #92400e; }
.status-bloqueada { background: #fee2e2; color: #991b1b; }

.support-banner {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    padding: 15px 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.support-banner span {
    display: block;
    color: #6b7280;
    margin-top: 3px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.details-grid span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 5px;
}

.details-grid strong {
    overflow-wrap: anywhere;
}

.timeline-item {
    border-left: 3px solid #e5e7eb;
    padding: 4px 0 14px 15px;
    margin-left: 4px;
}

.timeline-item strong,
.timeline-item span,
.timeline-item small {
    display: block;
}

.timeline-item span {
    margin-top: 4px;
}

.timeline-item small {
    margin-top: 5px;
    color: #6b7280;
}

.support-mode-bar {
    min-height: 50px;
    padding: 10px 20px;
    background: #7c3aed;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.support-mode-bar a {
    color: #fff;
    text-decoration: underline;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.checkbox-label input {
    width: auto;
}

@media (max-width: 800px) {
    .grid, .details-grid, .form-grid, .form-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .page-header, .support-banner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .grid, .details-grid, .form-grid, .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-company {
        display: none;
    }

    .support-mode-bar {
        flex-wrap: wrap;
    }
}
