/* css/pages/EWInsurance.css
   EW Insurance Policy Manager page styles.
   Inherits from css/site-layout.css + css/panels-paper.css
*/

/* ---- Create button ---- */
#btnCreatePolicy {
    margin-bottom: 18px;
}

/* ====================================================
   Policy table
   ==================================================== */
#policyTable {
    width: 100%;
 border-collapse: collapse;
    font-size: 0.92rem;
    margin-top: 10px;
}

#policyTable th,
#policyTable td {
    padding: 7px 10px;
    border: 1px solid #d8d8d8;
    text-align: left;
    vertical-align: middle;
}

#policyTable thead th {
    background: #f0f0f0;
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#policyTable tbody tr:nth-child(4n+1),
#policyTable tbody tr:nth-child(4n+3) {
    /* zebra only on main rows — details rows are styled separately */
    background: rgba(255,255,255,0.55);
}

.mono { font-family: monospace; }

/* ====================================================
   Expanded details row
   ==================================================== */
.ins-details-row > td {
    padding: 0;
    border-top: none;
}

.ins-details-inner {
    padding: 16px 18px;
    background: rgba(245, 248, 252, 0.97);
  border-top: 2px solid #c0cfe0;
    border-bottom: 2px solid #c0cfe0;
}

.ins-details-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.ins-full-id {
    color: #888;
    font-family: monospace;
    margin-left: auto;
}

/* ---- Status badge / pill ---- */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
  font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.status-badge.active  { background: #c3e6cb; color: #155724; }
.status-badge.pending { background: #ffeeba; color: #856404; }
.status-badge.empty   { background: #e2e3e5; color: #383d41; }

/* ---- Policy name input ---- */
.policy-name-input {
    border: none;
    border-bottom: 2px solid #bbb;
    font-weight: bold;
    font-size: 1rem;
    background: transparent;
    padding: 2px 4px;
    min-width: 140px;
    max-width: 280px;
    outline: none;
}

.policy-name-input:focus {
    border-bottom-color: #1f8cff;
}

/* ====================================================
   Allocation editor (<details>)
   ==================================================== */
.alloc-editor {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.7);
    border: 1px solid #e0e0e0;
}

.alloc-editor summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.97rem;
    user-select: none;
}

.alloc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.alloc-row label {
    width: 130px;
    font-size: 0.92rem;
}

.alloc-input {
    width: 64px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: right;
}

.alloc-sum {
    margin-top: 6px;
    font-size: 0.88rem;
    text-align: right;
    color: #444;
}

.alloc-warn {
    color: #c00;
    font-size: 0.88rem;
 font-weight: 600;
    margin-top: 4px;
}

/* ====================================================
   Metal estimate table (<details>)
   ==================================================== */
.metal-estimate {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.7);
 border: 1px solid #e0e0e0;
}

.metal-estimate summary {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
}

.estimate-note {
    margin-bottom: 6px;
    color: #666;
}

.metal-estimate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-top: 6px;
}

.metal-estimate-table th,
.metal-estimate-table td {
    padding: 5px 8px;
    border: 1px solid #e0e0e0;
  text-align: left;
}

.metal-estimate-table th {
    background: #f5f5f5;
font-weight: 600;
}

.uninsured-warn {
    color: #c00;
    font-weight: 600;
}

/* ====================================================
   Deposit / Withdraw inner cards
==================================================== */
.deposit-section,
.withdraw-section {
    margin: 10px 0;
    padding: 10px 14px;
    border: 1px solid #d9e3f0;
    border-radius: 6px;
    background: rgba(235, 245, 255, 0.85);
}

.deposit-section h4,
.withdraw-section h4 {
    margin: 0 0 8px 0;
  font-size: 0.97rem;
}

.deposit-cost-display,
.deposit-balance-display,
.withdraw-value-display {
    font-size: 0.88rem;
    color: #555;
 margin-top: 4px;
}

.deposit-warn {
    color: #c00;
  font-weight: 600;
    font-size: 0.88rem;
    margin-top: 4px;
}

/* ====================================================
   Pending section / banner
   ==================================================== */
.pending-section {
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(255, 243, 205, 0.97);
    border: 1px solid #e0c36a;
}

.pending-banner {
  font-size: 0.93rem;
    margin-bottom: 8px;
    color: #856404;
}

/* ====================================================
   Inline action notifiers
   ==================================================== */
.ins-notifier {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.85em;
    font-style: italic;
}

/* ====================================================
   Metals Withdrawal section
   ==================================================== */
.metals-withdraw-section {
    margin: 10px 0;
    padding: 10px 14px;
    border: 1px solid #e0c36a;
    border-radius: 6px;
  background: rgba(255, 243, 205, 0.85);
}

.metals-withdraw-section h4 {
    margin: 0 0 8px 0;
    font-size: 0.97rem;
    color: #856404;
}

/* ====================================================
   Deposit estimate preview
   ==================================================== */
.deposit-estimate-preview {
    margin-top: 8px;
    font-size: 0.88rem;
}

.deposit-estimate-table {
    width: 100%;
    border-collapse: collapse;
  font-size: 0.86rem;
    margin-top: 4px;
}

.deposit-estimate-table th,
.deposit-estimate-table td {
    padding: 4px 8px;
    border: 1px solid #d0dbe8;
    text-align: left;
}

.deposit-estimate-table th {
    background: #edf2f7;
    font-weight: 600;
}

.deposit-alloc-mismatch-warn {
    display: none;
    color: #856404;
    font-size: 0.82em;
    margin-top: 4px;
}

/* ---- Disabled state ---- */
.policy-disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* ====================================================
   Responsive
   ==================================================== */
@media (max-width: 700px) {
    #policyTable th:nth-child(1),
    #policyTable td:nth-child(1),
    #policyTable th:nth-child(6),
    #policyTable td:nth-child(6) {
      display: none;
    }

    .alloc-row label { width: 100px; }
    .ins-full-id { display: none; }
}
