/* ===== SITE VISITS COMMON STYLES ===== */

/* ===== BASE VARIABLES ===== */
:root {
    /* Adopt CSMS palette and typography */
    --primary-color: #4d1bb8; /* CSMS primary */
    --secondary-color: #6b7280; /* CSMS secondary gray */
    --success-color: #198754;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --light-color: #f8fafc;
    --dark-color: #111827;
    --sidebar-width: 64px;
    --sidebar-expanded-width: 240px;
    --header-height: 64px;
    --border-radius: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
    --sidebar-bg: rgb(6, 10, 17); /* CSMS dark sidebar */
    --header-bg: #ffffff;
    --page-bg: #f8fafc; /* CSMS background */
    --content-bg: #f8fafc;
    --text-primary: #111827; /* CSMS header/title */
    --text-secondary: #6b7280; /* CSMS muted */
    --text-muted: #9ca3af;
}

/* ===== BASE RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* CSMS font stack */
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--page-bg);
    color: #334155; /* CSMS body text */
    overflow-x: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

/* ===== HOVER-BASED SIDEBAR STYLES ===== */
.sidebar {
    transition: all 0.3s ease;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    width: 60px !important;
}

.sidebar:hover {
    width: 250px !important;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 16px 8px;
    margin: 2px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    justify-content: center;
    min-height: 48px;
}

.sidebar:hover .sidebar-nav-item {
    justify-content: flex-start;
    padding: 16px 16px;
}

.sidebar-nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-nav-item:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
    text-decoration: none;
}

.sidebar-nav-item.active {
    background-color: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.sidebar-nav-item .nav-text {
    margin-left: 12px;
    font-weight: 500;
    transition: opacity 0.3s ease;
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar:hover .sidebar-nav-item .nav-text {
    opacity: 1;
    width: auto;
}

.sidebar #sidebarTitle {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar:hover #sidebarTitle {
    opacity: 1;
}

.sidebar #sidebarFooter {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar:hover #sidebarFooter {
    opacity: 1;
}

/* ===== MODERN SIDEBAR COMPONENT ===== */
.sidebar-component {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
    width: var(--sidebar-width);
    z-index: 1001;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.1);
}

.sidebar-component:hover {
    width: var(--sidebar-expanded-width);
}

.sidebar-header {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand {
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0;
    margin: 0;
    border-radius: 0;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    min-height: 44px;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.sidebar-component:hover .nav-item {
    justify-content: flex-start;
    padding: 0.875rem 0.75rem;
    width: 100%;
    min-width: 200px;
}

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

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

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 18px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-text {
    margin-left: 0.75rem;
    font-weight: 400;
    font-size: 0.875rem;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: var(--transition);
    margin-top: 0;
    margin-bottom: 0;
    margin-right: 0;
    white-space: nowrap;
}

.sidebar-component:hover .nav-text {
    opacity: 1;
    width: auto;
}

.sidebar-footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-version {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0;
    transition: var(--transition);
}

.sidebar-component:hover .sidebar-version {
    opacity: 1;
}

/* ===== TABLE STYLES ===== */
.ticket-id {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    min-width: 1200px;
    table-layout: auto;
}

.table th,
.table td {
    white-space: nowrap;
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

/* Professional table row colors */
.table tbody tr.table-light {
    background-color: rgba(248, 249, 250, 0.8) !important;
}

.table tbody tr.table-warning-subtle {
    background-color: rgba(255, 193, 7, 0.25) !important;
}

.table tbody tr.table-info-subtle {
    background-color: rgba(13, 202, 240, 0.25) !important;
}

.table tbody tr.table-danger-subtle {
    background-color: rgba(220, 53, 69, 0.25) !important;
}

.table tbody tr.table-success-subtle {
    background-color: rgba(25, 135, 84, 0.25) !important;
}

.table tbody tr.table-secondary-subtle {
    background-color: rgba(108, 117, 125, 0.25) !important;
}

/* Hover effects for professional look */
.table tbody tr:hover {
    opacity: 0.8 !important;
    transform: none;
}

.table tbody tr.table-warning-subtle:hover {
    background-color: rgba(255, 193, 7, 0.35) !important;
}

.table tbody tr.table-info-subtle:hover {
    background-color: rgba(13, 202, 240, 0.35) !important;
}

.table tbody tr.table-danger-subtle:hover {
    background-color: rgba(220, 53, 69, 0.35) !important;
}

.table tbody tr.table-success-subtle:hover {
    background-color: rgba(25, 135, 84, 0.35) !important;
}

.table tbody tr.table-secondary-subtle:hover {
    background-color: rgba(108, 117, 125, 0.35) !important;
}

.table tbody tr.table-light:hover {
    background-color: rgba(248, 249, 250, 1) !important;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

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

.status-checked-in { 
    background: #d1ecf1; 
    color: #0c5460; 
}

.status-assessment-done { 
    background: #f8d7da; 
    color: #721c24; 
}

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

/* ===== KPI CARDS ===== */
.row.g-3 {
    display: flex;
    flex-wrap: wrap;
}

.row.g-3 > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.card.h-100 {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

/* ===== UTILITY CLASSES ===== */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #5a67d8;
    border-color: #5a67d8;
}

.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
    
    .sidebar-component {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .sidebar-component.mobile-open {
        transform: translateX(0);
    }
}
