/* DOUCOURE General Trading LLC - Styles */
/* Extracted from original Doucoure v1.html - Design preserved exactly */

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-body: #f4f7fc; --bg-main: #f4f7fc; --bg-card: #ffffff;
    --bg-sidebar: #0f1a2b; --bg-sidebar-hover: rgba(255,255,255,0.07);
    --text-primary: #1a2634; --text-secondary: #3f4e66; --text-muted: #6f7e98;
    --text-sidebar: #b0c4de; --text-sidebar-active: #0f1a2b;
    --border-color: #eef2f7; --border-input: #dde3ed;
    --shadow-card: 0 2px 10px rgba(0,0,0,0.04); --shadow-sidebar: 2px 0 12px rgba(0,0,0,0.15);
    --input-bg: #fafcff; --table-header-bg: #f8faff; --table-hover: #fafcff; --modal-bg: #ffffff;
    --gold: #b8860b; --silver: #6f7e98; --usd: #2e7d32; --cfa: #d84315; --eur: #1565c0; --yen: #9c27b0;
    --gold-accent: #f5b342; --danger: #c0392b;
    --scrollbar-track: #f0f4fa; --scrollbar-thumb: #c4cfdf; --scrollbar-thumb-hover: #a8b6cc;
    --transition: 0.3s ease;
}
body.dark-mode {
    --bg-body: #0b1120; --bg-main: #0b1120; --bg-card: #182235;
    --bg-sidebar: #070d1a; --bg-sidebar-hover: rgba(255,255,255,0.06);
    --text-primary: #e8edf5; --text-secondary: #94a3b8; --text-muted: #6b7f9e;
    --text-sidebar: #8aa0c4; --text-sidebar-active: #0b1120;
    --border-color: #253348; --border-input: #2d3f58;
    --shadow-card: 0 2px 10px rgba(0,0,0,0.3); --shadow-sidebar: 2px 0 16px rgba(0,0,0,0.5);
    --input-bg: #1a2740; --table-header-bg: #1a2740; --table-hover: #1f2e4a; --modal-bg: #182235;
    --gold: #d4a02b; --silver: #8aa0c4; --usd: #4caf50; --cfa: #e6734a; --eur: #42a5f5; --yen: #ba68c8;
    --danger: #e74c3c;
    --scrollbar-track: #1a2740; --scrollbar-thumb: #2d3f58; --scrollbar-thumb-hover: #3f5678;
}
html { font-size: 14px; }
body {
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    background: var(--bg-body); color: var(--text-primary);
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
}
#appScreen { display: flex; min-height: 100vh; }
.sidebar { 
    width: 260px; background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); 
    display: flex; flex-direction: column; color: white; border-right: 1px solid rgba(255,255,255,0.05); 
    overflow-y: auto; height: 100vh; position: fixed;
    z-index: 1000;
}
.sidebar .brand {
    padding: 24px 20px; font-size: 20px; font-weight: 700;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08); transition: border-color var(--transition);
}
.sidebar .brand i { color: var(--gold-accent); font-size: 26px; }
.sidebar .brand span { color: var(--gold-accent); }
.sidebar .brand .brand-sub { color: #fff; font-size: 12px; font-weight: 400; }
body.dark-mode .sidebar .brand .brand-sub { color: #b0c4de; }
.sidebar .flags-sidebar { padding: 12px 20px; display: flex; gap: 8px; justify-content: center; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar .flags-sidebar svg { border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.sidebar nav { flex: 1; padding: 14px 10px 0 10px; overflow-y: auto; }
.sidebar nav a {
    display: flex; align-items: center; gap: 14px; padding: 10px 16px;
    border-radius: 10px; color: var(--text-sidebar); text-decoration: none;
    font-weight: 500; font-size: 14px; transition: all 0.2s; margin-bottom: 2px; cursor: pointer; outline: none;
}
.sidebar nav a i { width: 20px; text-align: center; font-size: 15px; }
.sidebar nav a:hover { background: var(--bg-sidebar-hover); color: #fff; }
.sidebar nav a.active {
    background: var(--gold-accent); color: var(--text-sidebar-active);
    font-weight: 600; box-shadow: 0 4px 12px rgba(245,179,66,0.3);
}
.sidebar .footer-side {
    padding: 16px 20px 0 20px; font-size: 12px; color: #6a7f9b;
    border-top: 1px solid rgba(255,255,255,0.06); margin-top: 8px;
    display: flex; flex-direction: column; gap: 6px;
    transition: border-color var(--transition), color var(--transition);
}
body.dark-mode .sidebar .footer-side { color: #4a6080; border-top-color: rgba(255,255,255,0.04); }
.sidebar .footer-side button, .sidebar .footer-side label.btn {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #fff;
    padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
    display: flex; align-items: center; gap: 6px; transition: background 0.2s; white-space: nowrap; font-family: inherit;
}
.sidebar .footer-side button:hover, .sidebar .footer-side label.btn:hover { background: rgba(255,255,255,0.18); }
.sidebar .footer-side input[type="file"] { display: none; }
.main {
    margin-left: 260px; flex: 1; padding: 24px 30px 36px 30px;
    min-height: 100vh; background: var(--bg-main); transition: background var(--transition);
}
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.topbar h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 10px; transition: color var(--transition); }
.topbar h1 i { color: var(--gold-accent); }
.topbar .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.topbar .actions .search-box {
    background: var(--bg-card); border-radius: 30px; padding: 5px 16px;
    display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color); transition: background var(--transition), border-color var(--transition);
}
.topbar .actions .search-box input {
    border: none; outline: none; padding: 7px 0; font-size: 14px; width: 150px;
    background: transparent; color: var(--text-primary); transition: color var(--transition);
}
.topbar .actions .search-box input::placeholder { color: var(--text-muted); }
.topbar .actions .search-box i { color: var(--text-muted); transition: color var(--transition); }
.dark-toggle, .lang-toggle {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 30px;
    padding: 7px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    transition: all var(--transition); box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.dark-toggle:hover, .lang-toggle:hover { border-color: var(--gold-accent); }
.dark-toggle i, .lang-toggle i { font-size: 15px; color: var(--gold-accent); }
.btn {
    background: var(--bg-sidebar); color: #fff; border: none; padding: 8px 20px;
    border-radius: 30px; font-weight: 600; font-size: 13px; cursor: pointer;
    transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 12px rgba(15,26,43,0.15); white-space: nowrap; font-family: inherit;
}
.btn:hover { background: #1a2a40; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15,26,43,0.2); }
.btn-gold { background: var(--gold-accent); color: #0f1a2b; }
.btn-gold:hover { background: #e6a536; }
.btn-outline { background: transparent; color: var(--text-primary); border: 1.5px solid var(--border-color); box-shadow: none; }
.btn-outline:hover { background: var(--table-hover); box-shadow: none; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: #c0392b; } .btn-danger:hover { background: #a93226; }
.btn-success { background: #27ae60; } .btn-success:hover { background: #1e8449; }
.btn-print { background: #5a6e8c; } .btn-print:hover { background: #4a5e7a; }
.btn-excel { background: #217346; } .btn-excel:hover { background: #185a32; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stats .card {
    background: var(--bg-card); border-radius: 14px; padding: 16px 18px;
    box-shadow: var(--shadow-card); border: 1px solid var(--border-color);
    transition: all 0.2s, background var(--transition), border-color var(--transition);
}
.stats .card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.stats .card .label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.stats .card .value { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-top: 3px; word-break: break-word; }
.stats .card.gold .value { color: var(--gold); }
.stats .card.silver .value { color: var(--silver); }
.stats .card.usd .value { color: var(--usd); }
.stats .card.cfa .value { color: var(--cfa); }
.stats .card.eur .value { color: var(--eur); }
.stats .card.yen .value { color: var(--yen); }
.section { display: none; animation: fadeIn 0.3s ease; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.section-header h2 { font-size: 19px; font-weight: 600; color: var(--text-primary); }
.section-header h2 i { color: var(--gold-accent); margin-right: 8px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; background: var(--bg-card); padding: 14px 18px; border-radius: 12px; border: 1px solid var(--border-color); transition: background var(--transition), border-color var(--transition); }
.filter-bar select, .filter-bar input { padding: 7px 12px; border-radius: 10px; border: 1.5px solid var(--border-input); font-size: 13px; background: var(--input-bg); color: var(--text-primary); transition: all var(--transition); }
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--gold-accent); box-shadow: 0 0 0 3px rgba(245,179,66,0.15); }
.filter-bar label { font-weight: 600; color: var(--text-secondary); font-size: 13px; }
.table-wrap { background: var(--bg-card); border-radius: 14px; border: 1px solid var(--border-color); overflow-x: auto; box-shadow: var(--shadow-card); margin-bottom: 18px; transition: background var(--transition), border-color var(--transition); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 580px; }
table th { background: var(--table-header-bg); color: var(--text-secondary); font-weight: 600; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; transition: background var(--transition), color var(--transition), border-color var(--transition); }
table td { padding: 11px 16px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); transition: color var(--transition), border-color var(--transition); }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--table-hover); }
.badge { display: inline-block; padding: 3px 12px; border-radius: 30px; font-size: 11px; font-weight: 600; }
.badge-in { background: #d4edda; color: #155724; }
.badge-out { background: #f8d7da; color: #721c24; }
.badge-neutral { background: #cce5ff; color: #004085; }
.text-gold { color: var(--gold); font-weight: 600; }
.text-silver { color: var(--silver); font-weight: 600; }
.text-usd { color: var(--usd); font-weight: 600; }
.text-cfa { color: var(--cfa); font-weight: 600; }
.text-eur { color: var(--eur); font-weight: 600; }
.text-yen { color: var(--yen); font-weight: 600; }
.text-danger { color: var(--danger); font-weight: 600; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-muted); transition: color var(--transition); }
.empty-state i { font-size: 40px; color: var(--border-color); margin-bottom: 10px; }
.empty-state p { font-size: 14px; }
.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15,26,43,0.5); backdrop-filter: blur(4px); z-index: 200; justify-content: center; align-items: center; animation: fadeIn 0.25s ease; }
.modal-overlay.open { display: flex; }
.modal { background: var(--modal-bg); border-radius: 20px; padding: 28px 32px; max-width: 540px; width: 95%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.25); animation: slideUp 0.3s ease; transition: background var(--transition); }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal h3 { font-size: 19px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.modal .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.modal .close-modal { float: right; background: none; border: none; font-size: 22px; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.modal .close-modal:hover { color: var(--text-primary); transform: rotate(90deg); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; transition: color var(--transition); }
.form-group label .required { color: #c0392b; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border-input); border-radius: 10px; font-size: 13px; transition: all 0.2s; background: var(--input-bg); font-family: inherit; color: var(--text-primary); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--gold-accent); box-shadow: 0 0 0 3px rgba(245,179,66,0.15); background: var(--bg-card); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 3px; animation: fadeIn 0.2s ease; }
.preview-box { background: var(--table-header-bg); border-radius: 10px; padding: 12px 16px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; transition: background var(--transition); }
.preview-row { display: flex; justify-content: space-between; font-weight: 500; font-size: 13px; }
.preview-row .highlight { color: var(--gold-accent); }
.menu-toggle { display: none; background: var(--bg-sidebar); color: #fff; border: none; padding: 6px 12px; border-radius: 10px; font-size: 18px; cursor: pointer; align-items: center; gap: 6px; transition: background var(--transition); }
.toast { position: fixed; bottom: 28px; right: 28px; background: var(--bg-sidebar); color: #fff; padding: 10px 18px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 999; animation: slideUp 0.3s ease, fadeOut 0.5s 2.5s forwards; font-size: 13px; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(10px); } }
#negativeWarning { display: none; position: fixed; bottom: 20px; left: 20px; right: 20px; background: var(--danger); color: #fff; padding: 12px 16px; border-radius: 12px; z-index: 1000; text-align: center; font-weight: 600; }
#loginScreen { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: var(--bg-body); }
.forgot-link { color: var(--gold-accent); cursor: pointer; font-size: 14px; margin-top: 10px; text-decoration: underline; background: none; border: none; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 270px; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 16px 14px 24px 14px; }
    .topbar h1 { font-size: 20px; }
    .topbar .actions .search-box input { width: 110px; }
    .stats { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .modal { padding: 20px 16px; }
    .menu-toggle { display: flex !important; }
    .dark-toggle span, .lang-toggle span { display: none; }
    .dark-toggle, .lang-toggle { padding: 6px 10px; }
}
@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .topbar .actions { width: 100%; }
    .topbar .actions .search-box { flex: 1; }
    .topbar .actions .search-box input { width: 100%; }
}

/* ═══ V2 Enhancements ═══ */

/* Loading overlay */
.main.loading { position: relative; pointer-events: none; opacity: 0.6; transition: opacity 0.2s ease; }
.main.loading::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 36px; height: 36px; border: 3px solid var(--border-color); border-top-color: var(--gold-accent);
    border-radius: 50%; animation: spin 0.7s linear infinite; z-index: 50;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Pagination */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.pagination .btn { transition: all 0.15s ease; }
.pagination .btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.pagination-info { font-size: 12px; color: var(--text-muted); margin-right: 8px; font-weight: 500; }

/* Button micro-interactions */
.btn { transition: all 0.2s ease, transform 0.15s ease; }
.btn:active:not([disabled]) { transform: scale(0.96); }
.btn-gold:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(245,179,66,0.3); }
.btn-danger:active { transform: scale(0.96); }

/* Table row transitions */
table tr { transition: background 0.15s ease; }
table tbody tr:hover td { background: var(--table-hover); transition: background 0.15s ease; }

/* Badge dark mode fixes */
body.dark-mode .badge-in { background: rgba(39, 174, 96, 0.2); color: #2ecc71; }
body.dark-mode .badge-out { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
body.dark-mode .badge-neutral { background: rgba(52, 152, 219, 0.2); color: #3498db; }

/* Stats card pulse on update */
.stats .card .value { transition: color 0.3s ease, transform 0.15s ease; }

/* Improved focus states */
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(245,179,66,0.18); }
.search-box:focus-within { border-color: var(--gold-accent) !important; box-shadow: 0 0 0 3px rgba(245,179,66,0.12); }

/* ═══ V3 Modernization ═══ */

/* Font & Global Typography */
body { font-family: 'Inter', sans-serif; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.02em; }

/* Floating Dock State (Desktop) */
@media (min-width: 769px) {
    .sidebar { 
        height: calc(100vh - 40px); margin: 20px 0 20px 20px; border-radius: 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    }
    .sidebar.collapsed { width: 80px; }
    .sidebar.collapsed .brand div, .sidebar.collapsed .brand-sub, 
    .sidebar.collapsed nav a span, .sidebar.collapsed .footer-side span { display: none; opacity: 0; }
    .sidebar.collapsed nav a { justify-content: center; padding: 15px; margin: 0 10px; width: calc(100% - 20px); border-radius: 12px; }
    .sidebar.collapsed nav a i { margin-right: 0; font-size: 22px; }
    .sidebar.collapsed .footer-side button { padding: 10px; justify-content: center; }
    .main { transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1); margin-left: 280px; }
    body.sidebar-collapsed .main { margin-left: 110px; }
}

/* Floating Labels Forms */
.form-group.floating { position: relative; margin-bottom: 20px; }
.form-group.floating input, .form-group.floating select, .form-group.floating textarea {
    width: 100%; padding: 20px 15px 8px; border: 1px solid var(--border-input);
    border-radius: 12px; background: var(--input-bg); color: var(--text-primary);
    font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.form-group.floating label {
    position: absolute; top: 18px; left: 15px; font-size: 14px; color: var(--text-muted);
    transition: all 0.2s ease; pointer-events: none;
}
.form-group.floating input:focus, .form-group.floating select:focus {
    border-color: var(--gold-accent); box-shadow: 0 0 0 3px rgba(245,179,66,0.15);
}
.form-group.floating input:focus ~ label, .form-group.floating input:not(:placeholder-shown) ~ label,
.form-group.floating select:focus ~ label, .form-group.floating select:not([value=""]) ~ label {
    top: 6px; font-size: 11px; color: var(--gold-accent);
}

/* Notifications */
.notif-wrapper { position: relative; }
.notif-btn { 
    background: none; border: none; font-size: 20px; color: var(--text-secondary); 
    cursor: pointer; position: relative; padding: 8px; transition: color 0.2s;
}
.notif-btn:hover { color: var(--gold-accent); }
.notif-badge { 
    position: absolute; top: 2px; right: 2px; background: var(--danger); 
    color: white; font-size: 10px; font-weight: bold; width: 16px; height: 16px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
}
.notif-dropdown {
    position: absolute; top: 100%; right: 0; width: 320px; 
    background: rgba(30, 41, 59, 0.85); /* Glassmorphism */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.1);
    display: none; flex-direction: column; z-index: 1000; overflow: hidden;
    transform: translateY(10px); opacity: 0; transition: all 0.2s ease;
}
.notif-dropdown.show { display: flex; transform: translateY(0); opacity: 1; }
.notif-header { padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; }
.notif-header h3 { margin: 0; font-size: 14px; color: white; }
.notif-body { max-height: 350px; overflow-y: auto; }
.notif-item { padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: background 0.2s; }
.notif-item:hover { background: rgba(255,255,255,0.05); }
.notif-item.unread { background: rgba(245, 179, 66, 0.1); }
.notif-item-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; color: #f1f5f9; }
.notif-item-title i.info { color: #3498db; }
.notif-item-title i.warning { color: #f39c12; }
.notif-item-title i.danger { color: #e74c3c; }
.notif-item-title i.success { color: #2ecc71; }
.notif-item-msg { font-size: 12px; color: #cbd5e1; line-height: 1.4; }
.notif-item-time { font-size: 10px; color: #94a3b8; margin-top: 6px; display: block; }

/* Floating Calculator Widget */
.calc-widget { position: fixed; bottom: 30px; right: 30px; z-index: 900; }
.calc-toggle { 
    width: 56px; height: 56px; border-radius: 50%; background: var(--gold-accent); 
    color: #fff; border: none; box-shadow: 0 4px 15px rgba(245, 179, 66, 0.4); 
    font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.calc-toggle:hover { transform: scale(1.05); }
.calc-panel { 
    position: absolute; bottom: 70px; right: 0; width: 300px; 
    background: rgba(30, 41, 59, 0.85); /* Glassmorphism */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1);
    display: none; flex-direction: column; overflow: hidden;
}
.calc-panel.show { display: flex; }
.calc-header { background: rgba(245, 179, 66, 0.9); backdrop-filter: blur(4px); color: white; padding: 15px; display: flex; justify-content: space-between; align-items: center; }
.calc-header h4 { margin: 0; font-size: 16px; }
.calc-header button { background: none; border: none; color: white; font-size: 16px; cursor: pointer; }
.calc-body { padding: 20px; }
.calc-result { text-align: center; font-size: 24px; font-weight: 700; color: var(--gold-accent); margin-top: 15px; }

/* Bottom Navigation (Mobile PWA) */
.bottom-nav { display: none; }

@media (max-width: 768px) {
    /* Sidebar: off-screen by default on mobile */
    .sidebar { 
        transform: translateX(-100%); position: fixed; top: 0; left: 0; 
        height: 100% !important; z-index: 1001; width: 280px; 
        margin: 0 !important; border-radius: 0 !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.open { transform: translateX(0); box-shadow: 5px 0 30px rgba(0,0,0,0.3); }

    /* Main content takes full width on mobile */
    .main { margin-left: 0 !important; padding: 16px 14px 90px 14px !important; }

    /* Topbar stacks better on mobile */
    .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .topbar .actions { width: 100%; justify-content: space-between; }
    .topbar .actions .search-box { flex: 1; }
    .topbar .actions .search-box input { width: 100%; }

    /* Hide some desktop-only UI */
    .dark-toggle span, .lang-toggle span { display: none; }
    .btn-gold span { display: none; }

    /* Stats cards smaller on mobile */
    .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stats .card { padding: 10px 12px; }
    .stats .card .label { font-size: 10px; }
    .stats .card .value { font-size: 16px; }

    /* Tables scroll */
    .table-wrap { border-radius: 10px; }
    table { min-width: 500px; }

    /* Bottom Nav */
    .bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 64px; 
        background: var(--bg-card); border-top: 1px solid var(--border-color); 
        box-shadow: 0 -4px 20px rgba(0,0,0,0.08); z-index: 999; 
        justify-content: space-around; align-items: center;
        padding-bottom: env(safe-area-inset-bottom); /* iPhone notch safe area */
    }
    .bottom-nav a {
        display: flex; flex-direction: column; align-items: center; justify-content: center; 
        color: var(--text-muted); text-decoration: none; font-size: 10px; 
        width: 20%; gap: 3px; padding: 6px 0;
        -webkit-tap-highlight-color: transparent; /* Remove blue tap flash on mobile */
        cursor: pointer;
    }
    .bottom-nav a i { font-size: 20px; transition: color 0.2s; }
    .bottom-nav a.active { color: var(--gold-accent); }
    .bottom-nav a.active i { color: var(--gold-accent); }
    
    .bottom-nav .fab-action {
        width: 52px; height: 52px; background: var(--gold-accent); color: white; border: none; 
        border-radius: 50%; font-size: 22px; display: flex; align-items: center; justify-content: center;
        box-shadow: 0 4px 15px rgba(245, 179, 66, 0.4); transform: translateY(-12px); cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .fab-action:active { transform: translateY(-12px) scale(0.92); }

    /* Notification dropdown full-width on mobile */
    .notif-dropdown { width: calc(100vw - 20px); right: -60px; }

    /* Modal better on mobile */
    .modal { max-width: 100%; width: 100%; border-radius: 16px 16px 0 0; max-height: 85vh; }
    .modal-overlay { align-items: flex-end; }

    /* Hide calc widget on mobile */
    .calc-widget { display: none; }

    /* Section header wraps better */
    .section-header { flex-direction: column; align-items: flex-start; }
    .filter-bar { flex-direction: column; }
}

/* Touch-friendly globally */
@media (pointer: coarse) {
    .btn, .sidebar nav a, .bottom-nav a, .fab-action,
    .notif-btn, .calc-toggle, .dark-toggle, .lang-toggle {
        min-height: 44px; /* Apple minimum tap target */
    }
    .sidebar nav a { padding: 12px 16px; }
}

