﻿.ttc-page {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.ttc-page h1,
.ttc-page h2,
.ttc-page h3 {
    margin-top: 0;
}

.ttc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.ttc-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

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

.ttc-button {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
}

.ttc-button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.ttc-form-row {
    margin-bottom: 15px;
}

.ttc-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.ttc-form-row input,
.ttc-form-row select,
.ttc-form-row textarea {
    width: 100%;
    box-sizing: border-box;
}

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

.ttc-table th,
.ttc-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

/* ============================================================
   TT Core Parties
   ============================================================ */

.ttc-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.ttc-page-header h1 {
    margin: 0 0 5px;
}

.ttc-page-header p {
    margin: 0;
    opacity: .7;
}

.ttc-button {
    display: inline-block;
    padding: 9px 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    color: #222;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
}

.ttc-button:hover {
    text-decoration: none;
}

.ttc-button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.ttc-button-danger {
    background: #b32d2e;
    border-color: #b32d2e;
    color: #fff;
}

.ttc-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.ttc-toolbar input[type="search"] {
    flex: 1;
    min-width: 250px;
}

.ttc-toolbar select {
    width: 160px;
}

.ttc-party-list {
    display: flex;
    flex-direction: column;
}

.ttc-party-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

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

.ttc-party-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
}

.ttc-party-avatar img,
.ttc-party-avatar span {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ttc-party-avatar img {
    object-fit: cover;
}

.ttc-party-avatar span {
    background: #eee;
    font-weight: 600;
}

.ttc-party-main {
    flex: 1;
    min-width: 0;
}

.ttc-party-name {
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
}

.ttc-party-meta {
    margin-top: 4px;
    font-size: 13px;
    opacity: .7;
}

.ttc-party-actions {
    display: flex;
    gap: 7px;
}

.ttc-section {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.ttc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.ttc-section-header h3 {
    margin: 0;
}

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

.ttc-form-row {
    margin-bottom: 16px;
}

.ttc-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.ttc-form-row input,
.ttc-form-row select,
.ttc-form-row textarea {
    width: 100%;
    box-sizing: border-box;
}

.ttc-party-fields h3 {
    margin-top: 10px;
    margin-bottom: 20px;
}

.ttc-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ttc-detail-grid {
    margin-top: 20px;
}

.ttc-detail-grid > div {
    padding: 14px;
    background: #f8f8f8;
    border-radius: 5px;
}

.ttc-detail-grid strong {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    text-transform: uppercase;
    opacity: .65;
}

.ttc-party-type {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 12px;
    background: #eee;
    font-size: 12px;
    margin-right: 8px;
}

.ttc-danger-zone {
    margin-top: 40px;
    padding: 20px;
    border: 1px solid #e0a0a0;
    border-radius: 6px;
}

.ttc-danger-zone h3 {
    margin-top: 0;
}

.ttc-notice {
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 5px;
}

.ttc-notice-success {
    background: #edfaef;
    border: 1px solid #a8d5ae;
}

.ttc-notice-error {
    background: #fff0f0;
    border: 1px solid #dfaaaa;
}

.ttc-empty {
    padding: 40px 20px;
    text-align: center;
    opacity: .65;
}

@media (max-width: 700px) {

    .ttc-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ttc-toolbar {
        flex-direction: column;
    }

    .ttc-toolbar select {
        width: 100%;
    }

    .ttc-form-grid,
    .ttc-detail-grid {
        grid-template-columns: 1fr;
    }

    .ttc-party-item {
        align-items: flex-start;
    }

    .ttc-party-actions {
        flex-direction: column;
    }

}

/* ============================================================
   Connections
   ============================================================ */

.ttc-section-description {
    margin: 4px 0 0;
    opacity: .65;
    font-size: 13px;
}

.ttc-connection-editor {
    margin: 20px 0 25px;
    padding: 20px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.ttc-connections-list {
    display: flex;
    flex-direction: column;
}

.ttc-connection-item {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

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

.ttc-connection-main {
    flex: 1;
}

.ttc-connection-type {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: .65;
    margin-bottom: 4px;
}

.ttc-connection-party {
    font-size: 17px;
    font-weight: 600;
}

.ttc-connection-party a {
    text-decoration: none;
}

.ttc-connection-party span {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 400;
    opacity: .6;
}

.ttc-connection-dates {
    margin-top: 7px;
    font-size: 13px;
    opacity: .7;
}

.ttc-connection-dates > span {
    margin: 0 5px;
}

.ttc-connection-notes {
    margin-top: 8px;
    font-size: 13px;
    opacity: .8;
}

.ttc-primary-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    background: #2271b1;
    color: #fff;
    font-size: 11px !important;
    opacity: 1 !important;
}

.ttc-connection-actions {
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

@media (max-width: 700px) {

    .ttc-connection-item {
        flex-direction: column;
    }

    .ttc-connection-actions {
        align-items: stretch;
    }

}

/* ============================================================
   Accounts / Invitations
   ============================================================ */

.ttc-account-status,
.ttc-invitation-pending {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
}

.ttc-account-status {
    background: #f5f5f5;
    border: 1px solid #ddd;
}

.ttc-account-status span {
    opacity: .7;
}

.ttc-invitation-pending {
    background: #fff8e5;
    border: 1px solid #e5c96b;
}

.ttc-invitation-pending span {
    opacity: .75;
}

.ttc-invitation-form {
    padding: 20px;
    background: #f8f8f8;
    border-radius: 6px;
    margin-bottom: 25px;
}

.ttc-form-row-action {
    display: flex;
    align-items: flex-end;
}

/* ============================================================
   Invitation
   ============================================================ */

.ttc-invitation-card {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.ttc-invitation-card h1 {
    margin-top: 0;
}

.ttc-invitation-intro {
    margin-bottom: 25px;
    line-height: 1.6;
}

.ttc-invitation-identity {
    display: grid;
    gap: 1px;
    margin-bottom: 30px;
    background: #ddd;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.ttc-invitation-identity > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px;
    background: #f8f8f8;
}

.ttc-invitation-identity strong {
    font-size: 13px;
}

.ttc-invitation-identity span {
    text-align: right;
}

.ttc-invitation-card small {
    display: block;
    margin-top: 5px;
    opacity: .65;
}
