/* ============================================
   Gaty Wallet — Premium Investment Portfolio
   RTL Arabic · Financial SaaS · v2.0
   ============================================ */

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

/* ============================================
   Design Tokens
   ============================================ */
:root {
    /* Brand */
    --primary:        #0F2D52;
    --primary-mid:    #1A4A7A;
    --primary-light:  #2563EB;
    --accent:         #3B82F6;
    --accent-glow:    rgba(59,130,246,0.18);

    /* Surfaces */
    --bg:             #F0F4F8;
    --bg-subtle:      #E8EDF3;
    --surface:        #FFFFFF;
    --surface-2:      #F8FAFC;
    --border:         #DDE3EC;
    --border-light:   #EEF2F7;

    /* Semantic */
    --success:        #059669;
    --success-light:  #10B981;
    --success-bg:     #ECFDF5;
    --success-border: #A7F3D0;
    --danger:         #DC2626;
    --danger-light:   #EF4444;
    --danger-bg:      #FEF2F2;
    --danger-border:  #FECACA;
    --warning:        #D97706;
    --warning-bg:     #FFFBEB;
    --warning-border: #FDE68A;
    --info:           #0284C7;
    --info-bg:        #EFF6FF;
    --info-border:    #BFDBFE;

    /* Text */
    --text:           #0F172A;
    --text-secondary: #334155;
    --text-muted:     #64748B;
    --text-faint:     #94A3B8;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(15,45,82,0.06), 0 1px 2px rgba(15,45,82,0.04);
    --shadow-md:  0 4px 12px rgba(15,45,82,0.08), 0 2px 4px rgba(15,45,82,0.05);
    --shadow-lg:  0 10px 30px rgba(15,45,82,0.12), 0 4px 8px rgba(15,45,82,0.06);
    --shadow-xl:  0 20px 60px rgba(15,45,82,0.18), 0 8px 16px rgba(15,45,82,0.08);

    /* Sidebar */
    --sidebar-w: 260px;
    --sidebar-bg: linear-gradient(180deg, #0A2240 0%, #0F2D52 50%, #132F58 100%);

    /* Radius */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.2s var(--ease);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.65;
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* ============================================
   Login Page
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--primary);
}

.login-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(37,99,235,0.35) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 90%, rgba(10,34,64,0.8) 0%, transparent 60%),
        linear-gradient(135deg, #0A2240 0%, #0F2D52 40%, #1A4A7A 100%);
    z-index: 0;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
    top: -200px; left: -200px;
    z-index: 0;
    animation: pulse-bg 8s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
}

.login-card {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    padding: 44px 48px;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.15);
    width: 100%;
    max-width: 440px;
    animation: slide-up 0.5s var(--ease) both;
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.login-logo-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(15,45,82,0.3);
}

.login-title {
    text-align: center;
    color: var(--primary);
    margin-bottom: 4px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 14px;
    font-weight: 400;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-faint);
    font-size: 12px;
}
.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================
   App Layout: Sidebar + Main
   ============================================ */

.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, rgba(59,130,246,0.9), rgba(37,99,235,0.7));
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar-brand-text h2 {
    font-size: 16px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.sidebar-brand-text small {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    font-weight: 400;
}

/* Nav sections */
.sidebar-section-label {
    padding: 16px 20px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.3);
}

.sidebar-nav {
    list-style: none;
    padding: 0 10px;
}

.sidebar-nav li { margin-bottom: 2px; }

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: rgba(255,255,255,0.72);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.sidebar-nav li a .nav-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav li a .nav-badge {
    margin-right: auto;
    background: rgba(59,130,246,0.35);
    color: rgba(255,255,255,0.9);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

.sidebar-nav li a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav li a.active {
    background: linear-gradient(90deg, rgba(59,130,246,0.25), rgba(59,130,246,0.1));
    color: white;
    font-weight: 600;
}

.sidebar-nav li a.active::before {
    content: '';
    position: absolute;
    right: 0; top: 4px; bottom: 4px;
    width: 3px;
    background: var(--accent);
    border-radius: 3px 0 0 3px;
}

.sidebar-nav li a.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.sidebar-nav li a.disabled .nav-badge {
    background: rgba(255,255,255,0.1);
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    text-align: center;
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    padding: 28px 32px;
    overflow-x: hidden;
    min-width: 0;
}

/* ============================================
   Top Bar
   ============================================ */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    padding: 14px 22px;
    border-radius: var(--r-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.topbar-title {
    font-size: 20px;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.topbar-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.topbar-user .logout {
    margin-right: 4px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--danger-border);
    background: var(--danger-bg);
    transition: all var(--transition);
}

.topbar-user .logout:hover {
    background: var(--danger);
    color: white;
}

/* ============================================
   Stats Grid
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    padding: 18px 20px;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 0 var(--r-lg) var(--r-lg) 0;
}

.stat-card.success::before { background: linear-gradient(180deg, var(--success-light), var(--success)); }
.stat-card.danger::before  { background: linear-gradient(180deg, var(--danger-light), var(--danger)); }
.stat-card.warning::before { background: linear-gradient(180deg, #FBBF24, var(--warning)); }
.stat-card.info::before    { background: linear-gradient(180deg, #38BDF8, var(--info)); }

.stat-card::after {
    content: '';
    position: absolute;
    top: -20px; left: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--bg-subtle);
    opacity: 0.5;
}

.stat-icon {
    font-size: 22px;
    margin-bottom: 10px;
    display: block;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-value.success { color: var(--success); }
.stat-value.danger  { color: var(--danger); }

.stat-unit {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-trend {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   Section Cards
   ============================================ */

.section-card {
    background: var(--surface);
    padding: 22px 24px;
    border-radius: var(--r-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.section-header h3 {
    color: var(--primary);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header .app-total {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* Page section title (outside card) */
.page-section-title {
    color: var(--primary);
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   Tables
   ============================================ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--r-md);
    border: 1px solid var(--border-light);
}

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

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    padding: 11px 14px;
    text-align: right;
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    text-align: right;
    border-bottom: 1px solid var(--border-light);
    font-size: 13.5px;
    color: var(--text-secondary);
    transition: background var(--transition);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td {
    background: var(--bg-subtle);
}

.data-table td.numeric {
    font-family: 'Cairo', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge.buy      { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge.sell     { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border); }
.badge.deposit  { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info-border); }
.badge.withdraw { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }

/* Text utilities */
.text-success { color: var(--success); font-weight: 700; }
.text-danger  { color: var(--danger);  font-weight: 700; }
.text-muted   { color: var(--text-muted); }
.text-faint   { color: var(--text-faint); }

/* ============================================
   Forms
   ============================================ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-group label .req { color: var(--danger); }

.form-input,
.form-select {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-family: 'Cairo', inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.form-input:hover,
.form-select:hover {
    border-color: var(--accent);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder { color: var(--text-faint); }

.form-radio-group {
    display: flex;
    gap: 20px;
    padding-top: 8px;
}

.form-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 400;
    color: var(--text-secondary);
}

.form-hint {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Cairo', inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-mid), var(--primary-light));
    color: white;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    box-shadow: 0 4px 14px rgba(37,99,235,0.4);
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--accent);
    color: var(--primary-light);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}
.btn-danger:hover {
    background: #B91C1C;
    color: white;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(5,150,105,0.25);
}
.btn-success:hover {
    background: #047857;
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border-light);
}
.btn-ghost:hover {
    background: var(--bg-subtle);
    color: var(--text);
}

.btn-sm {
    padding: 6px 13px;
    font-size: 12px;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 16px;
}

.btn-block { width: 100%; justify-content: center; }

/* ============================================
   Alerts
   ============================================ */

.alert {
    padding: 13px 18px;
    border-radius: var(--r-md);
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
    border-right: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success { background: var(--success-bg); color: #065F46; border-color: var(--success); }
.alert-danger  { background: var(--danger-bg);  color: #991B1B; border-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: #92400E; border-color: var(--warning); }
.alert-info    { background: var(--info-bg);    color: #1E40AF; border-color: var(--info); }

/* ============================================
   Tabs
   ============================================ */

.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 22px;
    border-bottom: 2px solid var(--border-light);
    overflow-x: auto;
    padding-bottom: 0;
}

.tabs a {
    padding: 10px 18px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.tabs a:hover {
    color: var(--primary-light);
    background: var(--bg-subtle);
}

.tabs a.active {
    color: var(--primary-light);
    border-bottom-color: var(--accent);
    background: var(--accent-glow);
}

.tabs a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   Filters Bar
   ============================================ */

.filters-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface-2);
    border-radius: var(--r-md);
    border: 1px solid var(--border-light);
}

.filters-bar select,
.filters-bar input[type="text"],
.filters-bar input[type="search"] {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-family: 'Cairo', inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition);
}

.filters-bar select:focus,
.filters-bar input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filters-bar label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: 1.5px solid var(--border);
    transition: all var(--transition);
}

.filters-bar label:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--primary-light);
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-state h4 {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
}

.empty-state p {
    font-size: 13px;
    margin-bottom: 16px;
}

/* ============================================
   Pagination
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination .page-info {
    padding: 7px 16px;
    background: var(--bg-subtle);
    border-radius: var(--r-sm);
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    border: 1px solid var(--border-light);
}

/* ============================================
   Portfolio Analysis
   ============================================ */

.analysis-disclaimer {
    background: var(--warning-bg);
    border-right: 4px solid var(--warning);
    padding: 13px 18px;
    border-radius: var(--r-md);
    margin-bottom: 20px;
    font-size: 13px;
    color: #92400E;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.stock-analysis-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-right: 4px solid var(--primary);
    transition: box-shadow var(--transition);
}

.stock-analysis-card:hover { box-shadow: var(--shadow-md); }
.stock-analysis-card.win  { border-right-color: var(--success); }
.stock-analysis-card.loss { border-right-color: var(--danger); }

.sac-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 60%, var(--primary-light) 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.sac-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.sac-header .symbol {
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.2);
}

.sac-body { padding: 20px; }

.sac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.sac-metric {
    background: var(--surface-2);
    padding: 12px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-light);
}

.sac-metric-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.sac-metric-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.sac-metric-value.success { color: var(--success); }
.sac-metric-value.danger  { color: var(--danger); }

.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.signal-item {
    background: var(--surface-2);
    padding: 10px 14px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    border: 1px solid var(--border-light);
    transition: background var(--transition);
}

.signal-item:hover { background: var(--bg); }

.signal-item .signal-emoji { font-size: 18px; flex-shrink: 0; }
.signal-item .signal-name { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.signal-item .signal-value { font-weight: 700; color: var(--text); }

.review-notes {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.review-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Action Items */
.action-item-card {
    background: var(--surface);
    border-radius: var(--r-md);
    padding: 14px 18px;
    margin-bottom: 10px;
    border-right: 4px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.action-item-card:hover {
    transform: translateX(-2px);
    box-shadow: var(--shadow-sm);
}

.action-item-card.opportunity { border-right-color: var(--success); background: var(--success-bg); }
.action-item-card.risk        { border-right-color: var(--danger);  background: var(--danger-bg); }
.action-item-card.stagnant    { border-right-color: var(--warning); background: var(--warning-bg); }
.action-item-card.concentration { border-right-color: var(--info); background: var(--info-bg); }

.action-item-text { flex: 1; min-width: 200px; }
.action-item-text h5 { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--text); }
.action-item-text p  { margin: 0; font-size: 13px; color: var(--text-muted); }

/* Concentration bars */
.concentration-bar {
    background: var(--bg-subtle);
    border-radius: 20px;
    height: 20px;
    overflow: hidden;
    margin-top: 8px;
    position: relative;
    border: 1px solid var(--border-light);
}

.concentration-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.6s var(--ease);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 20px;
}

.concentration-bar-fill.high   { background: linear-gradient(90deg, #EF4444, #DC2626); }
.concentration-bar-fill.medium { background: linear-gradient(90deg, #FBBF24, #D97706); }
.concentration-bar-fill.low    { background: linear-gradient(90deg, #34D399, #059669); }

.stars { color: #F59E0B; letter-spacing: 2px; }

/* ============================================
   TradingView Widget
   ============================================ */

.tradingview-widget-container {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.tv-widget-frame { min-height: 500px; }

/* ============================================
   Live Price indicators
   ============================================ */

.price-up   { color: var(--success); font-weight: 700; }
.price-down { color: var(--danger);  font-weight: 700; }

.change-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.change-chip.up   { background: var(--success-bg); color: var(--success); }
.change-chip.down { background: var(--danger-bg);  color: var(--danger); }

/* ============================================
   Loading / Skeleton
   ============================================ */

@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border-light) 50%, var(--bg-subtle) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--r-sm);
}

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .main-content { padding: 20px 24px; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        right: calc(-1 * var(--sidebar-w));
        top: 0;
        height: 100%;
        z-index: 200;
        transition: right 0.3s var(--ease);
    }

    .sidebar.open {
        right: 0;
        box-shadow: var(--shadow-xl);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 199;
    }

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

    .main-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .topbar-title { font-size: 17px; }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px; height: 36px;
        background: var(--bg-subtle);
        border: 1.5px solid var(--border);
        border-radius: var(--r-sm);
        cursor: pointer;
        font-size: 18px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 28px 24px; }
    .form-grid  { grid-template-columns: 1fr; }
}
