/* ============================================================
   Fiscal Consulting - Shared Component Styles
   ============================================================ */

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: var(--white);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--navy-800);
    color: var(--white);
}

.data-table th {
    padding: 14px 16px;
    font-weight: 600;
    text-align: left;
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--navy-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-dark {
    background: var(--gray-200);
    color: var(--gray-500);
    text-decoration: line-through;
}

.badge-gold {
    background: var(--gold-100);
    color: var(--gold-600);
}

/* --- Cards --- */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* --- Stat Cards --- */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-card .stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-card .stat-icon.gold { background: var(--gold-100); color: var(--gold-600); }
.stat-card .stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-card .stat-icon.navy { background: var(--navy-100); color: var(--navy-700); }

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--navy-800);
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: 0.825rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    transition: var(--transition-fast);
}

.pagination a:hover {
    background: var(--navy-700);
    color: var(--white);
    border-color: var(--navy-700);
}

.pagination .active {
    background: var(--navy-700);
    color: var(--white);
    border-color: var(--navy-700);
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 0.925rem;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--navy-700);
}

.tab-btn.active {
    color: var(--navy-800);
    border-bottom-color: var(--gold-500);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.2s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-500);
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.925rem;
    margin-bottom: 20px;
}

/* --- Action Buttons (table rows) --- */
.actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--navy-700);
    color: var(--white);
    border-color: var(--navy-700);
}

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

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

/* --- Search & Filters Bar --- */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.85rem;
}

.filter-select {
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--gray-700);
    background: var(--white);
    outline: none;
    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='%236b7280' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-select:focus {
    border-color: var(--gold-500);
}

/* --- Dropdown --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    min-width: 180px;
    padding: 6px;
    z-index: 100;
    display: none;
}

.dropdown-menu.show {
    display: block;
    animation: modalIn 0.15s ease;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    font-size: 0.875rem;
    color: var(--gray-700);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    transition: var(--transition-fast);
    text-align: left;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--gray-50);
    color: var(--navy-800);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}

/* --- Alerts --- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(5,150,105,0.2); }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(220,38,38,0.2); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid rgba(37,99,235,0.2); }

/* --- Loading Spinner --- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--gold-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- File Upload Zone --- */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gray-50);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--gold-500);
    background: var(--gold-100);
}

.upload-zone i {
    font-size: 2.5rem;
    color: var(--gray-400);
    margin-bottom: 12px;
}

.upload-zone p {
    color: var(--gray-500);
    font-size: 0.925rem;
}

.upload-zone .upload-link {
    color: var(--gold-600);
    font-weight: 600;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 0.85rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-gold { color: var(--gold-600); }
.text-navy { color: var(--navy-800); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Print */
@media print {
    .no-print { display: none !important; }
}
