:root {
    --primary: #387ed1;
    --primary-dark: #2c65a8;
    --secondary: #666;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --bg: #f5f8fa;
    --card-bg: #ffffff;
    --text: #333;
    --text-light: #666;
    --border: #e0e7ed;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.text-success { color: #2ecc71 !important; }
.text-danger { color: #e74c3c !important; }

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 1.15rem;
    color: #444;
}

.logo-img {
    height: 24px;
    width: auto;
    object-fit: contain;
    display: block;
}

.market-status-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 4px 10px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #f0f4f8;
    color: var(--primary);
}

.tab-btn:hover:not(.active) {
    background: #f9f9f9;
}

/* Tabs */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

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

/* Dashboard Layout */
.dashboard {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

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

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.holdings-card { grid-column: span 2; }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    color: var(--text-light);
}

.full-width {
    grid-column: 1 / -1 !important;
}

/* Market Data Display */
.market-data-display {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.data-point {
    display: flex;
    flex-direction: column;
}

.data-point .label { font-size: 0.75rem; color: var(--text-light); font-weight: 600; text-transform: uppercase; }
.data-point .value { font-size: 1.5rem; font-weight: 700; color: var(--text); }

.value-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
}

.value-badge.buy { background: #e8f5e9; color: #2e7d32; }
.value-badge.sell { background: #ffebee; color: #c62828; }

/* Strategy Controls */
.strategy-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-light); }
.input-group input {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: #f0f4f8; color: var(--text); }

/* Table */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; }
td { padding: 1rem 0.75rem; border-bottom: 1px solid #f9f9f9; font-size: 0.9rem; }

/* Notification */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: #333;
    color: white;
    border-radius: 8px;
    transform: translateY(200%);
    transition: transform 0.3s;
    z-index: 1000;
}
.notification.show { transform: translateY(0); }

/* Status */
.info-row { display: flex; justify-content: space-between; margin-bottom: 1rem; font-size: 0.9rem; }
.badge { padding: 0.25rem 0.75rem; border-radius: 1rem; font-size: 0.75rem; font-weight: 700; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff3e0; color: #ef6c00; }

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    background: #f0f4f8;
}

.user-profile span {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.chevron-icon {
    width: 14px;
    height: 14px;
    color: var(--text-light);
}

/* Dropdown Menu */
.user-profile-container {
    position: relative;
}

.user-profile {
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile:hover {
    background: #e8eff6;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 180px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    padding: 0.5rem;
    display: none;
    z-index: 1000;
    animation: slideDown 0.2s ease;
}

.dropdown-menu.show {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f5f8fa;
    color: var(--primary);
}

.dropdown-item i {
    width: 16px;
    height: 16px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.dropdown-item.logout {
    color: var(--danger);
}

.dropdown-item.logout:hover {
    background: #fff5f5;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-buttons.horizontal {
    flex-direction: row;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon i {
    width: 24px;
    height: 24px;
}

.price-flash {
    animation: flashGreen 0.2s ease-out;
}

@keyframes flashGreen {
    0% { color: var(--primary); }
    50% { color: var(--success); transform: scale(1.02); }
    100% { color: var(--text); }
}

.action-buttons.horizontal .btn {
    width: auto;
    min-width: 180px;
}
