/* ═══════════════════════════════════════════════════
   OIL THRIVAL GLOBAL — Frontend Styles
   Blue & White Theme
═══════════════════════════════════════════════════ */
:root {
  --otg-blue:       #1258a8;
  --otg-blue-dark:  #0a3060;
  --otg-blue-mid:   #1a72d4;
  --otg-blue-light: #eaf3fe;
  --otg-blue-pale:  #f4f8fe;
  --otg-white:      #ffffff;
  --otg-off-white:  #f7faff;
  --otg-border:     rgba(18,88,168,.14);
  --otg-ink:        #020b1a;
  --otg-muted:      #4a6080;
  --otg-muted2:     #7090b0;
  --otg-green:      #0da874;
  --otg-red:        #e03050;
  --otg-gold:       #e8a020;
  --otg-shadow:     0 2px 12px rgba(10,48,96,.1);
  --otg-shadow-lg:  0 8px 32px rgba(10,48,96,.13);
  --otg-radius:     10px;
  --otg-mono:       'Courier New', monospace;
}

/* ── Base ── */
.otg-wrap * { box-sizing: border-box; }
.otg-wrap {
  font-family: -apple-system, 'Segoe UI', sans-serif;
  color: var(--otg-ink);
  line-height: 1.6;
}

/* ── Notices ── */
.otg-notice { padding: 14px 18px; border-radius: var(--otg-radius); margin-bottom: 16px; font-size: .9rem; }
.otg-info    { background: var(--otg-blue-light); border-left: 4px solid var(--otg-blue); color: var(--otg-blue-dark); }
.otg-warning { background: #fff8e1; border-left: 4px solid var(--otg-gold); color: #7a5800; }
.otg-error   { background: #fff0f2; border-left: 4px solid var(--otg-red); color: #8a1020; }
.otg-success { background: #f0fdf7; border-left: 4px solid var(--otg-green); color: #0a5a3a; }

/* ── Cards ── */
.otg-card {
  background: var(--otg-white);
  border: 1px solid var(--otg-border);
  border-radius: 14px;
  box-shadow: var(--otg-shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.otg-card-header {
  background: var(--otg-blue-pale);
  border-bottom: 1px solid var(--otg-border);
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.otg-card-header h2, .otg-card-header h3 {
  margin: 0; font-size: 1.05rem; color: var(--otg-blue-dark);
  font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.otg-card-header h2::before, .otg-card-header h3::before {
  content: ''; width: 4px; height: 18px;
  background: var(--otg-blue); border-radius: 2px; display: inline-block;
}
.otg-card-body { padding: 24px; }

/* ── Stat cards ── */
.otg-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.otg-stat-card {
  background: var(--otg-white); border: 1px solid var(--otg-border);
  border-radius: 12px; padding: 20px 18px; text-align: center;
  box-shadow: var(--otg-shadow);
}
.otg-stat-val { font-size: 1.8rem; font-weight: 800; color: var(--otg-blue); line-height: 1; margin-bottom: 4px; font-family: var(--otg-mono); }
.otg-stat-lbl { font-size: .72rem; color: var(--otg-muted2); text-transform: uppercase; letter-spacing: 1px; }

/* ── Tables ── */
.otg-table-wrap { overflow-x: auto; }
.otg-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.otg-table th {
  background: var(--otg-blue-pale); color: var(--otg-blue-dark);
  font-weight: 700; padding: 12px 14px; text-align: left;
  font-size: .75rem; letter-spacing: .5px; text-transform: uppercase;
  border-bottom: 2px solid var(--otg-border);
}
.otg-table td { padding: 12px 14px; border-bottom: 1px solid rgba(18,88,168,.06); color: var(--otg-ink); }
.otg-table tr:last-child td { border-bottom: none; }
.otg-table tr:hover td { background: var(--otg-blue-pale); }
.otg-mono { font-family: var(--otg-mono); font-size: .82rem; }

/* ── Badges ── */
.otg-badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: .72rem; font-weight: 700; letter-spacing: .3px; }
.otg-badge-ok    { background: rgba(13,168,116,.12); color: #076644; border: 1px solid rgba(13,168,116,.2); }
.otg-badge-error { background: rgba(224,48,80,.1);   color: #8a1020; border: 1px solid rgba(224,48,80,.2); }
.otg-badge-warn  { background: rgba(232,160,32,.12); color: #7a5800; border: 1px solid rgba(232,160,32,.2); }
.otg-badge-info  { background: var(--otg-blue-light);color: var(--otg-blue-dark); border: 1px solid var(--otg-border); }
.otg-badge-muted { background: rgba(0,0,0,.05);      color: var(--otg-muted); border: 1px solid rgba(0,0,0,.08); }

/* ── Forms ── */
.otg-form-row { margin-bottom: 18px; }
.otg-form-row label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--otg-blue-dark); margin-bottom: 6px;
}
.otg-input, .otg-select, .otg-textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--otg-border);
  border-radius: var(--otg-radius);
  font-size: .92rem; color: var(--otg-ink);
  background: var(--otg-white); outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.otg-input:focus, .otg-select:focus, .otg-textarea:focus { border-color: var(--otg-blue); box-shadow: 0 0 0 3px rgba(18,88,168,.1); }
.otg-textarea { resize: vertical; min-height: 80px; }
.otg-input-hint { font-size: .75rem; color: var(--otg-muted2); margin-top: 4px; }
.otg-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:600px){ .otg-form-grid { grid-template-columns: 1fr; } }

/* ── Buttons ── */
.otg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 24px; border-radius: var(--otg-radius);
  font-size: .88rem; font-weight: 700; cursor: pointer;
  border: none; text-decoration: none; transition: all .2s; letter-spacing: .2px;
}
.otg-btn-primary { background: var(--otg-blue); color: #fff; box-shadow: 0 4px 14px rgba(18,88,168,.3); }
.otg-btn-primary:hover { background: var(--otg-blue-dark); box-shadow: 0 6px 20px rgba(18,88,168,.4); color: #fff; transform: translateY(-1px); }
.otg-btn-outline { background: transparent; color: var(--otg-blue); border: 1.5px solid var(--otg-blue); }
.otg-btn-outline:hover { background: var(--otg-blue); color: #fff; }
.otg-btn-success { background: var(--otg-green); color: #fff; }
.otg-btn-success:hover { opacity: .85; }
.otg-btn-danger  { background: var(--otg-red); color: #fff; }
.otg-btn-danger:hover { opacity: .85; }
.otg-btn-sm { padding: 7px 14px; font-size: .78rem; border-radius: 6px; }
.otg-btn-full { width: 100%; justify-content: center; }

/* ── Tabs ── */
.otg-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--otg-border); margin-bottom: 20px; flex-wrap: wrap; }
.otg-tab {
  padding: 9px 18px; font-size: .82rem; font-weight: 600; cursor: pointer;
  color: var(--otg-muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .2s; background: none; border-top: none; border-left: none; border-right: none;
}
.otg-tab.active, .otg-tab:hover { color: var(--otg-blue); border-bottom-color: var(--otg-blue); }
.otg-tab-panel { display: none; }
.otg-tab-panel.active { display: block; }

/* ── Investment / Oil Block cards ── */
.otg-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.otg-asset-card {
  background: var(--otg-white); border: 1px solid var(--otg-border);
  border-radius: 14px; overflow: hidden; box-shadow: var(--otg-shadow);
  transition: box-shadow .2s, transform .2s;
}
.otg-asset-card:hover { box-shadow: var(--otg-shadow-lg); transform: translateY(-2px); }
.otg-asset-card-top {
  background: linear-gradient(135deg, var(--otg-blue-dark), var(--otg-blue));
  padding: 20px; color: #fff;
}
.otg-asset-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(255,255,255,.15); display: flex; align-items: center;
  justify-content: center; font-family: var(--otg-mono); font-weight: 700;
  font-size: .82rem; margin-bottom: 10px; border: 1px solid rgba(255,255,255,.2);
}
.otg-asset-name { font-size: 1rem; font-weight: 800; margin-bottom: 2px; }
.otg-asset-company { font-size: .8rem; opacity: .75; }
.otg-asset-body { padding: 16px 18px; }
.otg-asset-stat { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(18,88,168,.07); font-size: .83rem; }
.otg-asset-stat:last-of-type { border-bottom: none; }
.otg-asset-stat-lbl { color: var(--otg-muted); }
.otg-asset-stat-val { font-weight: 700; font-family: var(--otg-mono); color: var(--otg-blue-dark); font-size: .82rem; }
.otg-asset-stat-val.green { color: var(--otg-green); }
.otg-asset-stat-val.red   { color: var(--otg-red); }
.otg-asset-range { display: flex; gap: 4px; align-items: center; }
.otg-asset-footer { padding: 14px 18px; border-top: 1px solid var(--otg-border); }

/* ── Investment cards ── */
.otg-inv-card {
  background: var(--otg-white); border: 1px solid var(--otg-border);
  border-radius: 14px; overflow: hidden; box-shadow: var(--otg-shadow); margin-bottom: 16px;
}
.otg-inv-header {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--otg-border);
  background: var(--otg-blue-pale);
}
.otg-inv-body { padding: 14px 18px; }
.otg-inv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 12px; }
.otg-inv-stat { text-align: center; }
.otg-inv-stat-val { font-family: var(--otg-mono); font-size: .95rem; font-weight: 700; color: var(--otg-blue-dark); }
.otg-inv-stat-lbl { font-size: .65rem; color: var(--otg-muted2); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ── Progress bar ── */
.otg-progress { height: 8px; background: var(--otg-blue-light); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.otg-progress-fill { height: 100%; background: linear-gradient(90deg, var(--otg-blue), var(--otg-blue-mid)); border-radius: 4px; transition: width .6s ease; }
.otg-progress-fill.positive { background: linear-gradient(90deg, var(--otg-green), #0fd494); }
.otg-progress-fill.negative { background: linear-gradient(90deg, var(--otg-red), #ff6080); }

/* ── Modal ── */
.otg-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 99999;
  background: rgba(2,11,26,.65); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
.otg-modal-overlay.open { display: flex; }
.otg-modal {
  background: var(--otg-white); border-radius: 18px; width: 500px;
  max-width: calc(100vw - 32px); box-shadow: 0 32px 80px rgba(0,0,0,.25);
  overflow: hidden; animation: otgPop .22s ease;
}
@keyframes otgPop { from{transform:scale(.93);opacity:0;} to{transform:scale(1);opacity:1;} }
.otg-modal-header {
  background: linear-gradient(135deg, var(--otg-blue-dark), var(--otg-blue));
  padding: 20px 24px; display: flex; align-items: center; justify-content: space-between;
}
.otg-modal-title { font-size: 1.05rem; font-weight: 800; color: #fff; }
.otg-modal-close {
  background: rgba(255,255,255,.15); border: none; color: #fff; width: 30px; height: 30px;
  border-radius: 6px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
.otg-modal-close:hover { background: rgba(255,255,255,.25); }
.otg-modal-body { padding: 24px; }

/* ── Profit indicator ── */
.otg-profit-pos { color: var(--otg-green); font-weight: 700; font-family: var(--otg-mono); }
.otg-profit-neg { color: var(--otg-red); font-weight: 700; font-family: var(--otg-mono); }

/* ── Topbar ── */
.otg-topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--otg-blue-dark); color: #fff;
  padding: 12px 20px; border-radius: 12px; margin-bottom: 20px;
  flex-wrap: wrap; gap: 12px;
}
.otg-topbar-balance { font-family: var(--otg-mono); font-size: 1.1rem; font-weight: 700; }
.otg-topbar-label { font-size: .72rem; opacity: .7; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }

/* ── Instruction box ── */
.otg-instruction-box {
  background: var(--otg-blue-pale); border: 1px solid var(--otg-border);
  border-radius: var(--otg-radius); padding: 16px 18px; margin-bottom: 16px;
  font-size: .87rem; color: var(--otg-muted);
}
.otg-instruction-box strong { color: var(--otg-blue-dark); display: block; margin-bottom: 6px; }

/* ── Duration slider ── */
.otg-range-wrap { margin-top: 4px; }
.otg-range-input { width: 100%; accent-color: var(--otg-blue); }
.otg-range-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--otg-muted2); margin-top: 2px; }
.otg-range-val { text-align: center; font-family: var(--otg-mono); font-weight: 700; color: var(--otg-blue); font-size: 1rem; margin-top: 4px; }

/* ── Profit drops table ── */
.otg-drops-toggle { font-size: .78rem; color: var(--otg-blue); cursor: pointer; text-decoration: underline; }
.otg-drops-table { display: none; margin-top: 10px; }
.otg-drops-table.open { display: block; }

/* ── Responsive ── */
@media(max-width:640px){
  .otg-card-body { padding: 16px; }
  .otg-modal-body { padding: 16px; }
  .otg-stats-row { grid-template-columns: 1fr 1fr; }
  .otg-asset-grid { grid-template-columns: 1fr; }
}