/* components.css — Cards, bento grid, botões, formulários, nav, flash, progresso */

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* App Header */
.app-header {
    background: var(--color-white);
    padding: 16px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-logo img {
    width: 110px;
    height: auto;
}

/* Pill Navigation */
.pill-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pill-nav a:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.pill-nav a.active {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Cards */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 24px 0;
}

.bento-grid .card-wide {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-grid .card-wide {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .bento-grid .card-wide {
        grid-column: 1 / 3;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    color: var(--color-white);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
}
.btn-success:hover {
    background: var(--color-success-hover);
    color: var(--color-white);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}
.btn-danger:hover {
    background: var(--color-danger-hover);
    color: var(--color-white);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.0625rem;
}

.btn-block {
    width: 100%;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--color-text);
    background: var(--color-white);
    transition: border-color 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--color-primary);
}

.form-control::placeholder {
    color: var(--color-text-secondary);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Flash Messages */
.flash {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 0.9375rem;
    font-weight: 500;
}

.flash-success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.flash-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--color-bg);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success), #5BD98A);
    border-radius: var(--radius-pill);
    transition: width 1s ease-out;
}

/* Stat Card */
.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
}

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

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

table th {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    font-size: 0.9375rem;
}

table tbody tr:hover {
    background: #F8FAFC;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #ECFDF5;
    color: #065F46;
}

.badge-danger {
    background: #FEF2F2;
    color: #991B1B;
}

.badge-primary {
    background: #FDECEA;
    color: #9B1018;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h2 {
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

/* Page Title */
.page-header {
    padding: 24px 0 0;
}

.page-header h1 {
    font-size: 1.75rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
}

.app-footer a {
    color: var(--color-text-secondary);
}

.app-footer a:hover {
    color: var(--color-primary);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.pagination a {
    background: var(--color-white);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.pagination a:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.pagination span.active {
    background: var(--color-primary);
    color: var(--color-white);
}
