:root {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #0f172a;
    background: linear-gradient(135deg, #eef2ff, #eff6ff);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
}

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

.auth-layout, .page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.auth-card, .container {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 1040px;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.1);
    border: 1px solid #e2e8f0;
}

h1, h2, h3 {
    margin: 0 0 0.5rem 0;
}

.muted {
    color: #475569;
    margin-bottom: 1rem;
}

label {
    display: block;
    margin: 0.75rem 0 0.35rem;
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    background: #f8fafc;
}

textarea {
    min-height: 100px;
}

button,
.button {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #fff;
    padding: 0.9rem 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    width: 100%;
    margin-top: 1rem;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.3);
}

.tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.tab-button {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 12px;
    padding: 0.75rem;
    font-weight: 700;
}

.tab-button.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.tab-content.hidden {
    display: none;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin: 0.5rem 0;
    font-weight: 600;
}

.alert.success {
    background: #ecfdf3;
    color: #166534;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.top-bar .button {
    width: auto;
    margin-top: 0;
    box-shadow: none;
}
.top-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.item-list {
    width: 100%;
    border-collapse: collapse;
}

.item-list th,
.item-list td {
    padding: 0.65rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.item-list td.actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.item-list td.actions form {
    display: inline-block;
}

.card .button {
    width: auto;
    min-width: 180px;
    display: inline-flex;
    justify-content: center;
}
.icon-symbol {
    margin-right: 6px;
    display: inline-block;
}
.btn-label {
    display: inline;
}
.mobile-actions-row { display: none; }
.mobile-actions { display: none; gap: 0.35rem; justify-content: flex-start; align-items: center; }
.mobile-actions .button { width: auto; min-width: unset; }
.list-mobile { display: none; }
.list-desktop { display: block; }

/* classes utilitárias para responsivo */
.mobile-hide {
    /* padrão: visível; será escondido no media query */
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
        box-shadow: none;
        border: none;
    }
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .top-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    .top-actions .button {
        width: 100%;
    }
    .card {
        padding: 0.75rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .card .button {
        width: 100%;
        min-width: unset;
    }
    .item-list td.actions {
        flex-direction: column;
        align-items: stretch;
    }
    .item-list td.actions .button {
        width: 100%;
    }
    .mobile-hide {
        display: none !important;
    }
    .icon-btn::before {
        margin-right: 0;
    }
    .btn-label {
        display: none;
    }
    .mobile-actions {
        display: flex;
    }
    .mobile-hide {
        display: none !important;
    }
    .mobile-actions-row {
        display: table-row;
    }
    .btn-label {
        display: none;
    }
    .icon-symbol {
        margin-right: 0;
    }
    .list-desktop { display: none; }
    .list-mobile { display: grid; gap: 0.75rem; }
    .list-mobile .mobile-card {
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 0.75rem;
        background: #f8fafc;
        box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    }
    .list-mobile .mobile-card h4 {
        margin: 0 0 0.35rem 0;
    }
    .list-mobile .mobile-actions {
        display: flex;
    }
}

.tag {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.small {
    font-size: 0.9rem;
}

.secondary {
    background: #0ea5e9;
}

.danger {
    background: #dc2626;
}

.text-link {
    display: inline-block;
    margin-top: 0.8rem;
    font-weight: 700;
}

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.2rem;
    color: #0f172a;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #e0f2fe;
    color: #0ea5e9;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.progress {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

@media (max-width: 768px) {
    .item-list th:nth-child(4),
    .item-list td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 640px) {
    .auth-layout, .page {
        padding: 1rem;
    }
    .auth-card, .container {
        padding: 1.25rem;
        box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
    }
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .hero {
        grid-template-columns: 1fr;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .button,
    .top-bar .button {
        width: 100%;
        text-align: center;
    }
}
