/* ============================================
   ADMIN COMPONENTS LIBRARY
   Ultra Professional DealDash-Inspired Design
   ============================================ */

/* ============================================
   PAGE LAYOUT
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-text);
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--admin-text-secondary);
    font-weight: 400;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ============================================
   CONTENT CARDS
   ============================================ */
.content-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    box-shadow: var(--admin-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--admin-surface);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--admin-text);
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

.card-body-no-padding {
    padding: 0;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: var(--admin-shadow);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-card:hover {
    box-shadow: var(--admin-shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-text);
    line-height: 1;
    font-family: 'Outfit', sans-serif;
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 600;
}

.stat-change.positive {
    color: var(--admin-success);
}

.stat-change.negative {
    color: var(--admin-danger);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--admin-accent);
    color: #000000;
}

.btn-primary:hover:not(:disabled) {
    background: var(--admin-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 210, 7, 0.3);
}

.btn-secondary {
    background: var(--admin-primary);
    color: #FFFFFF;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--admin-primary-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--admin-surface-hover);
}

.btn-danger {
    background: var(--admin-danger);
    color: #FFFFFF;
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ============================================
   DATA TABLE
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--admin-surface-hover);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
    border-bottom: 2px solid var(--admin-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--admin-border);
    color: var(--admin-text);
    font-size: 0.9rem;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background: var(--admin-surface-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-success {
    background: var(--admin-success-light);
    color: var(--admin-success);
}

.badge-warning {
    background: var(--admin-warning-light);
    color: var(--admin-warning);
}

.badge-danger {
    background: var(--admin-danger-light);
    color: var(--admin-danger);
}

.badge-info {
    background: var(--admin-info-light);
    color: var(--admin-info);
}

.badge-primary {
    background: var(--admin-primary-light);
    color: var(--admin-primary);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--admin-text);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--admin-text);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
}

.form-input::placeholder {
    color: var(--admin-text-muted);
}

.form-helper {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--admin-text-muted);
}

.form-error {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--admin-danger);
}

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    padding-left: 2.5rem;
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--admin-text-muted);
    pointer-events: none;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--admin-text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--admin-text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--admin-border);
    border-top-color: var(--admin-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(0, 0, 0, 0.8);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-muted {
    color: var(--admin-text-muted) !important;
}

.text-secondary {
    color: var(--admin-text-secondary) !important;
}

.text-primary {
    color: var(--admin-primary) !important;
}

.text-success {
    color: var(--admin-success) !important;
}

.text-danger {
    color: var(--admin-danger) !important;
}

.text-warning {
    color: var(--admin-warning) !important;
}

.font-bold {
    font-weight: 700 !important;
}

.font-semibold {
    font-weight: 600 !important;
}

.text-sm {
    font-size: 0.875rem !important;
}

.text-xs {
    font-size: 0.75rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.5rem !important;
}

.mb-2 {
    margin-bottom: 1rem !important;
}

.mb-3 {
    margin-bottom: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 2rem !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 0.5rem !important;
}

.mt-2 {
    margin-top: 1rem !important;
}

.mt-3 {
    margin-top: 1.5rem !important;
}

.mt-4 {
    margin-top: 2rem !important;
}

.flex {
    display: flex !important;
}

.items-center {
    align-items: center !important;
}

.justify-between {
    justify-content: space-between !important;
}

.gap-1 {
    gap: 0.5rem !important;
}

.gap-2 {
    gap: 1rem !important;
}

.gap-3 {
    gap: 1.5rem !important;
}