/* ========================================
   Pinnacle 8 - Investor Portal Styles
   ======================================== */
:root {
  --p: #1a6b4a; --pd: #0d4a32; --pl: #28956a;
  --gold: #c4a35a; --goldl: #dfc07a;
  --txt: #1a1a2e; --txtl: #4a5568; --txtm: #718096;
  --bg: #f5f9f7; --card: #fff; --border: #dce8e2;
  --green: #28956a; --font: 'Inter', sans-serif;
  --radius: 12px; --shadow: 0 2px 12px rgba(0,0,0,0.06);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--txt); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* LOGIN */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0a1f16 0%, #1a3d2e 50%, var(--pd) 100%); position: relative; padding: 24px; }
.login-bg { position: absolute; inset: 0; opacity: 0.06; background: radial-gradient(circle at 30% 40%, rgba(196,163,90,0.4), transparent 50%), radial-gradient(circle at 70% 60%, rgba(40,149,106,0.4), transparent 50%); }
.login-card { background: var(--card); border-radius: 20px; padding: 48px 40px; width: 100%; max-width: 420px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { width: 56px; height: 56px; margin-bottom: 16px; }
.login-header h1 { font-size: 24px; font-weight: 700; color: var(--pd); }
.login-header p { color: var(--txtm); font-size: 14px; margin-top: 4px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--txt); }
.form-group input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; font-family: var(--font); transition: 0.2s; }
.form-group input:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px rgba(26,107,74,0.1); }
.form-actions-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 13px; }
.check-label { display: flex; align-items: center; gap: 6px; color: var(--txtl); cursor: pointer; }
.link-sm { color: var(--p); text-decoration: none; font-weight: 500; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: var(--radius); font-weight: 600; font-size: 15px; border: none; cursor: pointer; transition: 0.2s; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--p), var(--pl)); color: #fff; box-shadow: 0 2px 8px rgba(26,107,74,0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,107,74,0.4); }
.btn-full { width: 100%; }
.login-note { text-align: center; font-size: 12px; color: var(--txtm); margin-top: 16px; }

/* PORTAL LAYOUT */
.portal { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--pd); color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: 0.3s; }
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sb-logo { width: 36px; height: 36px; }
.sidebar-head strong { font-size: 16px; }
.sidebar-head small { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1.5px; }
.sb-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: rgba(255,255,255,0.6); text-decoration: none; font-size: 14px; font-weight: 500; transition: 0.2s; position: relative; }
.sb-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.sb-link.active { color: #fff; background: rgba(255,255,255,0.1); border-right: 3px solid var(--gold); }
.sb-badge { background: var(--gold); color: var(--pd); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; margin-left: auto; }
.sb-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sb-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar { width: 36px; height: 36px; background: linear-gradient(135deg, var(--gold), var(--goldl)); color: var(--pd); font-weight: 700; font-size: 13px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.sb-user strong { font-size: 14px; }
.sb-user small { font-size: 11px; color: rgba(255,255,255,0.5); }

/* MAIN */
.main-content { flex: 1; margin-left: 260px; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 16px 32px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar h2 { font-size: 20px; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }
.lang-btn { background: none; border: 1px solid var(--border); padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; color: var(--txtl); }

/* PAGES */
.page { display: none; padding: 28px 32px; }
.page.active { display: block; }

/* WELCOME */
.welcome { background: linear-gradient(135deg, var(--p), var(--pl)); color: #fff; border-radius: var(--radius); padding: 28px 32px; margin-bottom: 24px; }
.welcome h3 { font-size: 22px; margin-bottom: 4px; }
.welcome p { opacity: 0.8; font-size: 14px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.kpi-label { display: block; font-size: 12px; color: var(--txtm); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--txt); }

/* CARDS */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.card-head h4 { font-size: 16px; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; }

/* CHART */
.chart-wrap { padding: 24px; }
.bars { display: flex; gap: 8px; align-items: flex-end; height: 160px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; background: linear-gradient(180deg, var(--pl), var(--p)); border-radius: 6px 6px 0 0; min-height: 20px; transition: 0.3s; }
.bar-col:hover .bar { background: linear-gradient(180deg, var(--gold), var(--p)); }
.bar-col span { font-size: 11px; color: var(--txtm); }
.chart-label { text-align: center; margin-top: 16px; font-size: 14px; color: var(--p); font-weight: 600; }

/* PORTFOLIO */
.port-list { padding: 16px 24px; }
.port-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.port-item:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.blue { background: var(--p); }
.dot.gold { background: var(--gold); }
.dot.green { background: var(--green); }
.port-item div { flex: 1; }
.port-item strong { font-size: 14px; }
.port-item small { font-size: 12px; color: var(--txtm); }
.port-val { font-weight: 700; font-size: 15px; color: var(--p); }
.port-total { display: flex; justify-content: space-between; padding: 16px 24px; background: rgba(26,107,74,0.04); border-top: 1px solid var(--border); font-size: 15px; }
.port-total strong { color: var(--p); font-size: 18px; }

/* ACTIVITY */
.activity { padding: 8px 24px; }
.act-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.act-row:last-child { border-bottom: none; }
.act-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.act-icon.inc { background: rgba(56,161,105,0.1); color: var(--green); }
.act-icon.doc { background: rgba(26,107,74,0.08); }
.act-icon.msg { background: rgba(196,163,90,0.15); }
.act-row div { flex: 1; }
.act-row strong { font-size: 14px; }
.act-row small { font-size: 12px; color: var(--txtm); }
.act-right { text-align: right; flex: 0 0 auto; }
.act-amount { display: block; font-weight: 600; font-size: 14px; }
.act-amount.pos { color: var(--green); }

/* PROPERTIES */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.prop-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.prop-img { position: relative; background: linear-gradient(135deg, #e8f0ec, #d4e5db); height: 140px; }
.prop-ph { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--txtm); }
.prop-status { position: absolute; top: 12px; right: 12px; background: var(--green); color: #fff; padding: 4px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.prop-body { padding: 24px; }
.prop-body h3 { font-size: 18px; margin-bottom: 4px; }
.prop-body > p { font-size: 13px; color: var(--txtm); margin-bottom: 16px; }
.prop-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.prop-stats div { background: var(--bg); padding: 10px 12px; border-radius: 8px; }
.prop-stats small { display: block; font-size: 11px; color: var(--txtm); text-transform: uppercase; letter-spacing: 0.5px; }
.prop-stats strong { font-size: 16px; color: var(--txt); }
.prop-progress { margin-bottom: 12px; }
.prog-bar { height: 6px; background: var(--border); border-radius: 3px; margin: 8px 0 4px; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--p), var(--pl)); border-radius: 3px; }
.prop-progress small { font-size: 12px; color: var(--txtm); }
.prop-managed { font-size: 13px; color: var(--green); font-weight: 500; padding-top: 12px; border-top: 1px solid var(--border); }

/* INCOME TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 24px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--txtm); border-bottom: 2px solid var(--border); }
td { padding: 14px 24px; font-size: 14px; border-bottom: 1px solid var(--border); }
tr:hover { background: rgba(26,107,74,0.02); }
.badge { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge.paid { background: rgba(56,161,105,0.1); color: var(--green); }
.btn-sm-outline { background: none; border: 1px solid var(--border); padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--txtl); font-weight: 500; }
.btn-sm-outline:hover { border-color: var(--p); color: var(--p); }

/* DOCUMENTS */
.doc-list { padding: 8px 24px; }
.doc-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: none; }
.doc-icon { font-size: 24px; flex-shrink: 0; }
.doc-row div { flex: 1; }
.doc-row strong { font-size: 14px; }
.doc-row small { font-size: 12px; color: var(--txtm); }

/* MESSAGES */
.msg-list { padding: 0; }
.msg-row { display: flex; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); cursor: pointer; transition: 0.2s; }
.msg-row:hover { background: rgba(26,107,74,0.02); }
.msg-row.unread { background: rgba(26,107,74,0.04); border-left: 3px solid var(--p); }
.msg-avatar { width: 40px; height: 40px; background: linear-gradient(135deg, var(--p), var(--pl)); color: #fff; font-weight: 700; font-size: 13px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msg-body { flex: 1; min-width: 0; }
.msg-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.msg-top strong { font-size: 14px; }
.msg-top small { color: var(--txtm); font-size: 12px; }
.msg-subject { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.msg-preview { font-size: 13px; color: var(--txtl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-btn { display: block; }
  .page { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .prop-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
