* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #10213f;
}

body {
    min-height: 100vh;
}

button,
input,
select,
textarea {
    font: inherit;
}

.portal {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 272px;
    min-height: 100vh;
    background: #0b2342;
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.sidebar-brand {
    padding: 30px 24px 26px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-brand h2 {
    margin: 0;
    font-size: 25px;
    line-height: 1.25;
    letter-spacing: .5px;
}

.sidebar-brand p {
    margin: 8px 0 0;
    color: #a9c0df;
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.sidebar-section {
    padding: 24px 14px 0;
}

.sidebar-section-title {
    padding: 0 12px 10px;
    color: #7895bc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    color: #dce8f8;
    text-align: left;
    padding: 14px 13px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 15px;
    transition: .2s ease;
}

.sidebar-menu button:hover {
    background: rgba(255,255,255,.07);
}

.sidebar-menu button.active {
    background: #1c4778;
    color: #fff;
    font-weight: 600;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 18px 14px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar-bottom button {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 9px;
    background: #18395f;
    color: #fff;
    cursor: pointer;
}

.main {
    margin-left: 272px;
    width: calc(100% - 272px);
    min-height: 100vh;
}

.topbar {
    height: 79px;
    background: #fff;
    border-bottom: 1px solid #e3e9f2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.topbar-title {
    font-size: 21px;
    font-weight: 700;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #183f6b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-mini strong {
    display: block;
    font-size: 14px;
}

.user-mini span {
    display: block;
    margin-top: 3px;
    color: #71809a;
    font-size: 12px;
}

.content {
    padding: 34px;
    max-width: 1500px;
}

.page-title {
    margin: 0;
    font-size: 40px;
    line-height: 1.15;
    letter-spacing: -.7px;
}

.page-subtitle {
    margin: 12px 0 28px;
    color: #63728a;
    font-size: 16px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border-radius: 999px;
    background: #e7f6ec;
    color: #18733b;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* DASHBOARD STATISTICS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e3e9f2;
    border-radius: 14px;
    padding: 23px;
    min-height: 145px;
    box-shadow: 0 4px 15px rgba(16,33,63,.04);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #edf3fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: #173e69;
    font-size: 18px;
    font-weight: 700;
}

.stat-card .stat-label {
    color: #71809a;
    font-size: 13px;
    margin-bottom: 7px;
}

.stat-card .stat-value {
    color: #10213f;
    font-size: 22px;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
    gap: 22px;
}

.card {
    background: #fff;
    border: 1px solid #e3e9f2;
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(16,33,63,.04);
}

.card h2,
.card h3 {
    margin: 0 0 8px;
    color: #10213f;
}

.card-subtitle {
    margin: 0 0 22px;
    color: #71809a;
    font-size: 14px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.info-item {
    padding: 15px;
    background: #f7f9fc;
    border-radius: 10px;
}

.info-item label {
    display: block;
    color: #78869a;
    font-size: 12px;
    margin-bottom: 6px;
}

.info-item strong {
    font-size: 14px;
    color: #172b49;
    word-break: break-word;
}

.quick-actions {
    display: grid;
    gap: 10px;
}

.quick-actions button {
    border: 1px solid #dce4ef;
    background: #fff;
    padding: 13px 15px;
    border-radius: 9px;
    text-align: left;
    cursor: pointer;
    color: #173e69;
    font-weight: 600;
}

.quick-actions button:hover {
    background: #f3f7fb;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #edf0f5;
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-title {
    font-weight: 600;
    font-size: 14px;
}

.activity-date {
    color: #8190a4;
    font-size: 12px;
    margin-top: 4px;
}

.activity-amount {
    font-weight: 700;
    white-space: nowrap;
}

.empty-state {
    padding: 30px 15px;
    text-align: center;
    color: #7a8799;
}

/* TABLES / LIST PAGES */

.table-card {
    background: #fff;
    border: 1px solid #e3e9f2;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(16,33,63,.04);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

th,
td {
    padding: 15px 18px;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
    font-size: 14px;
}

th {
    background: #f7f9fc;
    color: #61718a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

td {
    color: #243754;
}

/* FORMS */

.form-card {
    max-width: 850px;
    background: #fff;
    border: 1px solid #e3e9f2;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 4px 15px rgba(16,33,63,.04);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #40516b;
    font-size: 13px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    padding: 12px 13px;
    outline: none;
    background: #fff;
    color: #172b49;
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #37628d;
    box-shadow: 0 0 0 3px rgba(55,98,141,.1);
}

.primary-btn {
    border: 0;
    border-radius: 8px;
    background: #173e69;
    color: #fff;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
}

.primary-btn:hover {
    background: #0f3157;
}

/* INVESTMENT CARDS */

.investment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.investment-card {
    background: #fff;
    border: 1px solid #e3e9f2;
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(16,33,63,.04);
}

.investment-card h3 {
    margin: 0 0 8px;
}

.investment-card .roi {
    font-size: 27px;
    font-weight: 700;
    color: #173e69;
    margin: 15px 0;
}

.investment-detail {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #edf0f5;
    font-size: 13px;
}

.investment-detail span:first-child {
    color: #71809a;
}

.investment-detail strong {
    text-align: right;
}

/* RESPONSIVE */

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .investment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 800px) {
    .sidebar {
        width: 220px;
    }

    .main {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

    .content {
        padding: 22px;
    }

    .page-title {
        font-size: 31px;
    }

    .info-grid,
    .form-grid,
    .investment-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .portal {
        display: block;
    }

    .sidebar-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar-bottom {
        margin-top: 10px;
    }

    .topbar {
        padding: 0 18px;
    }

    .content {
        padding: 18px;
    }

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

    .user-mini > div:not(.user-avatar) {
        display: none;
    }
}


/* DASHBOARD WELCOME */
.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.dashboard-welcome h2 {
    margin: 0 0 7px;
    font-size: 24px;
    font-weight: 700;
}

.dashboard-welcome p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
}

.dashboard-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #15803d;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

.dashboard-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 9px 15px !important;
    border-radius: 999px !important;
    background: #ecfdf3 !important;
    color: #15803d !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.status-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: #22c55e !important;
    display: inline-block !important;
}

/* =========================================================
   INVESTMENT FORM
========================================================= */

.invest-button {
    width: 100%;
    margin-top: 16px;
    padding: 13px 18px;
    border: none;
    border-radius: 8px;
    background: #0b1f3a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.invest-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.invest-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.investment-form-wrap {
    max-width: 720px;
    margin: 0 auto;
}

.investment-form-plan {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 25px;
}

.investment-form-plan > div {
    padding: 16px;
    background: #f6f8fb;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
}

.investment-form-plan strong {
    display: block;
    margin-bottom: 7px;
    color: #697589;
    font-size: 11px;
    text-transform: uppercase;
}

.investment-form-plan span {
    display: block;
    color: #263449;
    font-size: 14px;
    font-weight: 700;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #263449;
    font-size: 13px;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: #ffffff;
    color: #263449;
    font-size: 14px;
    outline: none;
}

.form-group input:focus {
    border-color: #0b1f3a;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-actions .invest-button,
.form-actions .secondary-button {
    flex: 1;
    margin-top: 0;
}

.secondary-button {
    padding: 13px 18px;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: #ffffff;
    color: #263449;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.secondary-button:hover {
    background: #f6f8fb;
}

@media (max-width: 700px) {
    .investment-form-plan {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }
}
