/* LoanPlanner Inbox Styles - Phase 120 */

:root {
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-border: #e2e8f0;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-pending: #94a3b8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.app-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.app-subtitle {
    font-size: 18px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* Usage Banner */
.usage-banner {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.usage-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.usage-info {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.usage-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.usage-bar-container {
    flex: 1;
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.usage-bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.usage-bar.warning {
    background: var(--color-warning);
}

.usage-bar.danger {
    background: var(--color-error);
}

.usage-percent {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    min-width: 50px;
    text-align: right;
}

/* Filters */
.filters-section {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 200px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input::placeholder {
    color: var(--color-text-secondary);
}

.status-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.status-select {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    min-width: 140px;
}

.status-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Leads Section */
.leads-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
    min-height: 300px;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--color-text-secondary);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: var(--color-error);
}

.error-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-error);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.retry-btn {
    margin-top: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.retry-btn:hover {
    background: var(--color-primary-dark);
}

/* Empty State */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
    font-size: 16px;
}

/* Leads Table */
.leads-table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table th,
.leads-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.leads-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--color-bg);
}

.leads-table tbody tr {
    transition: background-color 0.15s ease;
}

.leads-table tbody tr:hover {
    background-color: var(--color-bg);
}

.leads-table tbody tr:last-child td {
    border-bottom: none;
}

/* Client Name */
.client-name {
    font-weight: 500;
    color: var(--color-text);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.new {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.contacted {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.qualified {
    background: #dcfce7;
    color: #166534;
}

.status-badge.closed_won {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.closed_lost {
    background: #fee2e2;
    color: #991b1b;
}

/* Score */
.hot-score {
    font-weight: 600;
    color: var(--color-text);
}

.hot-score.high {
    color: var(--color-error);
}

.hot-score.medium {
    color: var(--color-warning);
}

/* Call Status Indicator */
.call-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.done {
    background: var(--color-success);
}

.status-dot.pending {
    background: var(--color-pending);
}

.status-dot.running {
    background: var(--color-warning);
}

.status-dot.failed {
    background: var(--color-error);
}

.status-dot.none {
    background: var(--color-border);
}

/* Updated Time */
.updated-time {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Footer */
.app-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* Lead Detail Styles - Phase 130 */

/* Breadcrumb */
.breadcrumb-link {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: var(--color-text-secondary);
}

/* Detail Card */
.detail-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.profile-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-item-full {
    grid-column: 1 / -1;
}

.profile-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
}

/* Detail Table */
.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table th,
.detail-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.detail-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--color-bg);
}

.detail-table tbody tr:last-child td {
    border-bottom: none;
}

/* Empty State Small */
.empty-state-small {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* Info Message */
.info-message {
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* Analysis Section */
.analysis-section {
    margin-bottom: 24px;
}

.analysis-section:last-child {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.analysis-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
}

.analysis-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analysis-list li {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--color-text);
}

.analysis-list li.empty-item {
    color: var(--color-text-secondary);
    font-style: italic;
}

.analysis-list li.risk-item {
    background: #fef2f2;
    color: var(--color-error);
    font-weight: 500;
}

/* Eligibility */
.eligibility-tier {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.eligibility-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge.tier-green {
    background: #dcfce7;
    color: #166534;
}

.tier-badge.tier-yellow {
    background: #fef3c7;
    color: #92400e;
}

.tier-badge.tier-red {
    background: #fee2e2;
    color: #991b1b;
}

.tier-badge.tier-unknown {
    background: var(--color-border);
    color: var(--color-text-secondary);
}

.eligibility-reasons {
    margin-top: 16px;
}

/* Recommendations - Phase UI-LeadDetail-v2 Enhanced */
.product-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.control-select {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.control-select:hover {
    border-color: var(--color-primary);
}

.control-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.recommendation-card {
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s ease;
}

.recommendation-card:hover {
    box-shadow: var(--shadow-md);
}

.recommendation-card.top-3 {
    border: 2px solid #4CAF50;
    background: #f9fff9;
}

.recommendation-rank {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.recommendation-rank.top-3-badge {
    background: #4CAF50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.recommendation-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.recommendation-lender {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.recommendation-rate {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

/* Underwriter Pack - Phase UI-LeadDetail-v2 Enhanced */
.pack-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.copy-btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-feedback {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: #22c55e;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.copy-feedback::before {
    content: "✓";
    font-size: 16px;
    font-weight: bold;
}

.copy-feedback.error {
    background: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.copy-feedback.error::before {
    content: "✗";
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pack-text {
    padding: 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

/* Tasks - Phase 140 + UX-Core-Finish Enhanced */
.tasks-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.task-type-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-type-icon {
    font-size: 18px;
}

.task-type-label {
    font-weight: 500;
}

.task-created-time {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.task-status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.task-status-open {
    background: #dbeafe;
    color: #1e40af;
}

.task-status-done {
    background: #dcfce7;
    color: #166534;
}

.task-status-skipped {
    background: #f3f4f6;
    color: #6b7280;
}

.task-row-reminder {
    background: #fef9e6;
}

.task-row-reminder:hover {
    background: #fef3c7;
}

.task-action-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-right: 6px;
}

.task-btn-done {
    background: var(--color-success);
    color: white;
}

.task-btn-done:hover {
    background: #16a34a;
}

.task-btn-skip {
    background: var(--color-pending);
    color: white;
}

.task-btn-skip:hover {
    background: #64748b;
}

.task-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }

    .usage-content {
        flex-wrap: wrap;
    }

    .filters-section {
        flex-direction: column;
    }

    .search-container {
        min-width: 100%;
    }

    .leads-table {
        font-size: 14px;
    }

    .leads-table th,
    .leads-table td {
        padding: 10px 12px;
    }

    .detail-card {
        padding: 16px;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .recommendations-grid {
        grid-template-columns: 1fr;
    }
}

/* Improvement Scenarios - Phase 251 */
.scenario-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    background: #ffffff;
}

.scenario-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.scenario-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background-color: #dbeafe;
    color: #1e40af;
}

.scenario-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.scenario-description {
    margin: 0 0 16px 0;
    color: #6b7280;
    line-height: 1.5;
}

/* Reverse Advice Styling - Phase UI-LeadDetail-v2 Enhanced */
.reverse-advice {
    margin: 16px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
    border: 2px solid #ff9800;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15);
}

.reverse-advice-title {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: #e65100;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reverse-advice-title::before {
    content: "⚠️";
    font-size: 20px;
}

.reverse-advice-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #ff9800;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.reverse-advice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reverse-advice-item {
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ffcc80;
    transition: all 0.2s ease;
}

.reverse-advice-item:hover {
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.2);
    transform: translateX(2px);
}

.reverse-advice-item:last-child {
    margin-bottom: 0;
}

.reverse-advice-item .field-name {
    font-weight: 600;
    color: #e65100;
    min-width: 100px;
    font-size: 14px;
}

.reverse-advice-item .value-change {
    color: #37474f;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    flex: 1;
}

.reverse-advice-item .delta-value {
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
}

.reverse-advice-item .delta-value.delta-positive {
    background: #c8e6c9;
    color: #2e7d32;
}

.reverse-advice-item .delta-value.delta-negative {
    background: #ffcdd2;
    color: #c62828;
}

/* Target Values Box */
.reverse-advice-targets {
    margin: 16px 0;
    padding: 16px;
    background-color: #e0f2fe;
    border-left: 4px solid #0284c7;
    border-radius: 4px;
}

.target-values-box {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.target-item {
    padding: 6px 12px;
    background-color: #ffffff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    font-size: 14px;
    color: #0c4a6e;
    font-weight: 500;
}

/* Scenario Steps */
.scenario-steps {
    margin-top: 16px;
}

.steps-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.steps-list {
    margin: 0;
    padding-left: 24px;
    color: #6b7280;
}

.steps-list li {
    margin-bottom: 6px;
    line-height: 1.5;
}

/* Login Page Styles - Phase UI-Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--color-text-secondary);
}

.login-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.login-btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.login-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: var(--color-error);
    font-size: 14px;
}

.login-error .error-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-error);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.login-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 14px;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.login-note {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Logout Button */
.logout-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--color-error);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.logout-btn:hover {
    background: #dc2626;
}

/* Header with logout */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.user-info {
    font-size: 14px;
    color: var(--color-text-secondary);
}

@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .login-title {
        font-size: 24px;
    }
}

/* Admin Users Page Styles - Phase UI-AdminUsers v1.0 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.btn-secondary {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: inline-block;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-primary {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

/* Filters Section */
.filters-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.filters-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.filter-select,
.search-input {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-select:focus,
.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-group {
    flex: 1;
    max-width: 400px;
}

.search-input::placeholder {
    color: var(--color-text-secondary);
}

/* Admin Table */
.table-container {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: var(--color-bg);
}

.admin-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
}

.admin-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s ease;
}

.admin-table tbody tr:hover {
    background: var(--color-bg);
}

.admin-table tbody tr:last-child {
    border-bottom: none;
}

.admin-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--color-text);
}

.user-email {
    font-weight: 500;
    color: var(--color-text);
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: #dbeafe;
    color: #1e40af;
}

.role-agent {
    background: #f3e8ff;
    color: #6b21a8;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
}

.status-active {
    background: #dcfce7;
    color: #15803d;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.date-text {
    color: var(--color-text-secondary);
    font-size: 13px;
}

.toggle-active-btn {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.pagination-info {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 12px;
}

.pagination-controls .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading/Error/Empty States */
.loading-state,
.error-state,
.empty-state {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p,
.error-state p,
.empty-state p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 15px;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.error-state p {
    color: var(--color-error);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group,
    .search-group {
        max-width: 100%;
    }

    .admin-table {
        font-size: 13px;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 12px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .pagination {
        flex-direction: column;
        gap: 16px;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
}

/* Reminder Dashboard Styles - Phase UI-ReminderDashboard v1.0 */

/* Date Filters */
.date-filters-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.date-input {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.date-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.date-hint {
    margin-top: 12px;
}

.date-hint p {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Dashboard Sections */
.dashboard-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 20px 0;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.summary-card {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.1s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.card-success {
    border-color: var(--color-success);
}

.card-warning {
    border-color: var(--color-warning);
}

.card-default {
    border-color: var(--color-border);
}

.card-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
}

/* Metrics Table */
.metrics-table {
    width: 100%;
    border-collapse: collapse;
}

.metrics-table thead {
    background: var(--color-bg);
}

.metrics-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
}

.metrics-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s ease;
}

.metrics-table tbody tr:hover {
    background: var(--color-bg);
}

.metrics-table tbody tr:last-child {
    border-bottom: none;
}

.metrics-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--color-text);
}

.row-success {
    background: rgba(220, 252, 231, 0.3);
}

.row-warning {
    background: rgba(254, 243, 199, 0.3);
}

.action-label {
    font-weight: 500;
    color: var(--color-text);
}

.count-value {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 16px;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .date-filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .card-value {
        font-size: 28px;
    }

    .metrics-table {
        font-size: 13px;
    }

    .metrics-table th,
    .metrics-table td {
        padding: 10px 12px;
    }

    .dashboard-section {
        padding: 16px;
    }
}
