/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--btn-radius);
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

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

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

.btn-danger-outline {
    background-color: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

/* --- Cards --- */
.card {
    background-color: var(--bg-surface);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
    border: 1px solid #f1f5f9;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* KPI Stats Card */
.stat-card {
    display: flex;
    flex-direction: column;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.stat-icon.bg-teal-light {
    background: #e0f2f1;
    color: var(--primary-color);
}

.stat-icon.bg-gold-light {
    background: #fff8e1;
    color: var(--accent-color);
}

.stat-icon.bg-blue-light {
    background: #e3f2fd;
    color: var(--info);
}

.stat-icon.bg-green-light {
    background: #d1fae5;
    color: var(--success);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.stat-trend {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

/* --- Forms & Inputs --- */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--input-radius);
    font-family: inherit;
    font-size: 0.875rem;
    transition: 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(9, 58, 67, 0.1);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    appearance: none;
    padding-right: 2.5rem;
}

/* --- Tables --- */
.table-container {
    overflow-x: auto;
}

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

.custom-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.custom-table tr:hover {
    background-color: #fcfcfc;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e2e8f0;
}

/* --- Badges --- */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

/* --- Action Icons --- */
.actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border-radius: var(--card-radius);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background-color: #f8fafc;
    border-bottom-left-radius: var(--card-radius);
    border-bottom-right-radius: var(--card-radius);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
    gap: 0.5rem;
}

.page-item {
    display: inline-block;
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.85rem;
    margin-left: -1px;
    line-height: 1.25;
    color: var(--text-secondary);
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px !important;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.page-link:hover {
    z-index: 2;
    color: var(--primary-color);
    text-decoration: none;
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.page-item.disabled .page-link {
    color: #cbd5e1;
    pointer-events: none;
    cursor: auto;
    background-color: #fff;
    border-color: #e2e8f0;
}

.pagination-container {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
}