/* WebSmitherz CRM Core Stylesheet */
/* Design Tokens & Theme Variables */
:root {
    --bg-black: #000000;
    --primary-purple: #7C3AED;
    --primary-purple-hover: #6D28D9;
    --primary-purple-glow: rgba(124, 58, 237, 0.15);
    --white: #FFFFFF;
    --gray-text: #BABABA;
    --border-glass: rgba(255, 255, 255, 0.08);
    --bg-glass-card: rgba(255, 255, 255, 0.02);
    --bg-glass-card-hover: rgba(255, 255, 255, 0.04);
    --accent-green: #61CE70;
    --accent-red: #EF4444;
    --accent-yellow: #F59E0B;
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* Base Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-black);
    color: var(--white);
    font-family: 'Manrope', sans-serif;
    min-height: 100vh;
    position: relative;
}

/* Background Gradients */
body::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary-purple);
    border-radius: 50%;
    filter: blur(200px);
    opacity: 0.12;
    top: 5%;
    left: 5%;
    z-index: -1;
}

body::after {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    background: var(--accent-green);
    border-radius: 50%;
    filter: blur(220px);
    opacity: 0.08;
    bottom: 5%;
    right: 5%;
    z-index: -1;
}

/* Layout Framework */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-brand h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -1px;
}

.sidebar-brand h2 span {
    color: var(--primary-purple);
}

.sidebar-user {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-purple);
    font-size: 1.2rem;
    margin-right: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-size: 0.95rem;
    font-weight: 600;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--gray-text);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--gray-text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.sidebar-nav a i {
    width: 20px;
    margin-right: 12px;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.sidebar-nav a:hover {
    color: var(--white);
    background: var(--bg-glass-card-hover);
}

.sidebar-nav a:hover i {
    transform: scale(1.1);
}

.sidebar-nav a.active {
    color: var(--white);
    background: var(--primary-purple);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.sidebar-nav a.active i {
    color: var(--white);
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.3);
    margin: 20px 0 10px 16px;
    font-weight: 600;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--accent-red) !important;
}

/* Main Content Area */
.app-main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* Top Navbar */
.top-navbar {
    height: var(--header-height);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-trigger {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    color: var(--gray-text);
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 280px;
    transition: all 0.3s ease;
}

.search-trigger:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.search-trigger i {
    margin-right: 10px;
}

.search-trigger kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.75rem;
    margin-left: auto;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notifications-bell {
    position: relative;
    font-size: 1.25rem;
    color: var(--gray-text);
    cursor: pointer;
    transition: color 0.3s ease;
}

.notifications-bell:hover {
    color: var(--white);
}

.notifications-bell .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Wrapper */
.content-wrapper {
    padding: 32px;
    flex: 1;
    overflow-x: auto;
    min-width: 0;
}

/* Glass Card Component */
.glass-card {
    background: var(--bg-glass-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--bg-glass-card-hover);
}

/* Headings */
h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 2rem;
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-purple);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-purple-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Command Palette Overlay */
.command-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding-top: 15vh;
}

.command-palette-box {
    width: 100%;
    max-width: 600px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    height: fit-content;
}

.command-palette-input-wrapper {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.command-palette-input-wrapper i {
    color: var(--gray-text);
    margin-right: 12px;
    font-size: 1.1rem;
}

.command-palette-input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
}

.command-palette-input-wrapper input:focus {
    outline: none;
}

.command-palette-input-wrapper kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.75rem;
    color: var(--gray-text);
}

.command-palette-results {
    max-height: 350px;
    overflow-y: auto;
    padding: 12px;
}

.results-section {
    margin-bottom: 15px;
}

.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-text);
    padding: 6px 12px;
    font-weight: 600;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.result-item i {
    width: 24px;
    color: var(--gray-text);
    font-size: 0.95rem;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Responsive Rules */
@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main-content {
        margin-left: 0;
    }
}
