/* ==========================================
   Krimando Dashboard - Custom Styles
   ========================================== */

:root {
    --sidebar-bg: #2B2F36;
    --content-bg: #F5F6F8;
    --sidebar-width: 80px;
    --topbar-height: 56px;
    --white-opacity-80: rgba(255, 255, 255, 0.8);
    --white-opacity-08: rgba(255, 255, 255, 0.08);
}

/* ==========================================
   Base Layout
   ========================================== */

body {
    background-color: var(--content-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.875rem;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   Sidebar Styles
   ========================================== */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    padding-top: var(--topbar-height);
    transition: all 0.3s ease;
}

.sidebar .nav {
    padding: 1rem 0;
}

.sidebar-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.25rem !important;
    color: var(--white-opacity-80) !important;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0.125rem 0.25rem;
    position: relative;
    width: calc(100% - 0.5rem);
    box-sizing: border-box;
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

.sidebar-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #007bff;
    border-radius: 0 2px 2px 0;
}

.sidebar-icon {
    font-size: 1.125rem;
    margin-bottom: 0.125rem;
}

.sidebar-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    opacity: 0.9;
}

/* Sidebar bottom section (Settings) */
.sidebar-bottom {
    margin-top: auto;
    padding: 0.5rem 0 1rem 0;
    border-top: 1px solid var(--white-opacity-08);
}

/* Mobile Sidebar */
.sidebar-mobile {
    background-color: var(--sidebar-bg);
}

.sidebar-item-mobile {
    display: flex !important;
    align-items: center;
    padding: 0.75rem 1rem !important;
    color: var(--white-opacity-80) !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-item-mobile:hover,
.sidebar-item-mobile.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

/* ==========================================
   Topbar Styles
   ========================================== */

.topbar {
    height: var(--topbar-height);
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    border-bottom: 1px solid var(--white-opacity-08);
}

.sidebar-toggle {
    border: none !important;
    background: none !important;
}

.sidebar-toggle:focus {
    box-shadow: none !important;
}

.topbar-info {
    font-size: 0.875rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ==========================================
   Main Content Area
   ========================================== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
}

.content-area {
    padding: 1rem;
}

/* Compact content sizing */
.content-area h1,
.content-area .h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.content-area h2,
.content-area .h2 {
    font-size: 1.25rem;
}

.content-area h3,
.content-area .h3 {
    font-size: 1.125rem;
}

.content-area h4,
.content-area .h4 {
    font-size: 1rem;
}

.content-area h5,
.content-area .h5 {
    font-size: 0.875rem;
}

.content-area h6,
.content-area .h6 {
    font-size: 0.75rem;
}

/* Mobile Layout */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
    }
    
    .sidebar {
        display: none !important;
    }
}

/* ==========================================
   Card Styles
   ========================================== */

.card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px 8px 0 0 !important;
    padding: 0.75rem 1rem;
}

.card-body {
    padding: 1rem;
}

/* ==========================================
   KPI Cards
   ========================================== */

.kpi-card {
    border-left: 4px solid #007bff;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Stats Cards */
.stats-card .stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stats-change {
    margin-top: 0.25rem;
}

/* ==========================================
   Activity & Process Styles
   ========================================== */

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.process-step {
    margin-bottom: 1rem;
}

.step-icon {
    width: 50px;
    height: 50px;
}

/* ==========================================
   Platform Cards
   ========================================== */

.platform-card {
    border: 1px solid #dee2e6;
}

.platform-status .badge {
    font-size: 0.75rem;
}

.platform-sync {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 0.75rem;
}

/* ==========================================
   Chart Placeholders
   ========================================== */

.chart-placeholder,
.chart-placeholder-small {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 2px dashed #dee2e6;
    min-height: 300px;
}

.chart-placeholder-small {
    min-height: 200px;
}

.chart-overlay {
    text-align: center;
    z-index: 2;
}

.chart-placeholder canvas,
.chart-placeholder-small canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Legend */
.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.platform-legend {
    font-size: 0.875rem;
}

/* ==========================================
   Table Enhancements
   ========================================== */

.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.5rem;
}

.table td {
    font-size: 0.8125rem;
    padding: 0.5rem;
}

.table td:not(:first-child) {
    vertical-align: middle;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Table hover removed for clean design */

/* ==========================================
   Avatar Placeholders
   ========================================== */

.avatar-placeholder {
    font-weight: 600;
    font-size: 0.875rem;
}

/* ==========================================
   Badge Enhancements
   ========================================== */

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.375em 0.75em;
}

/* ==========================================
   Button Enhancements
   ========================================== */

.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn:focus {
    box-shadow: none;
}

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

/* ==========================================
   Form Enhancements
   ========================================== */

.form-control:focus {
    border-color: #80bdff;
    box-shadow: none;
}

.input-group .btn {
    border-radius: 0 6px 6px 0;
}

.input-group .form-control {
    border-radius: 6px 0 0 6px;
}

/* ==========================================
   Progress Bars
   ========================================== */

.progress {
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.05);
}

.progress-bar {
    border-radius: 4px;
}

/* ==========================================
   Accessibility & Focus States
   ========================================== */

.sidebar-item:focus,
.sidebar-item-mobile:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 767.98px) {
    .content-area {
        padding: 0.75rem;
    }
    
    .topbar-info .status-item {
        font-size: 0.75rem;
    }
    
    .kpi-card .card-body {
        padding: 0.75rem;
    }
    
    .stats-card .card-body {
        padding: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .content-area {
        padding: 0.5rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    h1.h3 {
        font-size: 1.25rem;
    }
}

/* ==========================================
   Dark Mode Support (Future)
   ========================================== */

@media (prefers-color-scheme: dark) {
    /* Prepared for future dark mode implementation */
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    .sidebar,
    .topbar,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* ==========================================
   Animation Classes
   ========================================== */

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Utility Classes
   ========================================== */

.text-white-50 {
    color: var(--white-opacity-80) !important;
}

.border-left-primary {
    border-left: 4px solid #007bff !important;
}

.border-left-success {
    border-left: 4px solid #28a745 !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

.border-left-danger {
    border-left: 4px solid #dc3545 !important;
}
