/* ========================================
   CompliTalk Healthcare Compliance System
   Main Stylesheet
   ======================================== */

/* ========================================
   CSS VARIABLES & ROOT STYLES
   ======================================== */
:root {
    /* Primary Brand Colors */
    --primary-orange: #FF5F33;
    --primary-orange-hover: #E64A19;
    --primary-orange-light: rgba(255, 95, 51, 0.08);
    
    /* Neutral Palette */
    --deep-grey: #1E293B;
    --body-grey: #334155;
    --silver-grey: #E2E8F0;
    --slate-100: #F1F5F9;
    --slate-50: #F8FAFC;
    --white: #FFFFFF;
    
    /* Semantic Colors */
    --success-green: #10B981;
    --success-light: #D1FAE5;
    --danger-red: #EF4444;
    --danger-light: #FEE2E2;
    --warning-amber: #F59E0B;
    --warning-light: #FEF3C7;
    --info-blue: #3B82F6;
    --info-light: #DBEAFE;
    
    /* Border Colors */
    --border-color: #E2E8F0;
    --border-color-dark: #CBD5E1;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    color: var(--body-grey);
    background-color: var(--slate-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--deep-grey);
    font-weight: 800;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    transition: all 0.2s ease;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ========================================
   LAYOUT STRUCTURE
   ======================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */
.sidebar {
    width: 16rem;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 20;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-title-group h1 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--deep-grey);
    line-height: 1.2;
}

.sidebar-title-group p {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 0 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-lg);
    color: #94A3B8;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--slate-50);
    color: var(--body-grey);
}

.nav-item.active {
    background: var(--primary-orange-light);
    color: var(--primary-orange);
    font-weight: 600;
    border-right: 4px solid var(--primary-orange);
}

.nav-item .material-symbols-outlined {
    font-size: 1.25rem;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0.75rem;
}

.sidebar-footer {
    padding: 1rem;
    margin-top: auto;
}

.btn-new-upload {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary-orange);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(255, 95, 51, 0.2);
}

.btn-new-upload:hover {
    background: var(--primary-orange-hover);
    transform: translateY(-1px);
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.main-content {
    flex: 1;
    margin-left: 16rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   TOP HEADER
   ======================================== */
.top-header {
    height: 4rem;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-search-section {
    flex: 1;
    max-width: 28rem;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper .material-symbols-outlined {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 1.25rem;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.5rem 0.5rem 2.5rem;
    background: var(--slate-50);
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--body-grey);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 95, 51, 0.1);
}

.search-input::placeholder {
    color: #94A3B8;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    border-radius: var(--radius-lg);
    position: relative;
    transition: all 0.2s ease;
}

.header-icon-btn:hover {
    background: var(--slate-50);
    color: var(--primary-orange);
}

.notification-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.625rem;
    width: 0.625rem;
    height: 0.625rem;
    background: var(--primary-orange);
    border: 2px solid var(--white);
    border-radius: 50%;
}

.header-divider {
    width: 1px;
    height: 2rem;
    background: var(--border-color);
}

.user-profile-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.5rem;
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--deep-grey);
    line-height: 1.2;
}

.user-role {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--slate-100);
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}

/* ========================================
   PAGE CONTENT WRAPPER
   ======================================== */
.page-content {
    padding: 2rem;
    flex: 1;
}

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.page-title-group h2 {
    font-size: 1.875rem;
    font-weight: 900;
    color: var(--deep-grey);
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
}

.page-title-group p {
    color: #94A3B8;
    font-size: 0.875rem;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-padding {
    padding: 1.5rem;
}

.kpi-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
}

.kpi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 900;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.kpi-icon {
    color: var(--primary-orange);
    font-size: 1.5rem;
}

.kpi-value {
    font-size: 1.875rem;
    font-weight: 900;
    color: var(--deep-grey);
    margin-bottom: 0.5rem;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--success-green);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-left: 0.75rem;
}

.kpi-change .material-symbols-outlined {
    font-size: 0.875rem;
}

.kpi-sublabel {
    font-size: 0.75rem;
    color: #94A3B8;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

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

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

@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   TABLES
   ======================================== */
.table-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--deep-grey);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--slate-50);
}

.data-table thead tr {
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 900;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.5);
}

.data-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--body-grey);
}

.data-table td.font-bold {
    font-weight: 700;
    color: var(--deep-grey);
}

/* ========================================
   STATUS BADGES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-primary {
    background: rgba(255, 95, 51, 0.1);
    color: var(--primary-orange);
    border: 1px solid rgba(255, 95, 51, 0.2);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-orange);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(255, 95, 51, 0.2);
}

.btn-primary:hover {
    background: var(--primary-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 95, 51, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--body-grey);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--slate-50);
}

.btn-outline {
    background: transparent;
    color: var(--primary-orange);
    border: 1px solid var(--primary-orange);
}

.btn-outline:hover {
    background: var(--primary-orange);
    color: var(--white);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn .material-symbols-outlined {
    font-size: 1.25rem;
}

/* ========================================
   MATERIAL SYMBOLS ICON DEFAULTS
   ======================================== */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }

.uppercase { text-transform: uppercase; }

.text-primary { color: var(--primary-orange); }
.text-success { color: var(--success-green); }
.text-danger { color: var(--danger-red); }
.text-warning { color: var(--warning-amber); }
.text-secondary { color: #94A3B8; }
.text-grey { color: var(--body-grey); }
.text-deep { color: var(--deep-grey); }
