/**
 * CordeoCRM Formlar ve Servis Kayıtları
 * Yalnız modüle özel yerleşim. Buton, modal, form, dropdown ve sekme görünümü
 * merkezi UI Core tarafından sağlanır.
 */
.cordeocrm-forms-page {
    width: min(1180px, calc(100% - 32px));
    min-height: calc(100vh - 150px);
    margin: 0 auto;
    padding: 28px 0 48px;
    color: var(--ccrm-text);
}

.ccrm-forms-page-head {
    display: flex;
    min-height: 92px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--ccrm-border-soft);
}

.ccrm-forms-page-head h1 {
    margin: 0 0 5px;
    color: var(--ccrm-text);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
}

.ccrm-forms-page-head p {
    max-width: 760px;
    margin: 0;
    color: var(--ccrm-muted);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.5;
}

.ccrm-forms-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.ccrm-forms-toolbar {
    margin-top: 0;
}

.ccrm-forms-toolbar__title {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.ccrm-forms-toolbar__title strong {
    color: var(--ccrm-text);
    font-size: 14px;
    font-weight: 600;
}

.ccrm-forms-toolbar__title span {
    color: var(--ccrm-muted);
    font-size: 11.5px;
    font-weight: 400;
}

.ccrm-forms-search {
    display: flex;
    min-height: var(--ccrm-control-height);
    align-items: center;
    gap: 8px;
}

.ccrm-forms-search span {
    display: inline-flex;
    min-height: var(--ccrm-control-height);
    flex: 0 0 auto;
    align-items: center;
    color: var(--ccrm-muted);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.ccrm-forms-search input {
    width: 250px;
    flex: 0 0 250px;
}

.ccrm-forms-gallery-view,
.ccrm-forms-detail-view {
    min-height: 480px;
}

.ccrm-forms-gallery-head {
    appearance: none;
    display: flex;
    width: 100%;
    height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--ccrm-border-soft);
    border-radius: var(--ccrm-radius-sm);
    background: var(--ccrm-surface);
    color: var(--ccrm-text);
    box-shadow: none;
    font-family: var(--ccrm-font);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--ccrm-transition), background var(--ccrm-transition);
}

.ccrm-forms-gallery-head:hover,
.ccrm-forms-gallery-head:focus-visible {
    border-color: var(--ccrm-border);
    background: var(--ccrm-surface-hover);
    outline: 0;
}


.ccrm-forms-gallery-title {
    display: block;
    color: var(--ccrm-text);
    font: inherit;
    line-height: inherit;
}

.ccrm-forms-gallery-head:hover .ccrm-forms-gallery-title,
.ccrm-forms-gallery-head:focus-visible .ccrm-forms-gallery-title,
.ccrm-forms-gallery-head[aria-expanded="true"] .ccrm-forms-gallery-title,
.ccrm-forms-gallery-head[aria-expanded="false"] .ccrm-forms-gallery-title {
    color: var(--ccrm-text);
}

.ccrm-forms-gallery-chevron {
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    align-self: center;
    margin: 0;
    color: var(--ccrm-muted);
    transform: rotate(0deg);
    transform-origin: center;
    transition: color var(--ccrm-transition), transform var(--ccrm-transition);
}

.ccrm-forms-gallery-head[aria-expanded="true"] .ccrm-forms-gallery-chevron {
    color: var(--ccrm-primary);
    transform: rotate(180deg);
}

.ccrm-forms-gallery-head[aria-expanded="false"] .ccrm-forms-gallery-chevron {
    color: var(--ccrm-muted);
    transform: rotate(0deg);
}

.ccrm-forms-gallery-view.is-collapsed .ccrm-forms-gallery-grid {
    display: none;
}

.ccrm-forms-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 0;
}

.ccrm-forms-template-card {
    appearance: none;
    display: grid;
    min-width: 0;
    min-height: 112px;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 10px 12px;
    align-items: center;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--ccrm-border-soft);
    border-radius: 10px;
    background: var(--ccrm-surface);
    color: var(--ccrm-text);
    box-shadow: none;
    font-family: var(--ccrm-font);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--ccrm-transition), background var(--ccrm-transition);
}

.ccrm-forms-template-card:hover,
.ccrm-forms-template-card:focus-visible {
    border-color: #bfdbfe;
    background: var(--ccrm-surface-hover);
    outline: 0;
}

.ccrm-forms-template-icon,
.ccrm-forms-detail-icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
}

.ccrm-forms-detail-icon {
    width: 48px;
    height: 48px;
}

.ccrm-forms-template-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.ccrm-forms-template-copy strong {
    color: var(--ccrm-text);
    font-size: 13px;
    font-weight: 600;
}

.ccrm-forms-template-copy small {
    color: var(--ccrm-muted);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.45;
}

.ccrm-forms-template-card em {
    grid-column: 2;
    color: var(--ccrm-muted);
    font-size: 10.5px;
    font-style: normal;
    font-weight: 500;
}

.is-teal { background: #3b7d7a; }
.is-purple { background: #7c3aed; }
.is-navy { background: #30446e; }
.is-red { background: #dc2626; }
.is-violet { background: #8b5cf6; }
.is-orange { background: #d97706; }
.is-slate { background: #475569; }
.is-dark { background: #344054; }
.is-cyan { background: #0e7490; }

.ccrm-forms-detail-intro {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 18px 0;
    border-bottom: 1px solid var(--ccrm-border-soft);
}

.ccrm-forms-detail-intro h2 {
    margin: 0 0 5px;
    color: var(--ccrm-text);
    font-size: 16px;
    font-weight: 600;
}

.ccrm-forms-detail-intro p,
.ccrm-forms-detail-intro small {
    margin: 0;
    color: var(--ccrm-muted);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.5;
}

.ccrm-forms-detail-intro small {
    display: block;
    margin-top: 7px;
}

.ccrm-forms-entry-list-head {
    display: flex;
    min-height: 60px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0 12px;
    border-bottom: 1px solid var(--ccrm-border-soft);
}

.ccrm-forms-entry-list-head h3 {
    margin: 0 0 3px;
    color: var(--ccrm-text);
    font-size: 14px;
    font-weight: 600;
}

.ccrm-forms-entry-list-head p,
.ccrm-forms-entry-list-head span {
    margin: 0;
    color: var(--ccrm-muted);
    font-size: 11.5px;
    font-weight: 400;
}

.ccrm-forms-entry-list {
    min-height: 260px;
}

.ccrm-forms-entry-row {
    display: grid;
    min-height: 56px;
    grid-template-columns: minmax(0, 1fr) 120px auto;
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--ccrm-border-soft);
    background: var(--ccrm-surface);
    cursor: pointer;
    transition: background var(--ccrm-transition);
}

.ccrm-forms-entry-row:hover,
.ccrm-forms-entry-row:focus-visible {
    background: var(--ccrm-surface-hover);
    outline: 0;
}

.ccrm-forms-entry-main {
    display: grid;
    min-width: 0;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.ccrm-forms-entry-main h4 {
    margin: 0 0 3px;
    color: var(--ccrm-text);
    font-size: 12px;
    font-weight: 600;
}

.ccrm-forms-entry-main p {
    margin: 0;
    overflow: hidden;
    color: var(--ccrm-muted);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ccrm-forms-entry-delete {
    justify-self: end;
}

.ccrm-forms-entry-date {
    color: var(--ccrm-muted);
    font-size: 11px;
    font-weight: 400;
}

.ccrm-forms-empty-state {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ccrm-muted);
    text-align: center;
}

.ccrm-forms-empty-state[hidden] {
    display: none;
}

.ccrm-forms-empty-state strong {
    color: var(--ccrm-text);
    font-size: 14px;
    font-weight: 600;
}

.ccrm-forms-empty-state span {
    font-size: 11.5px;
    font-weight: 400;
}

.ccrm-forms-entry-form {
    display: contents;
}

.ccrm-forms-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.ccrm-forms-field--full {
    grid-column: 1 / -1;
}

.ccrm-forms-required-alert[hidden],
.ccrm-ui-field-error[hidden] {
    display: none;
}

.ccrm-ui-field.has-error .ccrm-ui-control {
    border-color: var(--ccrm-danger);
}

.ccrm-ui-field-error {
    color: var(--ccrm-danger);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

@media (max-width: 980px) {
    .ccrm-forms-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ccrm-forms-entry-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .ccrm-forms-entry-delete {
        justify-self: end;
    }

    .ccrm-forms-entry-date {
        display: none;
    }
}

@media (max-width: 767px) {
    .cordeocrm-forms-page {
        width: calc(100% - 24px);
        padding: 22px 0 48px;
    }

    .ccrm-forms-page-head,
    .ccrm-forms-detail-intro {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .ccrm-forms-page-actions,
    .ccrm-ui-list-toolbar,
    .ccrm-ui-list-toolbar__controls,
    .ccrm-forms-search {
        width: 100%;
        align-items: stretch;
        justify-content: flex-start;
    }

    .ccrm-forms-search {
        min-height: 0;
        flex-direction: column;
    }

    .ccrm-forms-search span {
        min-height: 20px;
        align-self: flex-start;
    }

    .ccrm-forms-search input {
        width: 100%;
        flex-basis: auto;
    }

    .ccrm-forms-gallery-grid,
    .ccrm-forms-modal-grid {
        grid-template-columns: 1fr;
    }

    .ccrm-forms-entry-row {
        grid-template-columns: minmax(0, 1fr) auto;
        padding-inline: 0;
    }

    .ccrm-forms-detail-intro > .ccrm-ui-button {
        justify-self: start;
    }
}
