/* CC Integrations — v1.0.0 */

/* Hub */
.cc-int-hub { padding: 0 0 2rem; }
.cc-int-hub__sub { color: #666; font-size: 14px; margin: 0 0 1.5rem; }
.cc-int-empty { color: #888; font-style: italic; }

/* Grid */
.cc-int-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
    gap: 16px;
}

/* Card */
.cc-int-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}
.cc-int-card--connected {
    border-color: #0f6e56;
}

/* Card header */
.cc-int-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cc-int-card__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
}
.cc-int-card__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.cc-int-card__logo-placeholder {
    font-size: 13px;
    font-weight: 700;
    color: #999;
    letter-spacing: .02em;
    line-height: 1;
}
.cc-int-card__titles { flex: 1; }
.cc-int-card__name {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 2px;
    color: #1a1a1a;
}
.cc-int-card__maker {
    font-size: 12px;
    color: #999;
    margin: 0;
}
a.cc-int-card__name--link {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 2px;
    color: #1a1a1a;
    text-decoration: none;
    transition: color .15s;
}
a.cc-int-card__name--link:hover { color: #185fa5; }
.cc-int-ext-icon {
    font-size: 11px;
    opacity: 0.5;
    vertical-align: middle;
}
.cc-int-card__desc {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Badges */
.cc-int-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    align-self: flex-start;
}
.cc-int-badge--connected { background: #e1f5ee; color: #0f6e56; }
.cc-int-badge--disconnected { background: #f4f4f4; color: #888; }

.cc-int-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.cc-int-dot--green  { background: #1d9e75; }
.cc-int-dot--gray   { background: #bbb; }

/* Data grid */
.cc-int-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border-top: 1px solid #ebebeb;
    padding-top: 10px;
}
.cc-int-data-item--span2 { grid-column: 1 / -1; }
.cc-int-data-label {
    font-size: 11px;
    color: #999;
    margin: 0 0 2px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.cc-int-data-val {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}
.cc-int-data-val--small { font-size: 13px; font-weight: 500; }

/* Card actions */
.cc-int-card__actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Buttons */
.cc-int-btn {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #d0d0d0;
    background: transparent;
    color: #444;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    line-height: 1;
}
.cc-int-btn:hover { background: #f4f4f4; }
.cc-int-btn:active { transform: scale(.98); }

.cc-int-btn--connect {
    flex: 1;
    background: #185fa5;
    color: #fff;
    border-color: #185fa5;
}
.cc-int-btn--connect:hover { background: #1250899; border-color: #125089; }

.cc-int-btn--manage { flex: 1; }

.cc-int-btn--disconnect {
    flex: 1;
    background: #a32d2d;
    color: #fff;
    border-color: #a32d2d;
}
.cc-int-btn--disconnect:hover { background: #8a2525; border-color: #8a2525; }

.cc-int-btn--refresh {
    padding: 8px 10px;
    font-size: 16px;
    flex-shrink: 0;
    transition: transform .2s;
}
.cc-int-btn--refresh.is-spinning { animation: cc-int-spin .6s linear infinite; }

.cc-int-help-link {
    font-size: 12px;
    color: #185fa5;
    display: block;
    margin-top: 4px;
    text-decoration: none;
}
.cc-int-help-link:hover { text-decoration: underline; }

/* Modal overlay */
.cc-int-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.cc-int-modal {
    background: #fff;
    border-radius: 12px;
    padding: 1.75rem;
    max-width: 400px;
    width: 100%;
    box-sizing: border-box;
}
.cc-int-modal__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #1a1a1a;
}
.cc-int-modal__sub {
    font-size: 13px;
    color: #666;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}
.cc-int-modal__error {
    font-size: 13px;
    color: #a32d2d;
    background: #fcebeb;
    border: 1px solid #f7c1c1;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
}
.cc-int-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

/* Modal form fields */
.cc-int-field-row { margin-bottom: 14px; }
.cc-int-field-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}
.cc-int-field-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    padding: 9px 11px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fafafa;
    color: #1a1a1a;
    transition: border-color .15s;
}
.cc-int-field-input:focus {
    outline: none;
    border-color: #185fa5;
    background: #fff;
}

/* Spinner */
@keyframes cc-int-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Notice */
.cc-int-notice {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.cc-int-notice--success { background: #e1f5ee; color: #0f6e56; }
.cc-int-notice--error   { background: #fcebeb; color: #a32d2d; }
