* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0f1420;
    color: #fff;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #171d2b;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid #2d3548;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #2d3548;
}

.brand-icon {
    font-size: 26px;
}

.sidebar-brand h1 {
    font-size: 16px;
}

.sidebar-brand span {
    font-size: 12px;
    color: #9aa5c0;
}

.sidebar-nav {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: #c9d3ea;
    text-decoration: none;
    transition: 0.2s;
}

.sidebar-link:hover {
    background: #222b3f;
    color: #fff;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #2d3548;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.user-avatar {
    font-size: 22px;
}

.user-box span {
    font-size: 12px;
    color: #9aa5c0;
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #2d3548;
    text-decoration: none;
    color: #fff;
}

.logout-link:hover {
    background: #3b4560;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #171d2b;
    padding: 16px 24px;
    border-bottom: 1px solid #2d3548;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-label {
    font-size: 12px;
    color: #9aa5c0;
}

.topbar h2 {
    font-size: 20px;
}

.topbar-action,
.btn-primary {
    background: #d4a017;
    color: #111;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.topbar-action:hover,
.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #2d3548;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
}

.btn-secondary:hover {
    background: #3b4560;
}

.content-area {
    padding: 24px;
}

.dashboard {
    text-align: center;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.card {
    background: #171d2b;
    padding: 20px;
    border-radius: 14px;
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

.card h2 {
    font-size: 28px;
    color: #d4a017;
}

.form-card {
    background: #171d2b;
    padding: 24px;
    border-radius: 16px;
    max-width: 900px;
}

form input,
form textarea,
form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid #2d3548;
    background: #0f1420;
    color: #fff;
}

form button {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: #d4a017;
    color: #111;
    font-weight: bold;
    cursor: pointer;
}

.api-search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.api-search-box input {
    flex: 1;
}

.api-search-box button {
    width: auto;
}

.card-preview {
    text-align: center;
    margin-bottom: 18px;
}

.card-preview img {
    max-width: 220px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.45);
}

.alert-error {
    background: #4b1f1f;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.alert-success {
    background: #1f4b35;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.alert-info {
    background: #1e3557;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header p {
    color: #9aa5c0;
}

.page-actions {
    display: flex;
    gap: 10px;
}

.panel {
    background: #171d2b;
    padding: 20px;
    border-radius: 14px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px;
    color: #9aa5c0;
    font-size: 13px;
    border-bottom: 1px solid #2d3548;
}

.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #2d3548;
}

.card-name-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
}

.card-thumb {
    width: 64px;
    height: 92px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0,0,0,.45);
    background: #0f1420;
}

.card-placeholder {
    width: 64px;
    height: 92px;
    background: #2d3548;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 24px;
}

.card-name-cell strong {
    display: block;
    font-size: 15px;
}

.card-name-cell small {
    display: block;
    margin-top: 4px;
    color: #9aa5c0;
}

.stock-badge {
    background: #d4a017;
    color: #111;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: bold;
}

.stock-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stock-form input {
    width: 70px;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #2d3548;
    background: #0f1420;
    color: #fff;
    text-align: center;
    margin-bottom: 0;
}

.stock-form button {
    width: auto;
    background: #d4a017;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}

/* FILTROS */
.filters-card {
    background: #171d2b;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid #2d3548;
}

.filters-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto auto;
    gap: 10px;
    align-items: center;
}

.filters-form input,
.filters-form select {
    margin-bottom: 0;
}

.filters-form button {
    width: auto;
}

/* PAGINAÇÃO */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border-radius: 8px;
    background: #2d3548;
    color: #fff;
    text-decoration: none;
}

.pagination a:hover {
    background: #3b4560;
}

.pagination .active {
    background: #d4a017;
    color: #111;
    font-weight: bold;
}

.results-info {
    color: #9aa5c0;
    margin-bottom: 14px;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state p {
    color: #9aa5c0;
    margin: 10px 0 20px;
}