/* Assessment Page - Compliance Tracker Style */

/* ====================================
   Layout: Sidebar + Main Content
   ==================================== */
.assessment-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 60px);
}

.assessment-sidebar {
    width: 280px;
    background: #fafafa;
    border-right: 1px solid #e5e5e5;
    padding: 24px;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    flex-shrink: 0;
}

.assessment-main {
    flex: 1;
    padding: 24px 32px;
    background: #fff;
    overflow-y: auto;
}

/* ====================================
   Header Bar
   ==================================== */
.assessment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e5e5;
}

.assessment-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.assessment-title .highlight {
    color: #c9a227;
    font-weight: 500;
}

.assessment-progress-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.assessment-progress-bar .progress-track {
    width: 120px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.assessment-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c9a227, #d4af37);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.btn-export {
    background: #c9a227;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-export:hover {
    background: #b8922a;
}

/* ====================================
   Sidebar Stats
   ==================================== */
.sidebar-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-box {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-box .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.stat-box .stat-value.compliant {
    color: #22c55e;
}

.stat-box .stat-value.non-compliant {
    color: #ef4444;
}

.stat-box .stat-value.partial {
    color: #f59e0b;
}

.stat-box .stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* ====================================
   Sidebar Filters
   ==================================== */
.filters-section {
    margin-top: 24px;
}

.filters-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    font-weight: 600;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.filter-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
}

.filter-input:focus {
    outline: none;
    border-color: #c9a227;
}

.filter-input::placeholder {
    color: #aaa;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:focus {
    outline: none;
    border-color: #c9a227;
}

.btn-clear-filters {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

.btn-clear-filters:hover {
    background: #fef2f2;
}

.items-count {
    margin-top: 24px;
    font-size: 13px;
    color: #666;
}

.items-count strong {
    color: #1a1a1a;
}

/* ====================================
   Principle Groups (Accordion)
   ==================================== */
.principle-group {
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
}

.principle-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.principle-group-header:hover {
    background: #fafafa;
}

.principle-group-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.principle-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 6px;
    color: #888;
    font-size: 14px;
}

.principle-group-title {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
}

.principle-group-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.principle-progress-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.principle-progress-badge.complete {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.principle-progress-badge.not-started {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #e9ecef;
}

.principle-expand-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: transform 0.2s;
}

.principle-group.expanded .principle-expand-icon {
    transform: rotate(180deg);
}

.principle-group-content {
    display: none;
    border-top: 1px solid #e5e5e5;
}

.principle-group.expanded .principle-group-content {
    display: block;
}

/* ====================================
   Practice Items
   ==================================== */
.practice-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    cursor: pointer;
}

.practice-item:last-child {
    border-bottom: none;
}

.practice-item:hover {
    background: #fafafa;
}

.practice-item.expanded {
    background: #f5f5f5;
}

.practice-item-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.practice-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    flex-shrink: 0;
}

.practice-content {
    flex: 1;
}

.practice-title {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.4;
}

.practice-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.practice-tag {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.practice-tag.section {
    background: #f0f0f0;
    color: #555;
}

.practice-tag.frequency {
    background: #e3f2fd;
    color: #1565c0;
}

.practice-tag.disclosure {
    background: #fff3e0;
    color: #e65100;
}

.practice-tag.fines {
    background: #ffebee;
    color: #c62828;
    display: flex;
    align-items: center;
    gap: 4px;
}

.practice-tag.fines::before {
    content: '⚠';
    font-size: 10px;
}

.practice-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ====================================
   Status Dropdown
   ==================================== */
.status-dropdown {
    position: relative;
}

.status-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
    justify-content: space-between;
}

.status-button:hover {
    border-color: #ccc;
}

.status-button.not-reviewed,
.status-button.not_started {
    color: #888;
}

.status-button.applied {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.status-button.partially_applied,
.status-button.partial {
    background: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.status-button.not_applied {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.status-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 200px;
    display: none;
}

.status-dropdown.open .status-dropdown-menu {
    display: block;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.status-option:first-child {
    border-radius: 8px 8px 0 0;
}

.status-option:last-child {
    border-radius: 0 0 8px 8px;
}

.status-option:hover {
    background: #f5f5f5;
}

.status-option.selected {
    background: #f0f7ff;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.applied {
    background: #22c55e;
}

.status-dot.partial,
.status-dot.partially_applied {
    background: #f59e0b;
}

.status-dot.not_applied {
    background: #ef4444;
}

.status-dot.not_started,
.status-dot.not-reviewed {
    background: #d1d5db;
}

/* ====================================
   Practice Expanded Detail
   ==================================== */
.practice-detail {
    display: none;
    padding: 20px 24px 20px 68px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.practice-detail.visible {
    display: block;
}

.practice-detail-section {
    margin-bottom: 20px;
}

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

.practice-detail-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.practice-recommendation {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.comment-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    background: #fff;
}

.comment-textarea:focus {
    outline: none;
    border-color: #c9a227;
}

.evidence-upload-area {
    border: 2px dashed #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.evidence-upload-area:hover {
    border-color: #c9a227;
    background: #fffbf0;
}

.evidence-upload-area input[type="file"] {
    display: none;
}

.evidence-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.evidence-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 13px;
}

.evidence-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.evidence-file-icon {
    color: #888;
}

.evidence-file-name {
    color: #333;
}

.evidence-file-size {
    color: #888;
    font-size: 12px;
}

.evidence-file-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.btn-icon-sm.danger:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* ====================================
   Sync Indicator
   ==================================== */
.sync-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
}

.sync-badge.saving {
    color: #c9a227;
}

.sync-badge.saved {
    color: #22c55e;
}

.sync-badge.error {
    color: #ef4444;
}

/* ====================================
   Empty State
   ==================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
}

/* ====================================
   Loading
   ==================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5e5;
    border-top-color: #c9a227;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ====================================
   Responsive
   ==================================== */
@media (max-width: 1024px) {
    .assessment-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .assessment-layout {
        flex-direction: column;
    }
    
    .assessment-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
    
    .assessment-main {
        padding: 16px;
    }
    
    .assessment-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px 0;
    }
    
    .practice-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .practice-item-right {
        width: 100%;
        justify-content: flex-end;
    }
    
    .status-button {
        width: 100%;
    }
    
    .sidebar-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
