/**
 * Label Requests Styles
 * Admin dashboard for label onboarding system
 */

/* =============================================================================
   Page Header
   ============================================================================= */

.page-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border, #1f1f1f);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary, #e5e5e5);
    margin: 0;
}

.label-name {
    font-size: 0.875rem;
    color: var(--text-secondary, #808080);
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
}

.header-right {
    display: flex;
    gap: 0.75rem;
}

.refresh-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border, #1f1f1f);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #808080);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition, all 0.2s ease);
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover, #2a2a2a);
    color: var(--text-primary, #e5e5e5);
}

.refresh-btn.loading {
    animation: spin 0.8s linear infinite;
}

.refresh-btn svg {
    width: 18px;
    height: 18px;
}

/* =============================================================================
   Sidebar Footer
   ============================================================================= */

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #1f1f1f);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name-small {
    font-size: 0.8rem;
    color: var(--text-primary, #e5e5e5);
    font-weight: 500;
}

.logout-btn-small {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border, #1f1f1f);
    border-radius: 6px;
    color: var(--text-secondary, #808080);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
}

.logout-btn-small:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover, #2a2a2a);
    color: var(--text-primary, #e5e5e5);
}

/* =============================================================================
   Auth Components
   ============================================================================= */

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--accent, #8B4513);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.auth-note {
    font-size: 0.75rem;
    color: var(--text-muted, #4a4a4a);
    margin-top: 1rem;
}

#google-signin-btn {
    margin: 1.5rem 0;
}

/* =============================================================================
   Filter Tabs
   ============================================================================= */

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border, #1f1f1f);
    padding-bottom: 0;
}

.filter-tab {
    position: relative;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary, #808080);
    font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tab:hover {
    color: var(--text-primary, #e5e5e5);
    background: rgba(255, 255, 255, 0.03);
}

.filter-tab.active {
    color: var(--accent, #8B4513);
    border-bottom-color: var(--accent, #8B4513);
}

.tab-badge {
    background: var(--accent, #8B4513);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* =============================================================================
   Status Badges
   ============================================================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
}

.status-badge.pending {
    background: rgba(128, 128, 128, 0.15);
    color: #808080;
}

.status-badge.reviewing {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-badge.contract_sent {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.status-badge.signed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge.completed {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge.expired {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

/* =============================================================================
   Deal Type Badge
   ============================================================================= */

.deal-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(139, 69, 19, 0.15);
    color: var(--accent, #8B4513);
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
}

.text-muted {
    color: var(--text-muted, #4a4a4a);
    font-size: 0.875rem;
    font-style: italic;
}

/* =============================================================================
   Action Buttons (styled for dark theme)
   ============================================================================= */

.action-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border, #1f1f1f);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
    background: transparent;
    color: var(--text-secondary, #808080);
    font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover, #2a2a2a);
    color: var(--text-primary, #e5e5e5);
}

.action-btn.primary {
    background: var(--accent, #8B4513);
    border-color: var(--accent, #8B4513);
    color: white;
}

.action-btn.primary:hover {
    background: var(--accent-hover, #A0522D);
    border-color: var(--accent-hover, #A0522D);
}

.action-btn.secondary {
    border-color: var(--border, #1f1f1f);
    color: var(--text-secondary, #808080);
}

.action-btn.secondary:hover {
    border-color: var(--border-hover, #2a2a2a);
    background: rgba(255, 255, 255, 0.03);
}

.action-btn.view {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.action-btn.save {
    background: var(--success, #2d5a3d);
    border-color: var(--success, #2d5a3d);
    color: white;
}

.action-btn.save:hover {
    background: #3a7450;
    border-color: #3a7450;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================================================
   Modal Overlay
   ============================================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: var(--bg-card, #121212);
    border: 1px solid var(--border, #1f1f1f);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary, #e5e5e5);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary, #808080);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition, all 0.2s ease);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #e5e5e5);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* =============================================================================
   Detail Sections
   ============================================================================= */

.detail-section {
    margin-bottom: 2rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #4a4a4a);
    margin: 0 0 1rem 0;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.detail-item label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-label, #666666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-item span {
    font-size: 0.875rem;
    color: var(--text-primary, #e5e5e5);
    line-height: 1.5;
}

/* Full width for address and message */
.detail-item:has(label:contains("Address")),
.detail-item:has(label:contains("Message")) {
    grid-column: 1 / -1;
}

/* =============================================================================
   Notes Textarea
   ============================================================================= */

.notes-textarea {
    width: 100%;
    min-height: 100px;
    background: var(--bg-input, #0d0d0d);
    border: 1px solid var(--border, #1f1f1f);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--text-primary, #e5e5e5);
    font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
    font-size: 0.875rem;
    resize: vertical;
    transition: var(--transition, all 0.2s ease);
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--accent, #8B4513);
}

.notes-textarea::placeholder {
    color: var(--text-muted, #4a4a4a);
}

/* =============================================================================
   Modal Actions
   ============================================================================= */

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border, #1f1f1f);
}

.action-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* =============================================================================
   Navigation Badge
   ============================================================================= */

.nav-badge {
    background: var(--accent, #8B4513);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
}

/* =============================================================================
   Loading/Error States
   ============================================================================= */

.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-state p,
.error-state p {
    color: var(--text-secondary, #808080);
    margin-top: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border, #1f1f1f);
    border-top-color: var(--accent, #8B4513);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.retry-btn {
    margin-top: 1rem;
    padding: 0.625rem 1.25rem;
    background: var(--accent, #8B4513);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
}

.retry-btn:hover {
    background: var(--accent-hover, #A0522D);
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 768px) {
    .filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .filter-tab {
        white-space: nowrap;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-group {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}

/* =============================================================================
   Contract Actions Grid (NEW)
   ============================================================================= */

.contract-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.contract-actions-grid .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.contract-actions-grid .action-btn svg {
    flex-shrink: 0;
}

/* =============================================================================
   Large Modal (for Customize)
   ============================================================================= */

.modal-large {
    max-width: 900px;
}

.modal-info {
    color: var(--text-secondary, #808080);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid var(--accent, #8B4513);
}

/* =============================================================================
   Customize Form
   ============================================================================= */

.customize-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-label, #666666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    background: var(--bg-input, #0d0d0d);
    border: 1px solid var(--border, #1f1f1f);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--text-primary, #e5e5e5);
    font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
    font-size: 0.875rem;
    transition: var(--transition, all 0.2s ease);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent, #8B4513);
}

.form-input::placeholder {
    color: var(--text-muted, #4a4a4a);
}

/* =============================================================================
   Role Select (fix for dropdown)
   ============================================================================= */

.role-select {
    background: var(--bg-input, #0d0d0d);
    border: 1px solid var(--border, #1f1f1f);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--text-primary, #e5e5e5);
    font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
    font-size: 0.875rem;
    width: 100%;
    max-width: 400px;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
}

.role-select:focus {
    outline: none;
    border-color: var(--accent, #8B4513);
}

.role-select option {
    background: #1a1a1a;
    color: #e5e5e5;
    padding: 0.5rem;
}

/* =============================================================================
   Contract Actions Grid (NEW)
   ============================================================================= */

.contract-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.contract-actions-grid .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.contract-actions-grid .action-btn svg {
    flex-shrink: 0;
}

/* =============================================================================
   Large Modal (for Customize)
   ============================================================================= */

.modal-large {
    max-width: 900px;
}

.modal-info {
    color: var(--text-secondary, #808080);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid var(--accent, #8B4513);
}

/* =============================================================================
   Customize Form
   ============================================================================= */

.customize-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-label, #666666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    background: var(--bg-input, #0d0d0d);
    border: 1px solid var(--border, #1f1f1f);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--text-primary, #e5e5e5);
    font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
    font-size: 0.875rem;
    transition: var(--transition, all 0.2s ease);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent, #8B4513);
}

.form-input::placeholder {
    color: var(--text-muted, #4a4a4a);
}
