@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

:root {
    --bg-main: #F4F7FE;
    --bg-white: #FFFFFF;
    --sidebar-bg: #111C44;
    --text-dark: #2B3674;
    --text-muted: #A3AED0;
    --primary: #4318FF;
    --secondary: #6AD2FF;
    --danger: #E31A1A;
    --success: #05CD99;
    --warning: #FFB547;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: 'DM Sans', sans-serif;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* LAYOUT */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* OVERLAY FOR MOBILE */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    transition: transform 0.3s ease;
    z-index: 100;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.logo span {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: 0.2s;
    font-weight: 500;
}

/* CARD STYLING REFINEMENT */
.white-card,
.status-card,
.entity-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 2rem;
    /* Increased padding */
    box-shadow: 0px 18px 40px rgba(112, 144, 176, 0.08);
    /* Softer shadow */
    border: 1px solid rgba(255, 255, 255, 0.6);
    /* Subtle border for pop */
}

/* SIDEBAR ACTIVE STATE */
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-right: 4px solid var(--primary);
    border-left: 4px solid var(--secondary);
    /* Added Left Border for accent */
}

/* FLOW BADGES (Pastel) */
.flow-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.flow-badge.deposit {
    background: rgba(5, 205, 153, 0.15);
    color: #018E68;
    /* Darker text for contrast */
}

.flow-badge.wd {
    background: rgba(227, 26, 26, 0.1);
    color: #E31A1A;
}

/* FORM GRID OPTIMIZATION (2 Columns) */
.deposit-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 Columns */
    gap: 20px;
    align-items: end;
}

/* TABLE REFINEMENT */
th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    padding: 15px 12px;
    font-size: 0.85rem;
    border-bottom: 2px solid #E9EDF7;
    /* Thicker header border */
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

td {
    padding: 18px 12px;
    /* More breathing room */
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 1px solid #F0F2F8;
    /* Subtle row separator */
}

/* Right align numbers - REMOVED per user request for Left Align */
.num-col {
    text-align: right;
}

/* Hover Action Icons */
.action-btn-group {
    opacity: 0.3;
    transition: opacity 0.2s;
}

tr:hover .action-btn-group {
    opacity: 1;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    letter-spacing: 1px;
}

.add-account-btn {
    border: 1px dashed rgba(255, 255, 255, 0.3);
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.add-account-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
    border-right: none;
}

.sidebar-footer {
    margin-top: auto;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.8rem;
}

.user-info .name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-info .role {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* MAIN CONTENT */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* TOP BAR */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

.breadcrumb {
    font-size: 0.9rem;
    font-weight: 500;
}

.current-page {
    color: #111C44;
    font-weight: 800;
    font-size: 1.8rem;
    display: block;
    margin-top: 5px;
}

.search-bar {
    background: var(--bg-white);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.02);
    width: 300px;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-family: 'DM Sans';
}

/* VIEW LOGIC */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* DASHBOARD GRID */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0px 18px 40px rgba(112, 144, 176, 0.12);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-purple {
    background: rgba(67, 24, 255, 0.1);
    color: var(--primary);
}

.icon-blue {
    background: rgba(57, 101, 255, 0.1);
    color: #3965FF;
}

.icon-orange {
    background: rgba(255, 181, 71, 0.1);
    color: var(--warning);
}

.icon-green {
    background: rgba(5, 205, 153, 0.1);
    color: var(--success);
}

.card-info .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.card-info .value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 2px 0;
}

.card-info .sub-text {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 700;
}

/* MAIN PANEL GRID */
.main-panel-grid {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

.white-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0px 18px 40px rgba(112, 144, 176, 0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
}

/* INPUT FORM */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #E0E5F2;
    border-radius: 10px;
    font-family: 'DM Sans';
    outline: none;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 14px;
    color: var(--text-muted);
}

.input-with-icon input {
    padding-left: 35px;
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #3311CC;
}

/* TABLE */
.table-responsive {
    overflow-x: auto;
}

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

th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid #E9EDF7;
    white-space: nowrap;
}

td {
    padding: 15px 12px;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 1px solid #E9EDF7;
}

tr:last-child td {
    border-bottom: none;
}

/* TABLE PILLS & DISTRIBUTION */
.distribution-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.pill.purple {
    background: rgba(67, 24, 255, 0.1);
    color: var(--primary);
    border-color: rgba(67, 24, 255, 0.2);
}

.pill.blue {
    background: rgba(106, 210, 255, 0.1);
    color: #0099FF;
    border-color: rgba(106, 210, 255, 0.3);
}

.pill.orange {
    background: rgba(255, 181, 71, 0.1);
    color: var(--warning);
    border-color: rgba(255, 181, 71, 0.3);
}

.pill.green {
    background: rgba(5, 205, 153, 0.1);
    color: var(--success);
    border-color: rgba(5, 205, 153, 0.3);
}

.del-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.del-btn:hover {
    color: var(--danger);
}

/* SETTINGS */
.settings-form {
    max-width: 600px;
    margin: 0 auto;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.s-title {
    display: block;
    font-weight: 700;
    color: var(--text-dark);
}

.s-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.input-col input {
    width: 80px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
    text-align: center;
    font-weight: 700;
}

.total-check {
    text-align: right;
    font-weight: 700;
    margin: 2rem 0;
    font-size: 1.2rem;
}

.valid {
    color: var(--success);
}

.invalid {
    color: var(--danger);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.btn-danger {
    background: var(--bg-main);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    flex: 1;
}

/* HERO CARD & DEPOSIT FORM */
.hero-card {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #111C44 0%, #324483 100%);
    color: white;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.hero-volume-box {
    text-align: right;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 12px;
}

.hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.deposit-form-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.cashflow-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.entity-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0px 18px 40px rgba(112, 144, 176, 0.12);
}

.entity-card h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin: 10px 0;
}

/* RECOMMENDATION BANNER */
.rec-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 1.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    transition: 0.3s;
    box-shadow: 0px 18px 40px rgba(112, 144, 176, 0.12);
    background: #fff;
}

.rec-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.rec-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.rec-content p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
    color: var(--text-dark);
}

/* VARIANT: SCALING READY (Green) */
.rec-banner.ready {
    background: linear-gradient(135deg, #05CD99 0%, #02A176 100%);
}

.rec-banner.ready .rec-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.rec-banner.ready h4,
.rec-banner.ready p {
    color: white;
}

/* VARIANT: ACCUMULATE (Orange) */
.rec-banner.hold {
    background: linear-gradient(135deg, #FFB547 0%, #E5941F 100%);
}

.rec-banner.hold .rec-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.rec-banner.hold h4,
.rec-banner.hold p {
    color: white;
}

/* EXECUTE SCALE UP BUTTON */
.btn-execute-scale {
    background: white;
    color: #05CD99;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: 0.2s;
    margin-left: 15px;
    white-space: nowrap;
}

.btn-execute-scale:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: #f8fefd;
}

.btn-execute-scale:active {
    transform: translateY(0);
}


/* PILL GREEN (For Reward) */
.pill.green {
    background: rgba(5, 205, 153, 0.1);
    color: var(--success);
}

/* EVALUATION CARD */
.eval-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0px 18px 40px rgba(112, 144, 176, 0.12);
    margin-top: 1.5rem;
    border-left: 5px solid var(--primary);
}

.eval-card h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.eval-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* CURRENCY TOGGLE */
.input-group-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group-row .input-with-icon {
    flex: 1;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #E0E5F2;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

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

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

#currency-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    min-width: 60px;
}

/* FILTER & SORT CONTROLS */
.header-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-controls {
    display: flex;
    gap: 10px;
}

.card-controls select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #E0E5F2;
    font-family: 'DM Sans';
    font-size: 0.85rem;
    color: var(--text-dark);
    outline: none;
    cursor: pointer;
    background-color: #f8f9fc;
}

.card-controls select:hover {
    border-color: var(--primary);
}

@media (min-width: 768px) {
    .header-title {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
}

/* ANALYTICS & CHART */
canvas {
    width: 100% !important;
    height: 100% !important;
}

#analyticsTable th,
#manageAccountsTable th {
    background: #F4F7FE;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

#analyticsTable td,
#manageAccountsTable td {
    vertical-align: middle;
}

/* Edit/Delete Buttons in Tables */
.edit-btn:hover {
    background: rgba(67, 24, 255, 0.2) !important;
}

.del-btn:hover {
    color: #E31A1A !important;
    background: rgba(227, 26, 26, 0.1);
    border-radius: 5px;
}


.roi-hero {
    background: linear-gradient(135deg, #111C44 0%, #324483 100%);
    color: white;
    padding: 2rem;
    border-radius: 25px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 10px 30px rgba(17, 28, 68, 0.2);
}

.roi-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 5px 0;
}

.roi-chart {
    flex: 1;
    margin-left: 3rem;
    max-width: 400px;
}

.flow-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    margin-bottom: 10px;
}

.flow-segment.in {
    background: #E31A1A;
}

/* Red for Deposit (Risk In) */
.flow-segment.out {
    background: #05CD99;
}

/* Green for WD (Safe Out) */
.flow-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.8;
}

.entity-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 5rem;
    opacity: 0.05;
    transform: rotate(15deg);
}

/* TABLE TYPE BADGES */
.flow-badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
}

.flow-badge.deposit {
    background: rgba(227, 26, 26, 0.1);
    color: #E31A1A;
}

.flow-badge.wd {
    background: rgba(5, 205, 153, 0.1);
    color: #05CD99;
}

/* TYPE SELECTOR RADIO */
.type-selector input[type="radio"] {
    display: none;
}

.radio-label {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: 1px solid #E0E5F2;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.2s;
    color: var(--text-muted);
}

.radio-label:hover {
    background: #f8f9fc;
}

input#typeProfit:checked+.radio-label.profit {
    background: rgba(5, 205, 153, 0.1);
    border-color: var(--success);
    color: var(--success);
}

input#typeDeposit:checked+.radio-label.deposit {
    background: rgba(227, 26, 26, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* --- MODAL STYLES --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    margin: 0;
    color: var(--secondary);
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #A3AED0;
}

.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body label {
    display: block;
    margin-bottom: 5px;
    color: #A3AED0;
    font-size: 0.9rem;
}

.modal-body input {
    width: 100%;
    padding: 12px;
    border: 1px solid #E0E5F2;
    border-radius: 10px;
    font-size: 1rem;
    color: var(--secondary);
}

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

.btn-cancel {
    background: #F4F7FE;
    color: #A3AED0;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
}

.btn-cancel:hover {
    background: #E0E5F2;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* MOBILE RESPONSIVE TWEAKS */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: 80%;
        max-width: 300px;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
        z-index: 999;
        /* Ensure sidebar is above sticky header */
        transition: transform 0.3s ease;
        /* Smooth toggle */
    }

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

    .menu-toggle {
        display: block;
    }

    .app-layout {
        flex-direction: column;
        height: auto;
    }

    .logo {
        margin-bottom: 1rem;
    }

    .content-area {
        padding: 1rem;
    }

    .main-panel-grid {
        grid-template-columns: 1fr;
    }

    .top-bar {
        gap: 15px;
        flex-wrap: wrap;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 50;
        background: rgba(255, 255, 255, 0.9);
        /* Light mode default */
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1rem 1.5rem;
        /* Consistent padding */
        margin-bottom: 0;
        /* Remove margin as it's floating */
    }

    body.dark-mode .top-bar {
        background: rgba(15, 23, 42, 0.85);
        /* Slate-900 with opacity */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }


    .search-bar {
        width: 100%;
        order: 3;
    }

    .breadcrumb {
        margin-left: auto;
    }

    /* Hero Card Mobile */
    .hero-header {
        flex-direction: column;
        gap: 15px;
    }

    .hero-volume-box {
        width: 100%;
        text-align: left;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .cashflow-grid {
        grid-template-columns: 1fr;
    }

    /* Deposit Form Mobile */
    .deposit-form-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .deposit-form-grid button {
        margin-top: 10px;
    }

    /* Table Mobile */
    td,
    th {
        padding: 10px 5px;
        font-size: 0.8rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card-controls {
        flex-wrap: wrap;
    }
}


/* --- NEW MODAL STYLES (Phase 12) --- */

/* Animation */
@keyframes modalSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Modal */
.modal-dark {
    background: rgba(30, 41, 59, 0.95) !important;
    /* Slate-800 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-dark .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-dark h3 {
    color: #f8fafc !important;
    /* Slate-50 */
}

.modal-dark .close-modal {
    color: #94a3b8;
}

.modal-dark .close-modal:hover {
    color: #fff;
}

.modal-dark label {
    color: #cbd5e1 !important;
    /* Slate-300 */
}

/* Dark Input Styling */
.modal-dark input,
.modal-dark select.form-input {
    background-color: #0f172a !important;
    /* Slate-900 */
    border: 1px solid #334155 !important;
    color: white !important;
}

.modal-dark input:focus,
.modal-dark select.form-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(67, 24, 255, 0.2);
}

.modal-dark .input-with-icon i {
    color: #64748b !important;
    /* Slate-500 */
}

/* Custom Select styling to match input */
select.form-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    /* padding for icon */
    border-radius: 10px;
    appearance: none;
    /* Use a simple arrow or reuse existing font awesome if possible, but keep it simple here */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* Loader */
.loader {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Button States */
.btn-primary:active {
    transform: scale(0.98);
}

/* --- ANTIGRAVITY SYNC UI --- */
.antigravity-sync-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 41, 59, 1);
    /* slate-800 */
    padding: 1rem;
    border-radius: 1rem;
    /* rounded-xl */
    border: 1px solid rgba(51, 65, 85, 1);
    /* slate-700 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-top: 15px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.sync-content {
    display: flex;
    flex-direction: column;
}

.sync-label {
    font-size: 0.75rem;
    /* text-xs */
    color: #94a3b8;
    /* slate-400 */
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.sync-value-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sync-currency {
    font-size: 1.25rem;
    /* text-xl */
    font-family: monospace;
    font-weight: 700;
    color: #34d399;
    /* emerald-400 */
}

.sync-display {
    background: transparent;
    font-size: 1.25rem;
    font-family: monospace;
    font-weight: 700;
    color: #34d399;
    /* emerald-400 */
    border: none;
    outline: none;
    width: 120px;
}

.sync-btn-floating {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #4f46e5;
    /* indigo-600 */
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.5);
    /* Glow */
    cursor: pointer;
    transition: all 0.3s ease;
}

.sync-btn-floating:hover {
    background: #4338ca;
    /* indigo-500 */
    transform: translateY(-4px);
    /* Float effect */
}

.sync-btn-floating:active {
    transform: scale(0.95);
}

.sync-btn-floating svg {
    width: 20px;
    height: 20px;
    color: white;
    transition: transform 0.5s ease;
}

.sync-tooltip {
    position: absolute;
    top: -35px;
    background: #0f172a;
    /* slate-900 */
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
    pointer-events: none;
}

.sync-btn-floating:hover .sync-tooltip {
    opacity: 1;
    transform: scale(1);
    top: -45px;
    /* Adjust if needed */
}

/* Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.opacity-70 {
    opacity: 0.7;
}

/* --- ANALYTICS ENHANCEMENTS --- */

/* Chart Toggle */
.toggle-group {
    display: inline-flex;
    background: #F4F7FE;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #E0E5F2;
}

.toggle-label {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    color: #A3AED0;
    transition: all 0.2s ease;
    user-select: none;
}

.toggle-label:hover {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Badges */
.badge-metric {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-efficiency {
    background: rgba(227, 26, 26, 0.1);
    color: #E31A1A;
}

.badge-efficiency.good {
    background: rgba(5, 205, 153, 0.1);
    color: #05CD99;
}

.badge-days {
    background: #EFF4FB;
    color: #2B3674;
}

/* Contribution Widget */
.contribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.contribution-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid #F4F7FE;
}

.contribution-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.contribution-info h4 {
    color: #A3AED0;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    margin-bottom: 4px;
}

.contribution-info h2 {
    color: #2B3674;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

/* --- ANTIGRAVITY SIDEBAR PROFILE --- */
.sidebar-profile {
    margin-top: auto;
    margin-bottom: 24px;
    margin-left: 20px;
    margin-right: 20px;
    padding: 16px;
    /* p-4 consistent */
    background: rgba(30, 41, 59, 0.4);
    /* bg-slate-800/40 (Darker Glass) */
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Border Glow */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.sidebar-profile:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.5);
    /* Indigo glow on hover */
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #9333ea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.profile-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.profile-name {
    color: #f8fafc;
    /* text-slate-50 */
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    color: #cbd5e1;
    /* text-slate-300 */
    font-size: 0.75rem;
    font-weight: 500;
}

.profile-action {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateX(-5px);
}

.sidebar-profile:hover .profile-action {
    opacity: 1;
    transform: translateX(0);
}

.profile-action:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.1);
}

/* --- ANTIGRAVITY LAUNCH: UNIT DEPLOYMENT UI --- */
.launch-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    /* Controlled by JS */
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

.launch-card {
    background: #111C44;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    border: 1px solid rgba(67, 24, 255, 0.3);
    box-shadow: 0 0 50px rgba(67, 24, 255, 0.2);
    overflow: hidden;
    position: relative;
}

.launch-header {
    background: linear-gradient(135deg, #4318FF 0%, #111C44 100%);
    padding: 30px;
    text-align: center;
}

.launch-header i {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 15px;
    display: block;
}

.launch-header h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.launch-content {
    padding: 30px;
}

/* PROGRESS STEPPER */
.launch-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.launch-stepper::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.step-indicator {
    width: 32px;
    height: 32px;
    background: #1B254B;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A3AED0;
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px var(--primary);
}

.step-indicator.done {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

/* FORM ELEMENTS */
.launch-step {
    display: none;
    animation: slideIn 0.3s ease;
}

.launch-step.active {
    display: block;
}

.launch-label {
    display: block;
    color: #A3AED0;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
}

.launch-input {
    width: 100%;
    background: #1B254B;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-family: 'DM Sans';
    font-size: 1rem;
    margin-bottom: 20px;
}

.launch-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #212B58;
}

.resource-info {
    background: rgba(5, 205, 153, 0.1);
    border: 1px solid rgba(5, 205, 153, 0.2);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.resource-info .val {
    color: var(--success);
    font-weight: 700;
    font-size: 1.1rem;
}

/* BUTTONS */
.launch-footer {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
}

.btn-launch-nav {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-back {
    background: transparent;
    color: #A3AED0;
}

.btn-next {
    background: var(--primary);
    color: #fff;
}

.btn-launch-final {
    background: #00F5FF;
    /* Cyan Glitch */
    color: #000;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
}

.btn-launch-final:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.6);
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes rocketShake {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

.rocket-launching {
    animation: rocketShake 0.1s infinite;
}

.launch-success-overlay {
    position: absolute;
    inset: 0;
    background: #05CD99;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    z-index: 10;
}

.launch-success-overlay.active {
    display: flex;
    animation: pulseBG 1s infinite alternate;
}

@keyframes pulseBG {
    from {
        background: #05CD99;
    }

    to {
        background: #04b386;
    }
}