/* Admin Dashboard Styles */

/* Layout */
.admin-container {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
}

.admin-sidebar {
    width: 250px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.admin-logo {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.5rem;
}

.admin-nav {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex: 1;
}

.admin-nav li {
    margin: 4px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: #4361ee;
    color: white;
}

.nav-icon {
    font-size: 1.1rem;
}

.admin-sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.back-to-site {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-to-site:hover {
    color: white;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-user {
    color: #666;
}

.logout-btn {
    color: #c00;
    text-decoration: none;
    font-size: 0.9rem;
}

.admin-content {
    padding: 32px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background: #e8f0fe; }
.stat-icon.green { background: #e6f4ea; }
.stat-icon.orange { background: #fef3e8; }
.stat-icon.purple { background: #f3e8fe; }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
}

.view-all {
    color: #4361ee;
    text-decoration: none;
    font-size: 0.9rem;
}

.card-body {
    padding: 24px;
}

.card-body.no-padding {
    padding: 0;
}

/* Dashboard Layout */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8f9fa;
    color: #666;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table.full-width {
    width: 100%;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.started {
    background: #fff3cd;
    color: #856404;
}

.status-badge.abandoned {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.default {
    background: #e9ecef;
    color: #495057;
}

/* Lead Badges */
.lead-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.lead-badge.sent {
    background: #4361ee;
    color: white;
}

.lead-badge.pending {
    background: #e9ecef;
    color: #999;
}

.carrier-count {
    display: block;
    color: #666;
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Breakdown Stats */
.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.breakdown-label {
    width: 100px;
    font-size: 0.9rem;
    color: #666;
}

.breakdown-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #4361ee;
    border-radius: 4px;
    transition: width 0.3s;
}

.breakdown-value {
    width: 40px;
    text-align: right;
    font-weight: 600;
    color: #333;
}

/* Coverage Stats */
.coverage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.coverage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.coverage-name {
    font-size: 0.9rem;
    color: #333;
}

.coverage-count {
    font-weight: 700;
    color: #4361ee;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Quotes Page */
.quotes-page {
    max-width: 100%;
}

.filters-bar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    min-width: 150px;
}

.filter-group.search input {
    min-width: 250px;
}

.btn-refresh {
    padding: 10px 16px;
    background: #4361ee;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-refresh:hover {
    background: #3651d4;
}

.results-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* Quote Details */
.id-col {
    font-family: monospace;
    font-size: 0.8rem;
    color: #666;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-info small {
    color: #666;
    font-size: 0.8rem;
}

.muted {
    color: #bbb;
}

.coverage-count {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.btn-icon {
    background: none;
    border: 1px solid #ddd;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-icon:hover {
    background: #f0f0f0;
}

/* Detail Row */
.detail-row td {
    background: #f8f9fa;
    padding: 0 !important;
}

.quote-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 24px;
}

.detail-section h4 {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    margin: 0;
}

.detail-section dt {
    color: #999;
    font-size: 0.85rem;
}

.detail-section dd {
    margin: 0;
    color: #333;
    font-size: 0.9rem;
}

.coverage-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.coverage-tag {
    background: #4361ee;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button:hover:not(:disabled) {
    background: #f0f0f0;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-row {
        grid-template-columns: 1fr;
    }

    .coverage-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 60px;
    }

    .logo-text, .nav-text {
        display: none;
    }

    .admin-main {
        margin-left: 60px;
    }

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

    .quote-details {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select,
    .filter-group input,
    .filter-group.search input {
        min-width: auto;
        width: 100%;
    }
}

/* Slice 21: Enhanced Admin Polish */

/* Smoother transitions */
.stat-card,
.card,
.nav-item,
button,
.btn-refresh,
.btn-icon {
    transition: all 0.2s ease;
}

/* Card hover effects */
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Better table row hover */
.data-table tbody tr {
    transition: background-color 0.15s ease;
}

/* Improved button styles */
.btn-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3651d4 100%);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 10px 20px;
    border-radius: 8px;
    color: #666;
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

/* Success/error states for stat cards */
.stat-card.success .stat-value {
    color: #38a169;
}

.stat-card.error .stat-value {
    color: #e53e3e;
}

.stat-card.warning .stat-value {
    color: #d69e2e;
}

/* Animated progress bars */
.bar-fill {
    animation: fillBar 0.6s ease-out;
}

@keyframes fillBar {
    from { width: 0; }
}

/* Loading shimmer for cards */
.card.loading {
    position: relative;
    overflow: hidden;
}

.card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}

/* Better scrollbar for admin */
.admin-content::-webkit-scrollbar {
    width: 8px;
}

.admin-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.admin-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.admin-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Notification dot for nav items */
.nav-item .notification-dot {
    width: 8px;
    height: 8px;
    background: #e53e3e;
    border-radius: 50%;
    margin-left: auto;
}

/* Quick action buttons */
.quick-actions {
    display: flex;
    gap: 8px;
}

.quick-action-btn {
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.quick-action-btn:hover {
    background: #f8f9fa;
}

/* Trend indicators */
.trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.trend.up {
    color: #38a169;
}

.trend.down {
    color: #e53e3e;
}

.trend.neutral {
    color: #718096;
}
