/* CyberIT CRM Demo - Glass Theme */
:root {
    --bg-base: #0f1430;
    --bg-surface: rgba(20, 28, 58, 0.55);
    --bg-surface-hover: rgba(30, 40, 75, 0.7);
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-glass-strong: rgba(255, 255, 255, 0.2);
    --text-primary: #f3f5ff;
    --text-secondary: rgba(243, 245, 255, 0.7);
    --text-muted: rgba(243, 245, 255, 0.45);
    --accent: #6ad7ea;
    --accent-hover: #8be3f0;
    --gradient-primary: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
    --gradient-btn: linear-gradient(135deg, #6a5cff 0%, #22d3ee 100%);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 20px;
    --blur: blur(16px) saturate(160%);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --font: -apple-system, 'SF Pro Display', 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
    --sidebar-width: 220px;
    --navbar-height: 56px;
}

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

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* === MESH GRADIENT BACKGROUND === */
.mesh-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 60% at 10% 90%, rgba(99, 60, 200, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 60% 80% at 85% 20%, rgba(30, 64, 175, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(14, 165, 233, 0.15) 0%, transparent 60%),
        linear-gradient(160deg, #0a0e27 0%, #0f1a3a 40%, #0c1025 100%);
}

/* === LOGIN PAGE === */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Animated floating orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 12s ease-in-out infinite;
}
.orb:nth-child(1) {
    width: 300px; height: 300px;
    background: rgba(122, 92, 255, 0.4);
    top: 10%; left: 10%;
    animation-duration: 14s;
}
.orb:nth-child(2) {
    width: 400px; height: 400px;
    background: rgba(34, 211, 238, 0.3);
    bottom: 10%; right: 10%;
    animation-duration: 18s;
    animation-delay: -4s;
}
.orb:nth-child(3) {
    width: 250px; height: 250px;
    background: rgba(99, 102, 241, 0.35);
    top: 50%; left: 60%;
    animation-duration: 16s;
    animation-delay: -8s;
}
.orb:nth-child(4) {
    width: 200px; height: 200px;
    background: rgba(236, 72, 153, 0.25);
    bottom: 30%; left: 20%;
    animation-duration: 20s;
    animation-delay: -2s;
}
.orb:nth-child(5) {
    width: 350px; height: 350px;
    background: rgba(6, 182, 212, 0.2);
    top: 20%; right: 30%;
    animation-duration: 22s;
    animation-delay: -6s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(20px, 20px) scale(1.02); }
}

/* Glass particles */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: rise 10s linear infinite;
}
@keyframes rise {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.login-card {
    background: var(--bg-surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 400px;
    max-width: 90vw;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.1);
    z-index: 10;
    animation: fadeUp 0.6s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo img {
    height: 48px;
}

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}
.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(106, 215, 234, 0.15);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--gradient-btn);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 8px;
}
.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* === MAIN LAYOUT === */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--navbar-height) 1fr;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--bg-surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border-glass);
    z-index: 100;
}
.navbar-logo img {
    height: 32px;
}
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.navbar-search {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    width: 240px;
    outline: none;
}
.navbar-search::placeholder { color: var(--text-muted); }
.navbar-icon {
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}
.navbar-icon:hover { color: var(--accent); }
.navbar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: white;
}

/* Sidebar */
.sidebar {
    background: var(--bg-surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-right: 1px solid var(--border-glass);
    padding: 16px 0;
    overflow-y: auto;
}
.sidebar-section {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-top: 8px;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    border-radius: 0;
    text-decoration: none;
}
.sidebar-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.sidebar-item.active {
    background: rgba(106, 215, 234, 0.1);
    color: var(--accent);
    border-right: 3px solid var(--accent);
}
.sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

/* Content area */
.content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - var(--navbar-height));
}

/* === GLASS PANELS === */
.panel {
    background: var(--bg-surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.panel-badge {
    font-size: 12px;
    background: rgba(106, 215, 234, 0.15);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--bg-surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, border-color 0.2s;
}
.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-glass-strong);
}
.kpi-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}
.kpi-icon.blue { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.kpi-icon.cyan { background: rgba(34, 211, 238, 0.2); color: #22d3ee; }
.kpi-icon.green { background: rgba(52, 211, 153, 0.2); color: #34d399; }
.kpi-icon.purple { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.kpi-icon.amber { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.kpi-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}
.kpi-label {
    font-size: 13px;
    color: var(--text-secondary);
}
.kpi-change {
    font-size: 12px;
    margin-top: 8px;
}
.kpi-change.up { color: #34d399; }
.kpi-change.down { color: #f87171; }

/* === TABLE === */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
}
.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}
.data-table tr:hover td {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.data-table .link {
    color: var(--accent);
    cursor: pointer;
}
.data-table .link:hover {
    text-decoration: underline;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-new { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.badge-active { background: rgba(34, 211, 238, 0.2); color: #22d3ee; }
.badge-won { background: rgba(52, 211, 153, 0.2); color: #34d399; }
.badge-lost { background: rgba(248, 113, 113, 0.2); color: #f87171; }
.badge-pending { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.badge-prospect { background: rgba(168, 85, 247, 0.2); color: #a855f7; }

/* Charts */
.chart-container {
    position: relative;
    height: 280px;
}

/* Activity stream */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: white;
    flex-shrink: 0;
}
.activity-content {
    flex: 1;
}
.activity-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.activity-text strong { color: var(--text-primary); }
.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.page-title {
    font-size: 22px;
    font-weight: 600;
}
.btn-action {
    padding: 8px 16px;
    background: var(--gradient-btn);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
}
.btn-action:hover { opacity: 0.85; }

/* Detail panel */
.detail-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.detail-field {
    padding: 8px 0;
}
.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.detail-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--text-muted);
}
.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

/* Transitions */
.fade-in {
    animation: fadeUp 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    .detail-panel {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 32px 24px;
    }
}
