/* =========================================
   BASE STYLES
   ========================================= */
* { margin:0; padding:0; box-sizing:border-box; font-family:'Segoe UI', system-ui, sans-serif; }
body { background:#f0f2f7; color:#2c3e50; font-size:14px; }
a { text-decoration:none; color:inherit; }

/* =========================================
   LOGIN PAGE
   ========================================= */
.auth-body {
    display:flex; align-items:center; justify-content:center;
    min-height:100vh;
    background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);
}
.auth-card {
    background:#fff; padding:44px 38px; border-radius:20px;
    width:100%; max-width:400px; box-shadow:0 25px 60px rgba(0,0,0,.25);
}
.auth-logo { font-size:52px; text-align:center; margin-bottom:8px; }
.auth-card h1 { text-align:center; font-size:26px; margin-bottom:6px; color:#1a1a2e; }
.auth-sub { text-align:center; color:#888; margin-bottom:26px; font-size:13px; }
.auth-card label { display:block; margin-bottom:6px; font-weight:600; font-size:12px; color:#555; text-transform:uppercase; letter-spacing:.5px; }
.auth-card input { width:100%; padding:12px 14px; border:2px solid #e8ecf3; border-radius:10px; margin-bottom:16px; font-size:14px; transition:.2s; }
.auth-card input:focus { outline:none; border-color:#667eea; }
.auth-foot { text-align:center; font-size:11px; color:#aaa; margin-top:20px; }

/* =========================================
   LAYOUT & MODERN SIDEBAR
   ========================================= */
.layout { display:flex; min-height:100vh; }

.sidebar {
    width: 260px;
    background: #1e1e2d;
    color: #fff;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 100;
}

/* Brand / Logo */
.sidebar .brand {
    font-size: 20px;
    font-weight: 800;
    padding: 0 10px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
    color: #fff;
}
.sidebar .brand span {
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Nav Links */
.sidebar nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar nav a {
    padding: 12px 16px;
    border-radius: 10px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.sidebar nav a .nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar nav a .nav-icon {
    width: 20px;
    height: 20px;
    transition: 0.25s ease;
}

/* Hover Effect */
.sidebar nav a:hover {
    background: rgba(255,255,255,0.04);
    color: #fff;
}
.sidebar nav a:hover .nav-icon {
    transform: scale(1.1);
}

/* Active Page Style */
.sidebar nav a.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, transparent 100%);
    color: #fff;
    border-left: 3px solid #667eea;
    padding-left: 13px;
}
.sidebar nav a.active .nav-icon {
    color: #667eea;
}

/* PRO Badge Style */
.pro-badge {
    font-size: 9px;
    font-weight: 900;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.1);
}

/* User Box */
.user-box { display:flex; gap:10px; align-items:center; padding:14px 10px; border-top:1px solid rgba(255,255,255,.1); margin-top:16px; }
.avatar { width:38px; height:38px; border-radius:50%; background:linear-gradient(135deg,#667eea,#764ba2); display:flex; align-items:center; justify-content:center; font-weight:700; }
.u-name { font-weight:600; font-size:13px; }
.u-role { font-size:11px; color:#8b94b0; }
.logout { padding:10px; text-align:center; background:rgba(255,255,255,.05); border-radius:10px; font-size:13px; margin-top:8px; color:#ff8a8a; transition: 0.2s; }
.logout:hover { background:rgba(255,0,0,.15); }

.main { flex:1; padding:32px 40px; max-width:1400px; }
.page-title { font-size:24px; margin-bottom:24px; color:#1a1a2e; }

/* =========================================
   STATS CARDS
   ========================================= */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; margin-bottom:28px; }
.stat-card { background:#fff; padding:22px; border-radius:14px; display:flex; gap:16px; align-items:center; box-shadow:0 2px 12px rgba(0,0,0,.04); transition:.2s; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,0,0,.08); }
.stat-icon { width:52px; height:52px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:22px; }
.stat-icon.blue   { background:#e8f0fe; }
.stat-icon.green  { background:#e6f9f0; }
.stat-icon.red    { background:#ffe8e8; }
.stat-icon.purple { background:#f0e6ff; }
.stat-label { font-size:12px; color:#888; text-transform:uppercase; letter-spacing:.5px; font-weight:600; }
.stat-value { font-size:22px; font-weight:700; color:#1a1a2e; margin-top:2px; }
.stats-grid.mini { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stats-grid.mini .stat-card { padding: 16px; }
.stats-grid.mini .stat-icon { width: 42px; height: 42px; font-size: 18px; }
.stats-grid.mini .stat-value { font-size: 18px; }

/* =========================================
   CARDS & TABLES
   ========================================= */
.card { background:#fff; border-radius:14px; box-shadow:0 2px 12px rgba(0,0,0,.04); margin-bottom:24px; overflow:hidden; }
.card-head { padding:18px 24px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid #eef1f6; }
.card-head h2 { font-size:16px; color:#1a1a2e; }
.table { width:100%; border-collapse:collapse; }
.table th { text-align:left; padding:12px 16px; background:#f8fafc; font-size:11px; text-transform:uppercase; color:#7c8aa0; letter-spacing:.5px; border-bottom:1px solid #eef1f6; }
.table td { padding:14px 16px; border-bottom:1px solid #f3f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom:none; }
.table tr:hover td { background:#fafbfd; }
.table .empty { text-align:center; padding:36px; color:#aaa; font-style:italic; }
.table-wrap { overflow-x:auto; }

/* =========================================
   FORMS
   ========================================= */
.form label { display:block; margin:0 0 6px; font-size:12px; font-weight:600; color:#555; }
.form input, .form select, .form textarea {
    width:100%; padding:10px 12px; border:2px solid #e8ecf3; border-radius:8px;
    margin-bottom:14px; font-size:13px; font-family:inherit;
}
.form input:focus, .form select:focus, .form textarea:focus { outline:none; border-color:#667eea; }
.grid-form { display:grid; grid-template-columns:repeat(3,1fr); gap:0 16px; padding:20px 24px; }
.grid-form .full { grid-column:1/-1; }
.grid-2col { display:grid; grid-template-columns:1fr 2fr; gap:24px; }
.inline-form select { padding:8px 12px; border:2px solid #e8ecf3; border-radius:8px; }

/* =========================================
   BUTTONS
   ========================================= */
.btn-primary { background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; border:none; padding:11px 22px; border-radius:10px; font-weight:600; cursor:pointer; font-size:13px; transition:.2s; }
.btn-primary:hover { transform:translateY(-1px); box-shadow:0 6px 16px rgba(102,126,234,.4); }
.btn-full { width:100%; }
.btn-sm { padding:6px 10px; border:none; background:#eef1f6; border-radius:6px; cursor:pointer; font-size:14px; }
.btn-sm:hover { background:#dde3ed; }
.btn-sm.danger { background:#ffe8e8; }
.btn-sm.danger:hover { background:#ffd0d0; }

/* =========================================
   BADGES & ALERTS
   ========================================= */
.badge { display:inline-block; padding:3px 10px; border-radius:6px; font-size:11px; font-weight:600; background:#eef1f6; color:#4a5568; }
.badge.active { background:#e6f9f0; color:#0a8a4f; }
.badge.inactive { background:#ffe8e8; color:#c0392b; }
.badge.buy { background:#e6f9f0; color:#0a8a4f; }
.badge.sell { background:#ffe8e8; color:#c0392b; }
.pos { color:#0a8a4f; }
.neg { color:#c0392b; }
.alert { padding:12px 16px; border-radius:10px; margin-bottom:20px; font-size:13px; font-weight:500; }
.alert.success { background:#e6f9f0; color:#0a8a4f; border-left:4px solid #0a8a4f; }
.alert.error { background:#ffe8e8; color:#c0392b; border-left:4px solid #c0392b; }

/* =========================================
   RESULT TOGGLE (Profit/Loss) & AMOUNT
   ========================================= */
.result-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.result-option { position: relative; cursor: pointer; }
.result-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.result-box { padding: 18px 14px; border: 2px solid #e8ecf3; border-radius: 12px; text-align: center; transition: all .2s; background: #fff; }
.result-box .r-icon  { font-size: 30px; line-height: 1; }
.result-box .r-label { font-weight: 700; font-size: 14px; margin-top: 8px; letter-spacing: .5px; }
.result-box .r-sub   { font-size: 11px; color: #888; margin-top: 2px; }

.result-option input:checked + .result-box.profit-box { border-color: #0a8a4f; background: #e6f9f0; box-shadow: 0 0 0 4px rgba(10,138,79,.12); }
.result-option input:checked + .result-box.profit-box .r-label { color: #0a8a4f; }
.result-option input:checked + .result-box.loss-box { border-color: #c0392b; background: #ffe8e8; box-shadow: 0 0 0 4px rgba(192,57,43,.12); }
.result-option input:checked + .result-box.loss-box .r-label { color: #c0392b; }
.result-option:hover .result-box { transform: translateY(-1px); }

.amount-preview { padding: 12px 16px; border-radius: 10px; font-weight: 700; font-size: 15px; margin-bottom: 14px; text-align: center; transition: all .2s; }
.amount-preview.pos { background: #e6f9f0; color: #0a8a4f; border-left: 4px solid #0a8a4f; }
.amount-preview.neg { background: #ffe8e8; color: #c0392b; border-left: 4px solid #c0392b; }

/* =========================================
   TABS (Account page)
   ========================================= */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #eef1f6; margin-bottom: 24px; }
.tab-btn { padding: 12px 22px; background: none; border: none; cursor: pointer; font-size: 14px; font-weight: 600; color: #7c8aa0; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: .2s; }
.tab-btn:hover { color: #667eea; }
.tab-btn.active { color: #667eea; border-bottom-color: #667eea; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.pro-tabs { display: inline-flex; background: #eef1f6; padding: 6px; border-radius: 12px; margin-bottom: 28px; }
.pro-tab-btn { padding: 10px 24px; border: none; background: transparent; font-size: 14px; font-weight: 600; color: #64748b; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px; }
.pro-tab-btn:hover { color: #1e293b; }
.pro-tab-btn.active { background: #fff; color: #667eea; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* =========================================
   PROFESSIONAL TRADE FORM UI
   ========================================= */
.pro-card { background: #fff; border-radius: 16px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03); border: 1px solid #eef1f6; margin-bottom: 28px; overflow: hidden; }
.pro-card-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 20px 26px; color: #fff; display: flex; align-items: center; gap: 12px; }
.pro-card-header h2 { font-size: 18px; margin: 0; color: #fff; font-weight: 600; }
.pro-card-header p { font-size: 12px; margin: 2px 0 0; opacity: 0.8; }

.pro-form-body { padding: 26px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }
.form-group.span-4 { grid-column: span 4; }

.form-group label { font-size: 12px; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input[type="text"], .form-group input[type="number"], .form-group input[type="date"], .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; color: #1e293b; background: #f8fafc; transition: all 0.2s ease; box-sizing: border-box;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #667eea; background: #fff; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15); }

.result-toggle-sm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-toggle-sm .result-box { padding: 10px; border: 2px solid #cbd5e1; border-radius: 8px; text-align: center; font-weight: 700; font-size: 13px; color: #64748b; background: #f8fafc; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 6px; }
.result-toggle-sm .result-option input:checked + .result-box.profit-box { border-color: #10b981; background: #ecfdf5; color: #047857; }
.result-toggle-sm .result-option input:checked + .result-box.loss-box { border-color: #ef4444; background: #fef2f2; color: #b91c1c; }

.pro-image-upload { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed #cbd5e1; border-radius: 8px; padding: 12px; background: #f8fafc; cursor: pointer; transition: all 0.2s; min-height: 48px; position: relative; overflow: hidden; }
.pro-image-upload:hover { border-color: #667eea; background: #f0f4ff; }
.pro-image-upload input[type="file"] { display: none; }
.pro-image-upload .upload-text { font-size: 13px; color: #64748b; font-weight: 500; }
.pro-image-upload.has-file { border-color: #10b981; background: #ecfdf5; border-style: solid; padding: 0; }
.pro-image-upload img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; }

.btn-submit-pro { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; border: none; padding: 14px 24px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); width: 100%; height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-submit-pro:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4); }

/* =========================================
   ACCOUNT PAGE PROFESSIONAL UI
   ========================================= */
.pro-list-item { display: flex; align-items: center; padding: 16px 20px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 12px; transition: all 0.2s ease; }
.pro-list-item:hover { border-color: #cbd5e1; box-shadow: 0 4px 12px rgba(0,0,0,0.03); transform: translateY(-1px); }
.pro-list-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-right: 16px; flex-shrink: 0; }
.pro-list-icon.green { background: #ecfdf5; color: #10b981; }
.pro-list-icon.red { background: #fef2f2; color: #ef4444; }
.pro-list-icon.purple { background: #f3e8ff; color: #9333ea; }
.pro-list-icon.blue { background: #eff6ff; color: #3b82f6; }
.pro-list-content { flex-grow: 1; }
.pro-list-title { font-weight: 700; color: #1e293b; font-size: 15px; margin-bottom: 2px; }
.pro-list-subtitle { font-size: 13px; color: #64748b; }
.pro-list-action { margin-left: 16px; }

.pro-empty-state { text-align: center; padding: 40px 20px; color: #94a3b8; border: 2px dashed #e2e8f0; border-radius: 12px; background: #f8fafc; }
.pro-empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

/* Capital Type Toggle Fix */
.result-box.deposit-box, .result-box.withdraw-box { border: 2px solid #cbd5e1; color: #64748b; background: #f8fafc; transition: all 0.2s ease; }
.result-option input:checked + .result-box.deposit-box { border-color: #10b981; background: #ecfdf5; color: #047857; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.result-option input:checked + .result-box.withdraw-box { border-color: #ef4444; background: #fef2f2; color: #b91c1c; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }

/* =========================================
   REPORTS PAGE
   ========================================= */
.filter-bar { background: #fff; padding: 16px 24px; border-radius: 12px; border: 1px solid #e2e8f0; display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 24px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.filter-bar .form-group { margin: 0; flex: 1; min-width: 150px; }
.filter-bar select, .filter-bar input { padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; width: 100%; background: #f8fafc; }
.btn-export { background: #1e293b; color: #fff; padding: 10px 20px; border-radius: 8px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; height: 42px; transition: 0.2s; }
.btn-export:hover { background: #0f172a; }
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 24px; }

/* =========================================
   PDF / PRINT STYLES
   ========================================= */
@media print {
    body { background: #fff; font-size: 12px; }
    .sidebar, .filter-bar, .btn-export, .no-print { display: none !important; }
    .main { padding: 0 !important; margin: 0 !important; width: 100% !important; }
    .pro-card { border: none !important; box-shadow: none !important; }
    .pro-card-header { background: #f1f5f9 !important; color: #000 !important; }
    .table th { background: #f8fafc !important; color: #000 !important; }
    .table td, .table th { border-bottom: 1px solid #ddd !important; }
    .stat-card { border: 1px solid #ddd !important; box-shadow: none !important; }
    a { text-decoration: none !important; color: #000 !important; }
    .page-break { page-break-before: always; }
}

/* =========================================
   SUBSCRIPTION PRICING CARDS
   ========================================= */
.pricing-section { margin-top: 40px; margin-bottom: 20px; }
.pricing-header { text-align: center; margin-bottom: 32px; }
.pricing-header h2 { font-size: 24px; color: #1e293b; margin-bottom: 8px; }
.pricing-header p { color: #64748b; font-size: 14px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: start; }
.pricing-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 32px 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); transition: all 0.3s ease; position: relative; display: flex; flex-direction: column; }
.pricing-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.08); border-color: #cbd5e1; }
.pricing-card.popular { border: 2px solid #667eea; box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15); transform: scale(1.02); }
.pricing-card.popular:hover { transform: scale(1.02) translateY(-5px); }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 4px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.plan-name { font-size: 18px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.plan-desc { font-size: 13px; color: #64748b; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eef1f6; }
.plan-price { font-size: 36px; font-weight: 800; color: #1e293b; line-height: 1; margin-bottom: 4px; }
.plan-price span { font-size: 15px; font-weight: 600; color: #94a3b8; }
.plan-price-lkr { font-size: 13px; color: #667eea; font-weight: 600; margin-bottom: 24px; }
.plan-features { list-style: none; padding: 0; margin: 0 0 32px 0; flex-grow: 1; }
.plan-features li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: #475569; margin-bottom: 14px; line-height: 1.4; }
.plan-features .check { color: #10b981; font-size: 16px; line-height: 1; }
.btn-plan { display: block; width: 100%; padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; transition: all 0.2s; cursor: pointer; border: none; }
.btn-plan-free { background: #f1f5f9; color: #475569; }
.btn-plan-free:hover { background: #e2e8f0; }
.btn-plan-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); }
.btn-plan-primary:hover { box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4); transform: translateY(-1px); }

/* =========================================
   ADMIN USER TABLE IMPROVEMENTS
   ========================================= */
.plan-select { padding: 5px 10px; border-radius: 6px; border: 1px solid #cbd5e1; font-size: 12px; font-weight: 700; outline: none; cursor: pointer; transition: all 0.2s; appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 6px center; background-size: 12px; padding-right: 24px; }
.plan-select:hover { border-color: #94a3b8; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: none; background: #f1f5f9; border-radius: 6px; font-size: 14px; cursor: pointer; transition: all 0.2s; text-decoration: none; color: #1e293b; }
.btn-icon:hover { background: #e2e8f0; transform: translateY(-1px); }
.btn-icon.danger { background: #fee2e2; color: #ef4444; }
.btn-icon.danger:hover { background: #fecaca; }
.table th:nth-child(1) { width: 35%; }
.table th:nth-child(2) { width: 10%; }
.table th:nth-child(3) { width: 15%; }
.table th:nth-child(4) { width: 10%; }
.table th:nth-child(5) { width: 30%; }

/* =========================================
   RESPONSIVE (Mobile/Tablet)
   ========================================= */
@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .main { padding: 20px; }
    .grid-2col, .chart-grid { grid-template-columns: 1fr; }
    .grid-form { grid-template-columns: 1fr; }
    .pro-form-body { grid-template-columns: repeat(2, 1fr); }
    .form-group.span-3, .form-group.span-4 { grid-column: span 2; }
}

@media (max-width: 600px) {
    .pro-form-body { grid-template-columns: 1fr; }
    .form-group.span-2, .form-group.span-3, .form-group.span-4 { grid-column: span 1; }
}
/* =========================================
   MODERN DASHBOARD UI (Compact & Single Row)
   ========================================= */

/* Section Titles */
.dash-section-title {
    font-size: 11px;
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
    margin-left: 12px;
}

/* 4-Column Grid Layout */
.stats-grid-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px; /* කාඩ්පත් අතර පරතරය අඩු කළා */
    margin-bottom: 24px;
}

/* Responsive Breakpoints (Mobile සඳහා) */
@media (max-width: 1100px) {
    .stats-grid-modern { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .stats-grid-modern { grid-template-columns: 1fr; }
}

/* Compact Stat Cards */
.stat-card-modern {
    background: #fff;
    padding: 16px 18px; /* ඇතුලත ඉඩ අඩු කළා */
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid #f1f5f9;
    transition: all 0.25s ease;
}
/* Mouse එක ගෙනිච්චම එන Color Effect එක */
.stat-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.12); 
    border-color: #cbd5e1;
}

.stat-icon-modern {
    width: 44px; /* අයිකන් එක පොඩි කළා */
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon-modern svg {
    width: 22px;
    height: 22px;
}

/* Icon Colors */
.icon-blue { background: #eff6ff; color: #3b82f6; }
.icon-green { background: #ecfdf5; color: #10b981; }
.icon-red { background: #fef2f2; color: #ef4444; }
.icon-purple { background: #f5f3ff; color: #8b5cf6; }
.icon-orange { background: #fff7ed; color: #f59e0b; }

.stat-info { 
    flex: 1; 
    min-width: 0; /* අකුරු දිග වැඩි වුනාම එලියට යන එක නවත්තන්න */
}
.stat-info .stat-label {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-info .stat-value {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
    white-space: nowrap;
}

/* Table Enhancements */
.table-modern th {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    padding: 14px 16px;
    background: transparent;
}
.table-modern td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.table-modern tr:hover td {
    background: #f8fafc;
}
/* =========================================
   MOBILE & PWA RESPONSIVE STYLES
   ========================================= */

/* Mobile Top Bar (Default වශයෙන් Desktop එකේ හංගලා තියෙන්නේ) */
.mobile-topbar {
    display: none !important; /* බලෙන්ම හංගන්න */
    background: #1e1e2d;
    color: #fff;
    padding: 12px 20px;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.mobile-topbar .brand {
    border: none;
    margin: 0;
    padding: 0;
    font-size: 16px;
}
.hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    backdrop-filter: blur(2px);
}

@media (max-width: 900px) {
    /* Top Bar එක මොබයිල් එකේදී විතරක් පෙන්නන්න */
    .mobile-topbar {
        display: flex !important;
    }

    /* Layout එක Column එකක් කරන්න */
    .layout {
        flex-direction: column;
        padding-top: 60px; /* Top bar එකට ඉඩ තියන්න */
    }

    /* Sidebar එක හංගලා Slide වෙන විදියට හදන්න */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* මුලින්ම ඉවත් කරලා තියන්න */
        width: 260px;
        height: 100vh;
        z-index: 1001;
        transition: left 0.3s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
    }
    .sidebar.active {
        left: 0; /* ක්ලික් කරාම ඇතුලට එන්න */
    }
    .mobile-close {
        display: block !important;
    }
    .sidebar-overlay.active {
        display: block;
    }

    /* Main Area Adjustments */
    .main {
        padding: 20px 15px;
        width: 100%;
        overflow-x: hidden;
    }

    /* Tables එක Mobile වලදි Scroll වෙන්න */
    .table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Forms 1 Column එකක් කරන්න */
    .grid-form, .grid-2col, .pro-form-body, .stats-grid-modern {
        grid-template-columns: 1fr !important;
    }
    .form-group.span-2, .form-group.span-3, .form-group.span-4 {
        grid-column: span 1 !important;
    }

    /* Charts Mobile වලදි හරියට පෙන්නන්න */
    .chart-grid {
        grid-template-columns: 1fr !important;
    }

    /* Page Title එක පොඩි කරන්න */
    .page-title {
        font-size: 20px;
    }
}

/* =========================================
   LANDING PAGE STYLES (FULL DARK THEME)
   ========================================= */
.landing-body-dark {
    background-color: #0f172a;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-attachment: fixed;
    color: #f8fafc;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
}

/* Navbar */
.landing-nav-dark {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.landing-brand-dark {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}
.landing-brand-dark span {
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.btn-nav-login {
    background: #667eea;
    color: #ffffff !important;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: inline-block;
}
.btn-nav-login:hover {
    background: #5a6fd6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Hero Section */
.hero-dark {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 80px 5%;
    min-height: 85vh;
}
.hero-text-dark {
    flex: 1;
    max-width: 600px;
}
.hero-text-dark h1 {
    font-size: 52px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}
.hero-text-dark h1 span {
    background: linear-gradient(135deg, #667eea, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-text-dark p {
    font-size: 16px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 32px;
}
.hero-badges-dark {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.hero-badge-dark {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}
.hero-badge-dark svg {
    width: 16px;
    height: 16px;
}

/* Features Grid */
.features-dark {
    padding: 80px 5%;
    text-align: center;
}
.features-dark h2 {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
}
.features-dark p.subtitle {
    color: #94a3b8;
    margin-bottom: 50px;
    font-size: 16px;
}
.feature-grid-dark {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}
.feature-card-dark {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px;
    border-radius: 20px;
    text-align: left;
    transition: 0.3s ease;
}
.feature-card-dark:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.feature-icon-dark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.feature-icon-dark svg {
    width: 26px;
    height: 26px;
}
/* Icon Background Colors */
.icon-bg-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.icon-bg-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-bg-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.icon-bg-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.icon-bg-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.icon-bg-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.feature-card-dark h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 10px;
    font-weight: 700;
}
.feature-card-dark p {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0;
}

/* Register Card */
.register-dark-section {
    padding: 60px 5%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.register-card-dark {
    background: rgba(255, 255, 255, 0.98);
    padding: 44px 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.register-card-dark h2 {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}
.register-card-dark p {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 28px;
    font-weight: 500;
}
.register-card-dark label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.register-card-dark input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box;
}
.register-card-dark input:focus {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

@media (max-width: 900px) {
    .hero-dark {
        flex-direction: column;
        text-align: center;
        padding: 40px 5%;
    }
    .hero-text-dark h1 { font-size: 38px; }
    .hero-badges-dark { justify-content: center; }
    .hero-image-dark { margin-top: 40px; }
    .landing-nav-dark .landing-nav-links { display: none; }
}