/**
 * BK Mag Service Management - Robust & Compact UI
 * Modern Design System (HSL based)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Color Palette - Industrial Dark */
    --h: 145; /* Base Hue (Bike Green) */
    --primary: hsl(var(--h), 65%, 45%); /* Vibrant Green for accents */
    --primary-soft: rgba(16, 185, 129, 0.1);
    --primary-dark: hsl(var(--h), 65%, 35%);
    
    --secondary: #0f172a; /* Slate 900 - Sidebar & Deepest layers */
    --accent: hsl(35, 92%, 45%); 
    
    --success: #10b981; /* Emerald 500 */
    --danger: #ef4444; /* Red 500 */
    --warning: #f59e0b; /* Amber 500 */
    --info: #3b82f6; /* Blue 500 */

    /* Neutrals - DARK THEME */
    --bg-main: #0f172a;   /* Slate 900 - Main Background */
    --card-bg: #1e293b;   /* Slate 800 - Elevated Cards */
    --text-main: #f8fafc; /* Slate 50 - High Contrast Text */
    --text-muted: #cbd5e1; /* Slate 300 - Brighter Muted Text for better visibility */
    --border-color: #334155; /* Slate 700 - Defined Borders */

    /* Effects - Industrial Precision */
    --radius-sm: 4px;   
    --radius-md: 6px;
    --radius-lg: 10px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.4; /* Tighter leading */
    overflow-x: hidden;
    font-size: 0.875rem; /* Slightly smaller base font */
}

h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.015em;
    font-weight: 700;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { 
    background: #94a3b8; 
    border-radius: 10px; 
}
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - More Compact */
.sidebar {
    width: 240px; /* Slimmer */
    background: var(--secondary);
    color: #fff;
    padding: 1.5rem 1rem; /* Reduced padding */
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    border-right: 1px solid #1e293b;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem; /* Smaller */
    font-weight: 900;
    margin-bottom: 2rem;
    color: #fff;
}

.logo i {
    color: var(--primary);
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.3));
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.4rem; /* Tighter gaps */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.65rem 1rem; /* More compact */
    border-radius: var(--radius-sm); /* Tighter corners */
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.85rem; /* Smaller */
    transition: var(--transition);
}

.nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Main Content Area - Reduced Spacing */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 1.5rem 2.5rem; /* More compact */
    max-width: 1600px;
}

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

.header-info h1 {
    font-size: 1.85rem; /* Smaller */
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.text-muted {
    color: var(--text-muted);
}

/* UI Elements - Robust Look */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-sm); 
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--border-color); /* Robust indicator */
}

.stat-icon {
    width: 48px; /* Smaller */
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
}

.stat-info h3 {
    font-size: 0.75rem; /* Smaller */
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-info .value {
    font-size: 1.5rem; /* Smaller */
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

/* Buttons - Tighter */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    font-size: 0.75rem; /* Smaller */
    letter-spacing: 0.05em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

/* Form Controls - Denser */
.form-control {
    background: rgba(15, 23, 42, 0.6) !important; 
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    color: var(--text-main) !important;
    backdrop-filter: blur(4px);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    outline: none;
}

/* Kanban Board Refinement */
.kanban-board-preview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.kanban-column {
    background: rgba(0, 0, 0, 0.2); /* Integrated dark columns */
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    border: 1px solid var(--border-color);
}

.column-header {
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--primary);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.kanban-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    transition: var(--transition);
    color: var(--text-main);
}

.kanban-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

/* Status Badges */
.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Footer Section in Sidebar */
.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Responsive Overrides */
@media (max-width: 1400px) {
    .kanban-board-preview { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .sidebar { width: 72px; padding: 1.5rem 0.75rem; }
    .main-content { margin-left: 72px; padding: 1.5rem; }
    .logo span, .nav-link span { display: none; }
    .logo { justify-content: center; margin-bottom: 1.5rem; }
    .nav-link { justify-content: center; padding: 0.8rem; }
}

/* Utility classes */
.text-xs { font-size: 0.7rem; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
