/* Premium Light Theme Only - Kappy Team Workspace UI Design System */

:root {
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-secondary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --sidebar-bg: #ffffff;
    --sidebar-text: #475569;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--bg-body) !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Layout Grid */
.wrapper {
    display: flex;
    width: 100%;
    max-width: 100vw;
    align-items: stretch;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Fixed Non-Scrolling Light Sidebar */
#sidebar.sidebar-light {
    width: 270px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

@media (min-width: 992px) {
    #sidebar.sidebar-light {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
    }

    #content {
        margin-left: 270px;
        width: calc(100% - 270px);
    }
}

/* Custom Subtle Scrollbar for Sidebar */
#sidebar::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

#sidebar::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#sidebar::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-logo {
    width: 2.25rem;
    height: 2.25rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 1.15rem;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.brand-tag {
    font-size: 0.625rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: 0.1em;
}

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

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0.75rem 1.5rem 0.35rem 1.5rem;
    text-transform: uppercase;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
}

.nav-menu li {
    margin: 0.15rem 0.75rem;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu li a i {
    font-size: 1.15rem;
    width: 1.25rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.nav-menu li a:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    transform: translateX(3px);
}

.nav-menu li a:hover i {
    transform: scale(1.15);
}

/* Active State Styling */
.nav-menu li.active a {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-menu li.active a i {
    color: #ffffff !important;
}

/* Color-Coded Category Icons */
.icon-blue { color: #2563eb; }
.icon-indigo { color: #4f46e5; }
.icon-amber { color: #d97706; }
.icon-green { color: #16a34a; }
.icon-emerald { color: #059669; }
.icon-cyan { color: #0891b2; }
.icon-purple { color: #9333ea; }
.icon-rose { color: #e11d48; }
.icon-violet { color: #7c3aed; }
.icon-orange { color: #ea580c; }
.icon-teal { color: #0d9488; }
.icon-pink { color: #db2777; }
.icon-slate { color: #64748b; }

/* Main Content Area - Uniform Box Sizing & No Horizontal Overflow */
#content {
    flex: 1;
    min-width: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.main-navbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.85rem 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    width: 100%;
}

.main-body {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
}

/* Dashboard Hero Welcome Card */
.dashboard-hero-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1e293b 100%);
    color: #ffffff;
    border-radius: 1.25rem;
    padding: 1.85rem;
    box-shadow: 0 15px 30px -10px rgba(15, 23, 42, 0.3);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.dashboard-hero-card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: 20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* System Status Operational Badge (Fixed High Contrast) */
.badge-status-operational {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border: 1px solid rgba(52, 211, 153, 0.35) !important;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 50rem;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #34d399;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: #34d399;
    border-radius: 50%;
    animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(2.2);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* Quick Action launcher buttons */
.quick-action-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.quick-action-btn:hover {
    background: #ffffff;
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.quick-action-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* User Avatar Initial Bubble */
.user-avatar-initial {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cards & Surface Components */
.card {
    background-color: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Table Responsive Handling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Word Wrapping for Long Texts */
.text-break-word {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Kanban Board Columns */
.kanban-board {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    width: 100%;
}

.kanban-col {
    min-width: 280px;
    max-width: 320px;
    flex: 1;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

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

.kanban-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: grab;
    box-shadow: var(--card-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kanban-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

/* Secret Mask Code */
.secret-mask {
    font-family: Consolas, Monaco, monospace;
    letter-spacing: 2px;
    color: #64748b;
}

/* Code Snippet Pre Block */
pre.code-block {
    background: #0f172a;
    color: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    max-height: 350px;
    overflow: auto;
    font-family: "Fira Code", Consolas, Monaco, monospace;
    font-size: 0.875rem;
    border: 1px solid #1e293b;
}

/* Mobile Offcanvas Adjustments */
@media (max-width: 991.98px) {
    #sidebar.sidebar-light {
        margin-left: -270px;
        position: fixed;
        top: 0;
        bottom: 0;
    }
    #sidebar.sidebar-light.active {
        margin-left: 0;
    }
    #content {
        margin-left: 0;
        width: 100%;
    }
    .main-body {
        padding: 1rem;
    }
}
