:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --profit-color: #10b981;
    --loss-color: #ef4444;
    --sidebar-width: 250px;
    --header-height: 0px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── APP LAYOUT ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem 2.5rem 3rem;
}

/* ── HAMBURGER MENU TOGGLE ── */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    padding: 10px 8px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.menu-toggle:hover {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
}

.menu-icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.sidebar.open ~ .menu-toggle .menu-icon-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.sidebar.open ~ .menu-toggle .menu-icon-bar:nth-child(2) {
    opacity: 0;
}
.sidebar.open ~ .menu-toggle .menu-icon-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--card-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.sidebar-close:hover { color: #fff; }

.sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
}

.nav-section {
    margin-bottom: 0.25rem;
}

.nav-section-title {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1.25rem 0.35rem;
    opacity: 0.6;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    user-select: none;
    white-space: nowrap;
}

.sidebar-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-left-color: rgba(255, 255, 255, 0.2);
}

.sidebar-nav-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--accent-color);
    font-weight: 600;
}

/* ── HEADER ── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.header-content h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-content p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-top: 0.2rem;
}

.header-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    text-align: right;
    backdrop-filter: blur(10px);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 110px;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.profit { color: var(--profit-color); }
.loss   { color: var(--loss-color);   }

/* ── CARDS ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card h2 {
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.glassmorphism {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
}

/* ── CHART ── */
.chart-container {
    position: relative;
    height: 360px;
    width: 100%;
}

/* ── TABLES ── */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

th, td {
    padding: 0.55rem 0.45rem;
    border-bottom: 1px solid var(--card-border);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
}

td { font-size: 0.82rem; }

tbody tr:hover { background-color: rgba(255, 255, 255, 0.02); }

.year-cell {
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.total-cell {
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.05);
}

.count-cell {
    font-size: 0.72rem;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
}

.count-row {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
}

/* ── TAB CONTENT ── */
.tab-content {
    display: none !important;
    animation: fadeIn 0.25s ease;
}

.tab-content.active { display: block !important; }

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

/* ── DEEP STATS ── */
.deep-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.stat-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.stat-list-item:last-child { border-bottom: none; padding-bottom: 0; }

.stat-list-item span:first-child {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.stat-list-item span.stat-value { font-size: 1rem; }

/* ── RISK PANEL ── */
.risk-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border-left: 4px solid var(--accent-color);
}

.risk-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.risk-input-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.45rem 2rem 0.45rem 0.85rem;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    width: 100px;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.pct-symbol {
    position: absolute;
    right: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.risk-output-group { text-align: right; }

.risk-output-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.risk-output-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--profit-color);
}

/* ── TRADE JOURNAL STYLES ── */
.journal-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.journal-form-grid .full-width { grid-column: 1 / -1; }

.jf-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.jf-group label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.jf-input {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    width: 100%;
    transition: border-color 0.2s;
}

.jf-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.jf-input option { background: #1e293b; }

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.5rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-danger {
    background: transparent;
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover { background: rgba(239,68,68,0.1); }

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.45rem 1rem;
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover { border-color: var(--accent-color); color: #fff; }

.journal-filter-bar {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.journal-filter-bar select,
.journal-filter-bar input {
    background: rgba(15,23,42,0.7);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
}

.journal-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.j-stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    text-align: center;
}

.j-stat-card .j-stat-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.2rem;
}

.j-stat-card .j-stat-val {
    font-size: 1.1rem;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-win    { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.badge-loss   { background: rgba(239,68,68,0.12);  color: #ef4444; border: 1px solid rgba(239,68,68,0.3);  }
.badge-rwin   { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.badge-rloss  { background: rgba(249,115,22,0.15); color: #f97316; border: 1px solid rgba(249,115,22,0.3); }
.badge-buy    { background: rgba(16,185,129,0.1);  color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.badge-sell   { background: rgba(239,68,68,0.1);   color: #ef4444; border: 1px solid rgba(239,68,68,0.2);  }

.journal-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

/* ── SYSTEM SWITCHER & BADGES ── */
.system-switcher {
    display: inline-flex;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 0.25rem;
    gap: 0.25rem;
    backdrop-filter: blur(8px);
}

.system-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.4rem 1.1rem;
    border-radius: 16px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
}

.system-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.system-btn.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
    backdrop-filter: blur(10px);
}

#btn-system-limit.active {
    background: rgba(167, 139, 250, 0.2);
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 0 12px rgba(167, 139, 250, 0.25);
}

.system-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(5px);
}

.badge-standard {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.1);
}

.badge-limit {
    background: rgba(167, 139, 250, 0.15);
    color: #c084fc;
    border: 1px solid rgba(167, 139, 250, 0.35);
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.1);
}

/* ── PERFORMANCE CALENDAR TAB STYLES ── */
.cal-years-grid, .cal-months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}
.cal-card {
    padding: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.cal-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.calendar-container {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 1rem;
}
.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.calendar-day-cell {
    aspect-ratio: 1.2;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.15s ease;
}
.calendar-day-cell:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}
.calendar-day-cell.empty {
    cursor: default;
    opacity: 0.15;
    background: transparent !important;
    border: 1px dashed rgba(255, 255, 255, 0.05) !important;
}
.calendar-day-cell.empty:hover {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}
.calendar-day-number {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
}
.calendar-day-value {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: right;
}
.cal-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-color: rgba(255, 255, 255, 0.1);
}
.cal-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}
.calendar-day-cell.win-day {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.15);
}
.calendar-day-cell.win-day:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}
.calendar-day-cell.loss-day {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.15);
}
.calendar-day-cell.loss-day:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}
.calendar-day-cell.active-day {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

/* ── MODAL STYLES ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}
.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s ease;
}
.modal-close-btn:hover { color: #fff; }
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

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

/* ════════════════════════════════════════════
   RESPONSIVE: TABLET (max 1024px)
   ════════════════════════════════════════════ */
@media screen and (max-width: 1024px) {
    .deep-stats-grid { grid-template-columns: 1fr; }

    .dashboard-container {
        padding: 1.25rem 1.25rem 2rem;
    }

    .mt5-container-split {
        grid-template-columns: 1fr !important;
    }
}

/* ════════════════════════════════════════════
   RESPONSIVE: MOBILE SIDEBAR + CONTENT (max 768px)
   ════════════════════════════════════════════ */
@media screen and (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }

    .menu-toggle {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-container {
        padding: 0.75rem 1rem 2rem;
    }

    .header-content h1  { font-size: 1.25rem; padding-left: 3rem; }
    .header-content p   { font-size: 0.75rem; padding-left: 3rem; }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .header-stats {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding-left: 3rem;
    }

    .stat-box {
        padding: 0.5rem 0.75rem;
        text-align: left;
        min-width: 0;
    }

    .stat-value { font-size: 0.95rem; }

    .risk-panel {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.85rem 1rem;
    }

    .risk-output-group { text-align: left; width: 100%; }

    .chart-container { height: 240px; }

    .card {
        padding: 0.85rem 1rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .card h2 { font-size: 0.92rem; }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    td  { font-size: 0.75rem; }
    th  { font-size: 0.7rem;  }

    .year-cell {
        position: sticky;
        left: 0;
        background-color: #1e293b;
        z-index: 10;
        box-shadow: 2px 0 5px rgba(0,0,0,0.4);
    }

    th.year-cell { z-index: 11; }

    .deep-stats-grid { grid-template-columns: 1fr; gap: 0.75rem; }

    .journal-form-grid { grid-template-columns: 1fr 1fr; }
    .journal-stats-row { grid-template-columns: 1fr 1fr 1fr; }

    .calendar-container { padding: 0.75rem; }
    .calendar-header-row { font-size: 0.75rem; margin-bottom: 0.5rem; }
    .calendar-days-grid { gap: 4px; }
    .calendar-day-cell {
        padding: 4px;
        min-height: 52px;
        aspect-ratio: auto;
        border-radius: 6px;
    }
    .calendar-day-number { font-size: 0.7rem; }
    .calendar-day-value { font-size: 0.68rem; }
    .cal-card { padding: 1rem; }
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    .modal-header { padding: 1rem; }
    .modal-body { padding: 1rem; }

    .mt5-container-split {
        grid-template-columns: 1fr !important;
    }
}

/* ════════════════════════════════════════════
   RESPONSIVE: SMALL MOBILE (max 480px)
   ════════════════════════════════════════════ */
@media screen and (max-width: 480px) {
    .header-stats { grid-template-columns: 1fr; padding-left: 0; }
    .header-content h1 { padding-left: 2.5rem; font-size: 1.1rem; }
    .header-content p  { padding-left: 2.5rem; }
    .journal-form-grid { grid-template-columns: 1fr; }
    .journal-stats-row { grid-template-columns: 1fr 1fr; }
    .stat-box { text-align: left; }
    .risk-input-group { flex-wrap: wrap; }
    .dashboard-container { padding: 0.5rem 0.6rem 1.5rem; }

    .cal-years-grid, .cal-months-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
}
