.ti {
    --ti-primary: #0f766e;
    --ti-primary-dark: #115e59;
    --ti-border: #e5e7eb;
    --ti-muted: #6b7280;
    --ti-bg: #ffffff;
    --ti-soft: #f8fafc;
    --ti-danger: #b91c1c;
    --ti-success: #15803d;
    box-sizing: border-box;
}

.ti *, .ti *::before, .ti *::after { box-sizing: inherit; }

.ti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ti-card {
    background: var(--ti-bg);
    border: 1px solid var(--ti-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ti-card-img img { display: block; width: 100%; height: 180px; object-fit: cover; }
.ti-card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ti-card-body h3 { margin: 0; font-size: 1.15em; }
.ti-card-body h3 a { text-decoration: none; color: inherit; }
.ti-card-body p { margin: 0; color: var(--ti-muted); }
.ti-card-body .ti-btn { margin-top: auto; text-align: center; }

.ti-progress { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.ti-progress span { display: block; height: 100%; background: var(--ti-primary); border-radius: 99px; }
.ti-progress-meta { display: flex; justify-content: space-between; font-size: .9em; color: var(--ti-muted); margin-top: 6px; }

.ti-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: .8em;
    padding: 2px 10px;
    border-radius: 99px;
    background: #e2e8f0;
    color: #334155;
}
.ti-badge-open, .ti-badge-approved { background: #dcfce7; color: var(--ti-success); }
.ti-badge-pending { background: #fef3c7; color: #92400e; }
.ti-badge-rejected, .ti-badge-closed { background: #fee2e2; color: var(--ti-danger); }
.ti-badge-funded { background: #dbeafe; color: #1d4ed8; }

.ti-btn {
    display: inline-block;
    background: var(--ti-primary);
    color: #fff !important;
    border: 0;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
}
.ti-btn:hover { background: var(--ti-primary-dark); }
.ti-btn-light { background: var(--ti-soft); color: var(--ti-primary) !important; border: 1px solid var(--ti-primary); }
.ti-btn-light:hover { background: #ecfdf5; }

.ti-box {
    background: var(--ti-bg);
    border: 1px solid var(--ti-border);
    border-radius: 12px;
    padding: 20px;
    margin-block: 20px;
}
.ti-box h3 { margin-top: 0; }
.ti-box hr { border: 0; border-top: 1px solid var(--ti-border); margin: 16px 0; }

.ti-form { display: flex; flex-direction: column; gap: 12px; }
.ti-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.ti-address { word-break: break-all; font-size: 1.05em; }
.ti-form input[type=number], .ti-form input[type=text], .ti-form textarea, .ti-form select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--ti-border);
    border-radius: 8px;
    font: inherit;
}
.ti-form .ti-check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; font-size: .92em; }
.ti-form button { align-self: flex-start; }

.ti-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.ti-alert-success { background: #dcfce7; color: var(--ti-success); }
.ti-alert-error { background: #fee2e2; color: var(--ti-danger); }

.ti-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.ti-facts div { background: var(--ti-soft); border-radius: 8px; padding: 10px 12px; }
.ti-facts dt { font-size: .85em; color: var(--ti-muted); }
.ti-facts dd { margin: 2px 0 0; font-weight: 600; }

.ti-risk { background: #fff7ed; border-inline-start: 4px solid #f97316; padding: 12px 16px; border-radius: 8px; margin: 16px 0; }
.ti-disclaimer { font-size: .85em; color: var(--ti-muted); }
.ti-bank { background: var(--ti-soft); padding: 12px; border-radius: 8px; margin-bottom: 12px; font-family: monospace; }

.ti-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.ti-stat { background: var(--ti-primary); color: #fff; border-radius: 12px; padding: 18px; }
.ti-stat span { display: block; opacity: .85; font-size: .9em; }
.ti-stat strong { font-size: 1.5em; }

.ti-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 20px; }

.ti-table-wrap { overflow-x: auto; }
.ti-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.ti-table th, .ti-table td { padding: 10px; border-bottom: 1px solid var(--ti-border); text-align: start; white-space: nowrap; }
.ti-table th { color: var(--ti-muted); font-weight: 500; }
.ti-neg { color: var(--ti-danger); }
.ti-pos { color: var(--ti-success); }
.ti-empty { color: var(--ti-muted); }
