﻿/* ============================================
   UNDERWRITING - BASE STYLES
   Toyota Professional Insurance Interface
   ============================================ */

/* Container & Layout */
.uw-dashboard-container {
    padding: 2rem;
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Dashboard Header */
.uw-dashboard-header {
    border-radius: 1rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.uw-dashboard-title h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.uw-dashboard-title p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0;
}

.uw-dashboard-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Search Container */
.search-container {
    position: relative;
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
}

.search-container input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 2.75rem;
    border: 2px solid;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

    .search-container input:focus {
        outline: none;
    }

.clear-search {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .clear-search:hover {
        transform: translateY(-50%) scale(1.1);
    }

/* Filter Container */
.filter-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-dropdown {
    position: relative;
}

.filter-selected {
    padding: 0.875rem 1.25rem;
    border: 2px solid;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .filter-selected:hover {
        transform: translateY(-1px);
    }

    .filter-selected i {
        font-size: 0.875rem;
        transition: transform 0.2s ease;
    }

.filter-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    border: 1px solid;
    border-radius: 0.5rem;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
}

.filter-option {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

    .filter-option:hover {
        transform: translateX(4px);
    }

    .filter-option.selected {
        font-weight: 600;
    }

/* Filter Switch */
.filter-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.3s;
    border-radius: 24px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.3s;
        border-radius: 50%;
    }

input:checked + .slider:before {
    transform: translateX(24px);
}

.switch-label {
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Refresh Button */
.uw-dashboard-refresh {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .uw-dashboard-refresh:hover {
        transform: translateY(-1px);
    }

/* Loading State */
.uw-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    border-radius: 0.75rem;
    gap: 1rem;
}

    .uw-loading i {
        font-size: 3rem;
    }

    .uw-loading span {
        font-size: 1.1rem;
    }

/* Tabs */
.uw-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid;
    overflow-x: auto;
}

.uw-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

    .uw-tab:hover {
        transform: translateY(-2px);
    }

    .uw-tab.active {
        border-bottom: 3px solid;
    }

    .uw-tab i {
        font-size: 1rem;
    }

/* Section */
.uw-section {
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid;
    margin-bottom: 2rem;
}

.uw-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.uw-section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .uw-section-title i {
        font-size: 1.5rem;
    }

    .uw-section-title h2 {
        font-size: 1.5rem;
        font-weight: 600;
        margin: 0;
    }

.uw-section-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    min-width: 100px;
}

    .stat-badge span:first-child {
        font-size: 1.5rem;
        font-weight: 700;
    }

    .stat-badge span:last-child {
        font-size: 0.8rem;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: flex-end;
}

.view-toggle-btn {
    width: 40px;
    height: 40px;
    border: 2px solid;
    border-radius: 0.5rem;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .view-toggle-btn:hover {
        transform: translateY(-2px);
    }

    .view-toggle-btn.active {
        font-weight: 600;
    }

/* Empty State */
.uw-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 0.75rem;
}

    .uw-empty-state i {
        font-size: 4rem;
        margin-bottom: 1.5rem;
    }

    .uw-empty-state p {
        font-size: 1.1rem;
    }

/* Table View */
.uw-table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
    margin-top: 1.5rem;
}

.uw-table {
    width: 100%;
    border-collapse: collapse;
}

    .uw-table thead tr {
        border-bottom: 2px solid;
    }

    .uw-table th {
        padding: 1rem 1.5rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .uw-table tbody tr {
        border-bottom: 1px solid;
        transition: all 0.2s ease;
    }

    .uw-table td {
        padding: 1.25rem 1.5rem;
        vertical-align: middle;
    }

/* Table Content Styling */
.quote-number {
    display: flex;
    align-items: center;
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.client-info,
.user-info,
.company-info,
.broker-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.client-name,
.user-name,
.company-name,
.broker-name {
    font-weight: 500;
    font-size: 0.9375rem;
}

.user-email,
.broker-email {
    font-size: 0.8125rem;
}

.broker-consultant {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.date-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

    .date-info .date {
        font-weight: 500;
        font-size: 0.9375rem;
    }

    .date-info .time,
    .date-info .days-ago {
        font-size: 0.8125rem;
    }

/* Product Tags */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.product-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

    .product-tag i {
        font-size: 0.875rem;
    }

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Action Buttons */
.uw-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.uw-action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .uw-action-btn:hover {
        transform: translateY(-1px);
    }

    .uw-action-btn i {
        font-size: 0.875rem;
    }

/* VAPS Info */
.vaps-info {
    font-size: 0.875rem;
}

.vaps-policy {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.vaps-date {
    font-size: 0.8125rem;
}

.vaps-pending,
.vaps-na {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Card View */
.uw-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.uw-card {
    border: 1px solid;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

    .uw-card:hover {
        transform: translateY(-4px);
    }

.uw-card-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid;
}

.uw-card-body {
    padding: 1.5rem;
}

.uw-card-section {
    margin-bottom: 1.25rem;
}

    .uw-card-section:last-child {
        margin-bottom: 0;
    }

    .uw-card-section h4 {
        font-size: 0.875rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.5rem;
    }

    .uw-card-section p {
        margin: 0.25rem 0;
    }

    .uw-card-section .muted-text {
        font-size: 0.875rem;
    }

.uw-card-footer {
    padding: 1.5rem;
    border-top: 1px solid;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-visible {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
    max-width: 600px;
    width: 90%;
    margin: 1rem;
}

.modal-sm {
    max-width: 400px;
}

.modal-content {
    border-radius: 1rem;
    overflow: hidden;
    animation: dialogSlideIn 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.btn-close {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .btn-close::before {
        content: "×";
        font-size: 1.5rem;
    }

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

.form-select,
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

    .form-select:focus,
    .form-control:focus {
        outline: none;
    }

.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .btn:hover {
        transform: translateY(-1px);
    }

/* Progress Bar */
.progress {
    width: 100%;
    height: 30px;
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    font-size: 0.875rem;
    font-weight: 600;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    from {
        background-position: 1rem 0;
    }

    to {
        background-position: 0 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .uw-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 1024px) {
    .uw-dashboard-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        max-width: none;
    }

    .filter-container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .uw-dashboard-container {
        padding: 1rem;
    }

    .uw-dashboard-header {
        padding: 2rem 1.5rem;
    }

    .uw-dashboard-title h1 {
        font-size: 2rem;
    }

    .uw-section {
        padding: 1.5rem;
    }

    .uw-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .uw-cards-container {
        grid-template-columns: 1fr;
    }

    .uw-action-btn span {
        display: none;
    }

    .uw-action-btn {
        padding: 0.625rem;
        width: 2.5rem;
        height: 2.5rem;
        justify-content: center;
    }

    .uw-card-footer .uw-action-btn span {
        display: inline;
    }

    .uw-card-footer .uw-action-btn {
        width: auto;
        padding: 0.625rem 1rem;
    }
}

@media (max-width: 480px) {
    .uw-dashboard-title h1 {
        font-size: 1.75rem;
    }

    .uw-tabs {
        gap: 0.25rem;
    }

    .uw-tab {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .stat-badge {
        min-width: 80px;
        padding: 0.625rem 1rem;
    }

        .stat-badge span:first-child {
            font-size: 1.25rem;
        }
}

.text-muted {
    opacity: 0.7;
}

.text-primary {
    font-weight: 600;
}

.me-2 {
    margin-right: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.text-center {
    text-align: center;
}
