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

:root {
    --primary: #FF6B00;
    --accent-orange: #FF6B00;
    --background: #0a120b;
    --surface: #161b17;
    --border: #262d27;
    --text: #f5f8f6;
    --text-dim: #88998b;
    --success: #00e676;
    --danger: #ff5252;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary);
    font-size: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary:hover {
    background: #e66000;
    transform: translateY(-1px);
}

/* Dashboard Layout */
#app-section {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.top-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-text {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
}

.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

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

.nav-item {
    margin-bottom: 0.2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.nav-link.active, .nav-link:hover {
    background: rgba(255, 107, 0, 0.1);
    color: var(--primary);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--background);
    padding: 2rem;
}

.agent-badge {
    background: rgba(255, 107, 0, 0.1);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 107, 0, 0.2);
}

.referral-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.2);
    padding: 0.2rem 0.2rem 0.2rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.referral-box span {
    font-size: 0.8rem;
    color: var(--text-dim);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
}

.welcome-hero {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.1) 0%, rgba(10, 18, 11, 0) 100%);
    border-radius: 12px;
}

.welcome-hero h1 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.welcome-hero p {
    color: var(--text-dim);
    font-size: 1.1rem;
}

.search-section {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.search-container {
    width: 100%;
    max-width: 600px;
}

.search-container label {
    display: block;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.search-box-wrapper {
    display: flex;
    gap: 1rem;
}

.search-box-wrapper input {
    flex: 1;
    background: var(--surface);
    border: 2px solid var(--border);
    padding: 1.2rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s;
}

.search-box-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.2);
}

.btn-search-large {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 2.5rem;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-search-large:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.user-brief-info {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.user-brief-info h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
}

.action-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 1.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.action-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 0, 0.1);
    color: var(--primary);
    transform: translateY(-3px);
}

.btn-close-sm {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.2rem; /* Reduced padding */
    border-radius: 0.25rem;
    border: 2px solid var(--primary); /* Orange border as requested */
    transition: all 0.2s;
    color: var(--text);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 107, 0, 0.05); /* Subtle orange tint on hover */
}

.stat-card h3 {
    font-size: 0.85rem; /* Slightly smaller title */
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-card .value {
    font-size: 1.8rem; /* Slightly smaller value for consistency */
    font-weight: 700;
    color: var(--primary); /* Value in orange for impact */
    margin-bottom: 0.5rem;
}

.stat-card .change {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.8rem;
    border-top: 1px solid var(--border);
    padding-top: 0.6rem;
    cursor: pointer;
    text-align: right;
}

.card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.status-success { background: rgba(0, 200, 83, 0.1); color: var(--success); }
.status-pending { background: rgba(255, 157, 0, 0.1); color: var(--primary); }

#login-section { display: block; }
#app-section { display: none; }

/* Sidebar Toggle */
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 107, 0, 0.1);
    color: var(--primary);
}

/* Sidebar Collapsed State (Desktop) */
.sidebar.collapsed {
    width: 70px;
    padding: 1.5rem 0.5rem;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 1rem 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -220px;
        top: 66px; /* Approx Header height */
        height: calc(100vh - 66px);
        z-index: 999;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .sidebar.collapsed {
        width: 220px; /* Full width when open on mobile */
        padding: 1.5rem;
    }
    
    .sidebar.collapsed .nav-link span { display: inline; }
    
    .sidebar.collapsed .nav-link {
        justify-content: flex-start;
        padding: 0.8rem 1rem;
    }
    
    .sidebar.collapsed .nav-link i {
        margin-right: 12px;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 66px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
        display: none;
    }
    .mobile-overlay.active {
        display: block;
    }
    
    /* Hide some header stuff on mobile */
    .status-indicator { display: none; }
    .referral-box span { width: 100px; }
}

/* Sidebar Toggle */
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 107, 0, 0.1);
    color: var(--primary);
}

/* Sidebar Collapsed State (Desktop) */
.sidebar.collapsed {
    width: 70px;
    padding: 1.5rem 0.5rem;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 1rem 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -220px;
        top: 66px; /* Approx Header height */
        height: calc(100vh - 66px);
        z-index: 999;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .sidebar.collapsed {
        width: 220px; /* Full width when open on mobile */
        padding: 1.5rem;
    }
    
    .sidebar.collapsed .nav-link span { display: inline; }
    
    .sidebar.collapsed .nav-link {
        justify-content: flex-start;
        padding: 0.8rem 1rem;
    }
    
    .sidebar.collapsed .nav-link i {
        margin-right: 12px;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 66px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
        display: none;
    }
    .mobile-overlay.active {
        display: block;
    }
    
    /* Hide some header stuff on mobile */
    .status-indicator { display: none; }
    .referral-box span { width: 100px; }
}
