/* AI Portfolio Assistant - Styles v2.0 */

:root {
    --primary: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --primary-bg: #ecfdf5;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --gray-50: #fafaf9;
    --gray-100: #f5f5f4;
    --gray-200: #e7e5e4;
    --gray-300: #d6d3d1;
    --gray-400: #a8a29e;
    --gray-500: #78716c;
    --gray-600: #57534e;
    --gray-700: #44403c;
    --gray-800: #292524;
    --gray-900: #1c1917;
    
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-primary: 0 10px 25px -5px rgb(5 150 105 / 0.3);
    
    --sidebar-width: 280px;
    --header-height: 60px;
    --transition: all 0.2s ease;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 50%, rgb(236 253 245 / 0.3) 100%);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

.mono {
    font-family: 'Space Mono', monospace;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.menu-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--gray-800);
}

.mobile-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.mobile-notifications {
    position: relative;
    padding: 8px;
    color: var(--gray-600);
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.5);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: var(--shadow-primary);
    flex-shrink: 0;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
}

/* Menu */
.menu-section {
    margin-bottom: 32px;
}

.menu-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin-bottom: 16px;
}

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: var(--transition);
}

.menu-item:hover {
    background: var(--gray-100);
}

.menu-item.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-primary);
}

.menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.menu-text {
    flex: 1;
}

.menu-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--primary-bg);
    color: var(--primary);
}

.menu-item.active .menu-badge {
    background: rgb(255 255 255 / 0.2);
    color: var(--white);
}

/* Sidebar Card */
.sidebar-card {
    margin-top: auto;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    padding: 20px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.sidebar-card::before,
.sidebar-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.1);
}

.sidebar-card::before {
    width: 100px;
    height: 100px;
    right: -20px;
    bottom: -20px;
}

.sidebar-card::after {
    width: 130px;
    height: 130px;
    right: -35px;
    bottom: -35px;
    background: rgb(255 255 255 / 0.05);
}

.card-title {
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.card-text {
    font-size: 14px;
    color: rgb(255 255 255 / 0.8);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.card-button {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--white);
    color: var(--primary);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.card-button:hover {
    background: var(--gray-50);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.search-container {
    position: relative;
    max-width: 400px;
    flex: 1;
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(5 150 105 / 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.search-item:hover {
    background: var(--gray-50);
}

.search-item-main {
    display: flex;
    flex-direction: column;
}

.search-symbol {
    font-weight: 600;
    color: var(--gray-800);
}

.search-name {
    font-size: 13px;
    color: var(--gray-500);
}

.search-exchange {
    font-size: 12px;
    color: var(--gray-400);
}

.search-loading,
.search-empty,
.search-error {
    padding: 20px;
    text-align: center;
    color: var(--gray-500);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-btn {
    position: relative;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    color: var(--gray-600);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    border-color: var(--primary-light);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid var(--gray-200);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    display: none;
}

.user-name {
    font-weight: 600;
    color: var(--gray-800);
}

.user-role {
    font-size: 13px;
    color: var(--gray-500);
}

/* Page Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
}

.page-subtitle {
    color: var(--gray-500);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

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

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    border-color: var(--primary-light);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-icon {
    padding: 10px;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card.primary {
    background: var(--primary);
    border: none;
    color: var(--white);
}

.stat-card.primary::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgb(255 255 255 / 0.1);
    border-radius: 50%;
    right: -20px;
    top: -20px;
}

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

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
}

.stat-card.primary .stat-label {
    color: rgb(255 255 255 / 0.8);
}

.stat-icon {
    color: var(--gray-400);
}

.stat-card.primary .stat-icon {
    color: rgb(255 255 255 / 0.8);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }
.stat-card.primary .stat-change { color: rgb(255 255 255 / 0.9); }

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Chart */
.chart-container {
    position: relative;
    height: 250px;
}

.chart-periods {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chart-period {
    padding: 6px 12px;
    border: none;
    background: none;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.chart-period:hover {
    background: var(--gray-100);
}

.chart-period.active {
    background: var(--primary);
    color: var(--white);
}

/* AI Insights */
.ai-insights {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    padding: 16px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
}

.insight-item.danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.insight-item.success {
    background: var(--primary-bg);
    border: 1px solid #a7f3d0;
}

.insight-item.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.insight-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
    min-width: 0;
}

.insight-title {
    font-size: 14px;
    font-weight: 600;
}

.insight-item.danger .insight-title { color: #b91c1c; }
.insight-item.success .insight-title { color: var(--primary-dark); }
.insight-item.warning .insight-title { color: #b45309; }

.insight-text {
    font-size: 12px;
    margin-top: 4px;
}

.insight-item.danger .insight-text { color: #dc2626; }
.insight-item.success .insight-text { color: var(--primary); }
.insight-item.warning .insight-text { color: #d97706; }

/* Positions List */
.positions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.position-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    transition: var(--transition);
}

.position-item:hover {
    background: var(--gray-100);
}

.position-item[data-href] {
    cursor: pointer;
}

.position-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.position-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--gray-600);
    flex-shrink: 0;
}

.position-details {
    min-width: 0;
}

.position-symbol {
    font-weight: 600;
    color: var(--gray-800);
}

.position-name {
    font-size: 13px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.position-value {
    text-align: right;
    flex-shrink: 0;
}

.position-amount {
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    color: var(--gray-800);
}

.position-change {
    font-size: 13px;
    font-weight: 500;
}

.position-change.positive { color: var(--success); }
.position-change.negative { color: var(--danger); }

/* Signal Badges */
.signal-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.signal-badge.sell { background: var(--danger); color: var(--white); }
.signal-badge.hold { background: var(--success); color: var(--white); }
.signal-badge.wait { background: var(--warning); color: var(--white); }
.signal-badge.buy { background: var(--info); color: var(--white); }

/* Risk Badges */
.risk-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.risk-badge.low { background: var(--primary-bg); color: var(--primary-dark); }
.risk-badge.medium { background: #fef3c7; color: #b45309; }
.risk-badge.high { background: #fee2e2; color: #b91c1c; }

/* Distribution */
.distribution-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.distribution-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Top Recommendation */
.top-recommendation {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    padding: 24px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.top-recommendation::before,
.top-recommendation::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.1);
}

.top-recommendation::before {
    width: 110px;
    height: 110px;
    right: -25px;
    bottom: -25px;
}

.top-recommendation::after {
    width: 140px;
    height: 140px;
    right: -40px;
    bottom: -40px;
    background: rgb(255 255 255 / 0.05);
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.recommendation-icon {
    width: 44px;
    height: 44px;
    background: rgb(255 255 255 / 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.recommendation-symbol {
    font-weight: 600;
    font-size: 16px;
}

.recommendation-confidence {
    font-size: 14px;
    color: rgb(255 255 255 / 0.8);
}

.recommendation-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.recommendation-target-label {
    font-size: 13px;
    color: rgb(255 255 255 / 0.8);
}

.recommendation-target-value {
    font-size: 22px;
    font-weight: 700;
}

.recommendation-btn {
    padding: 10px 20px;
    background: var(--white);
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.recommendation-btn:hover {
    background: var(--gray-50);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

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

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    padding: 4px;
}

.modal-close:hover {
    color: var(--gray-600);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(5 150 105 / 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .btn {
    flex: 1;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 16px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

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

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    font-size: 28px;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--gray-800);
}

.login-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

/* Alerts/Success Messages */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.empty-text {
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin: -24px;
    padding: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
}

.data-table th {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 13px;
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    border-bottom: 1px solid var(--gray-100);
}

.data-table tr:hover td {
    background: var(--gray-50);
}

/* Notification Toast */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    background: var(--gray-800);
    color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: var(--success);
}

.notification-error {
    background: var(--danger);
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
}

.notification-close:hover {
    opacity: 1;
}

/* Stock Page */
.stock-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stock-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: var(--gray-600);
}

.stock-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
}

.stock-subtitle {
    color: var(--gray-500);
}

.stock-price-main {
    text-align: right;
}

.stock-price {
    font-size: 36px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
}

.stock-price-change {
    font-size: 18px;
    font-weight: 600;
}

.stock-price-change.positive { color: var(--success); }
.stock-price-change.negative { color: var(--danger); }

/* Toggle Switch */
.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

.toggle-label {
    font-weight: 500;
    color: var(--gray-700);
}

.toggle-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--gray-300);
    border-radius: 28px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }
    
    .user-info {
        display: block;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: calc(var(--header-height) + 16px) 16px 16px;
    }
    
    .top-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: none;
    }
    
    .header-actions {
        display: none;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-actions {
        width: 100%;
    }
    
    .page-actions .btn {
        flex: 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .position-item {
        flex-wrap: wrap;
    }
    
    .position-info {
        width: 100%;
    }
    
    .position-value {
        text-align: left;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal {
        padding: 24px;
        margin: 16px;
        max-width: calc(100% - 32px);
    }
    
    .login-card {
        padding: 24px;
    }
    
    .chart-periods {
        width: 100%;
        justify-content: center;
    }
    
    .stock-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stock-price-main {
        text-align: left;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 24px;
    }
    
    .card {
        padding: 16px;
    }
    
    .position-icon {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
    
    .notification {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
