/* ##########################################################
    Website Entity Check Page StyleSheet (new design)
    Load after layouts/app.css. That file already provides the shared
    cc- tokens, header, footer, .cc-btn, .cc-card, .cc-tag, .cc-link,
    .cc-section, .cc-eyebrow and .cc-name-km / .cc-name-en.
    This file only adds what the entity check page needs on top of it.
    Two views on one page: the results list and a company profile.
############################################################# */

/* the `hidden` attribute must win over the display rules below */
.cc-entity [hidden] { display: none !important; }

/* ======== 1. Small shared pieces used by this page ======== */
    .cc-entity .cc-h1 { text-wrap: balance; margin-bottom: 16px; font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: 1.02; letter-spacing: -0.02em; color: var(--navy); }
    .cc-entity .cc-h1 em { font-style: normal; color: var(--mint-deep); }
    .cc-page-hero { padding: var(--section) 0; background: var(--cream); }
    .cc-page-lede { max-width: 620px; margin-bottom: 28px; font-size: 17px; line-height: 1.6; color: var(--muted); }
    .cc-page-hero .cc-search { max-width: 760px; }

    /* breadcrumb */
    .cc-crumbs { margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; font-size: 13px; color: var(--muted); }
    .cc-crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--muted-2); }
    .cc-crumbs a:hover { color: var(--navy); }
    .cc-crumbs [aria-current] { color: var(--navy); }

    /* outline button, extra tag colour, avatar, labels */
    .cc-btn.outline { background: var(--white); border-color: var(--border); color: var(--navy); }
    .cc-btn.outline:hover { border-color: var(--navy); }
    .cc-tag.amber { background: var(--amber-soft); color: var(--amber); }
    .cc-avatar { width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--navy); color: var(--mint); font-family: var(--serif); font-size: 16px; overflow: hidden; }
    .cc-avatar.logo { background: var(--white); border: 1px solid var(--border); }
    .cc-avatar img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: var(--white); }
    .cc-avatar.lg { width: 72px; height: 72px; border-radius: 16px; font-size: 22px; }
    .cc-label { margin-bottom: 5px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
    .cc-value { font-size: 15px; font-weight: 500; color: var(--navy); overflow-wrap: anywhere; }

    /* select */
    .cc-select { height: 38px; padding: 0 36px 0 14px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A1F44' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; font: inherit; font-size: 14px; color: var(--navy); appearance: none; -webkit-appearance: none; cursor: pointer; transition: border-color 0.15s; }
    .cc-select:hover, .cc-select:focus { border-color: var(--navy); outline: none; }

    /* checkbox row with a count */
    .cc-check { padding: 7px 0; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
    .cc-check input { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; border: 1.5px solid #C9C3B5; border-radius: 5px; background: var(--white); appearance: none; -webkit-appearance: none; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
    .cc-check input:checked { border-color: var(--navy); background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236FE7B7' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / 12px; }
    .cc-check:hover input { border-color: var(--navy); }
    .cc-count { margin-left: auto; min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--cream); font-size: 12px; text-align: center; color: var(--muted); }
    .cc-check.empty { color: var(--muted-2); }

    /* pagination */
    .cc-pager { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; list-style: none; }
    .cc-pager a, .cc-pager span, .cc-pager button { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--white); font-size: 14px; color: var(--navy); cursor: pointer; transition: border-color 0.15s; }
    .cc-pager a:hover, .cc-pager button:hover { border-color: var(--navy); }
    .cc-pager [aria-current] { border-color: var(--navy); background: var(--navy); color: var(--white); cursor: default; }
    .cc-pager .disabled { color: var(--muted-2); pointer-events: none; cursor: default; }
    .cc-pager button:disabled { color: var(--muted-2); pointer-events: none; }

/* ======== 2. Search box (hero) ======== */
    .cc-search { max-width: 640px; padding: 24px; }
    .cc-search-tabs { margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
    .cc-search-tab { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; background: var(--cream); color: var(--muted); font-size: 13px; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
    .cc-search-tab i { font-size: 15px; }
    .cc-search-tab:hover { color: var(--navy); border-color: var(--border); }
    .cc-search-tab.active { background: var(--navy); color: var(--white); }
    .cc-search-row { position: relative; display: flex; gap: 10px; }
    .cc-search-field { position: relative; flex: 1 1 0%; min-width: 0; }
    .cc-field-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--muted-2); pointer-events: none; }
    .cc-search-input { width: 100%; height: 48px; padding: 0 42px 0 44px; border: 1px solid transparent; border-radius: var(--r-btn); background: var(--cream); font-size: 15px; color: var(--text); outline: none; transition: border-color 0.15s, background 0.15s; }
    .cc-search-input:focus { border-color: var(--navy); background: var(--white); }
    .cc-search-input::placeholder { color: var(--muted-2); }
    .cc-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
    .cc-clear:hover { background: var(--border); color: var(--navy); }

/* ======== 3. Results: filters + list ======== */
    .cc-results { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "filters head" "filters list"; column-gap: 32px; align-items: start; }
    .cc-filters { grid-area: filters; padding: 24px; }
    .cc-results-head { grid-area: head; }
    .cc-results-body { grid-area: list; }

    /* filters */
    .cc-filters-head { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: baseline; }
    .cc-filters-head h2 { font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--navy); }
    .cc-text-btn { border: 0; background: none; font-size: 13px; font-weight: 500; color: var(--mint-deep); cursor: pointer; }
    .cc-text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
    .cc-filter-group + .cc-filter-group { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
    .cc-filter-group .cc-label { margin-bottom: 6px; }
    .cc-filters-apply { display: none; }

    /* list header */
    .cc-results-head { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
    .cc-results-count { font-size: 15px; color: var(--muted); }
    .cc-results-count b, .cc-results-count strong { font-weight: 500; color: var(--navy); }
    .cc-results-tools { display: flex; align-items: center; gap: 10px; }
    .cc-filter-btn { display: none; }
    .cc-filter-btn .cc-count { margin-left: 0; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; background: var(--navy); color: var(--white); font-size: 11px; }
    .cc-loading { margin-bottom: 12px; font-size: 14px; color: var(--muted); }

    /* one company */
    .cc-result-list { display: grid; gap: 12px; }
    .cc-result { position: relative; padding: 20px 24px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 18px; align-items: center; transition: border-color 0.15s, box-shadow 0.15s; }
    .cc-result:hover { border-color: var(--navy); box-shadow: 0 12px 28px -22px rgba(10, 31, 68, 0.45); }
    .cc-result-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; }
    .cc-result-name { font-size: 16px; font-weight: 400; color: var(--navy); }
    .cc-result-top .cc-tag { margin-top: 3px; }
    .cc-result-sub { margin-top: 2px; font-size: 14px; color: var(--muted); }
    .cc-facts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 13px; color: var(--muted); }
    .cc-facts div { display: flex; gap: 6px; }
    .cc-facts dd { font-weight: 500; color: var(--navy); }
    /* the whole card is clickable through the "View profile" link */
    .cc-result .cc-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
    .cc-result.revoked .cc-avatar { background: #EEECE6; }

    /* nothing found */
    .cc-empty { padding: 32px; text-align: center; }
    .cc-empty-icon { width: 48px; height: 48px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 12px; background: var(--red-soft); color: var(--red); font-size: 22px; }
    .cc-empty h3 { margin-bottom: 6px; font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--navy); }

/* ======== 4. Company profile ======== */
    .cc-back { margin-bottom: 20px; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font-size: 14px; font-weight: 500; color: var(--navy); cursor: pointer; }
    .cc-back:hover { color: var(--mint-deep); }
    .cc-profile-head { padding: 28px 32px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
    .cc-profile-id { display: flex; align-items: center; gap: 20px; min-width: 0; }
    .cc-profile-name { font-size: 28px; font-weight: 400; }
    .cc-profile-name .cc-name-en { margin-top: 2px; font-size: 17px; font-weight: 400; }
    .cc-profile-sub { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: var(--muted); }

    .cc-profile-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
    .cc-profile-grid.cc-profile-grid-single { grid-template-columns: minmax(0, 1fr); }
    .cc-panel-wide { grid-column: 1 / -1; }
    .cc-panel { padding: 28px 32px; }
    .cc-panel-title { margin-bottom: 20px; font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.25; color: var(--navy); }
    .cc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 24px; }

    /* license history timeline */
    .cc-activities { list-style: none; }
    .cc-activities li { padding: 18px 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; align-items: start; }
    .cc-activities li:first-child { padding-top: 0; }
    .cc-activities li + li { border-top: 1px solid var(--border); }
    .cc-activities h3 { font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--navy); }
    .cc-activities p { margin-top: 2px; font-size: 14px; color: var(--muted); }
    .cc-activities .cc-when { margin-top: 4px; font-size: 12px; color: var(--muted-2); }
    .cc-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--mint-soft); color: var(--mint-deep); font-size: 15px; }
    .cc-mark.warn { background: var(--amber-soft); color: var(--amber); }
    .cc-history-empty { padding: 8px 0; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }

    /* official contacts */
    .cc-contacts { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
    .cc-contacts.one { grid-template-columns: minmax(0, 1fr); }
    .cc-contacts li { padding: 16px 0; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: center; border-top: 1px solid var(--border); }
    .cc-contacts li.is-first { border-top: 0; padding-top: 0; }
    .cc-contact-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--cream); color: var(--navy); font-size: 18px; }
    .cc-contacts .cc-label { margin-bottom: 2px; }
    .cc-contact-value { font-size: 15px; font-weight: 500; color: var(--navy); overflow-wrap: anywhere; }
    .cc-contact-value a:hover { color: var(--mint-deep); text-decoration: underline; text-underline-offset: 3px; }

/* ======== 5. Khmer adjustments ======== */
    html[lang="km"] .cc-entity .cc-h1,
    html[lang="km"] .cc-panel-title,
    html[lang="km"] .cc-filters-head h2,
    html[lang="km"] .cc-empty h3 { line-height: 1.4; letter-spacing: normal; }
    html[lang="km"] .cc-label,
    html[lang="km"] .cc-crumbs { letter-spacing: normal; text-transform: none; }

/* ======== 6. Responsive ======== */
@media (max-width: 1024px) {
    .cc-entity .cc-h1 { font-size: 44px; }
    .cc-results { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "head" "filters" "list"; }
    .cc-filters { display: none; margin-bottom: 16px; }
    .cc-results.filters-open .cc-filters { display: block; }
    .cc-filters-apply { margin-top: 20px; width: 100%; display: inline-flex; }
    .cc-filter-btn { display: inline-flex; }
    .cc-profile-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .cc-entity .cc-h1 { font-size: 36px; }
    .cc-page-lede { margin-bottom: 24px; font-size: 16px; }
    .cc-search { padding: 20px; }
    .cc-search-tabs { display: grid; grid-template-columns: 1fr 1fr; }
    .cc-search-tab { height: 40px; justify-content: center; }
    .cc-search-row { flex-direction: column; }
    .cc-clear { width: 36px; height: 36px; right: 6px; }
    .cc-results-head { flex-wrap: wrap; }
    .cc-results-tools { width: 100%; }
    .cc-results-tools > * { flex: 1 1 0%; }
    .cc-filters { padding: 20px; }
    .cc-result { padding: 20px; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: start; }
    .cc-result .cc-link { position: static; grid-column: 1 / -1; padding-top: 14px; justify-content: space-between; border-top: 1px solid var(--border); }
    .cc-result .cc-link::before { display: none; }
    .cc-facts { gap: 4px 18px; }
    .cc-result-top { flex-direction: column; gap: 6px; }
    .cc-result-top .cc-tag { margin-top: 0; }
    .cc-empty { padding: 24px 20px; }
    .cc-profile-head { padding: 20px; flex-direction: column; align-items: stretch; gap: 18px; }
    .cc-profile-id { align-items: flex-start; gap: 14px; }
    .cc-avatar.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 18px; }
    .cc-profile-name { font-size: 22px; }
    .cc-profile-name .cc-name-en { font-size: 15px; }
    .cc-panel { padding: 20px; }
    .cc-panel-title, .cc-filters-head h2 { margin-bottom: 16px; font-size: 18px; }
    .cc-filters-head h2 { margin-bottom: 0; }
    .cc-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
    .cc-contacts { grid-template-columns: minmax(0, 1fr); }
    .cc-back, .cc-text-btn { position: relative; }
    .cc-back::before, .cc-text-btn::before { content: ""; position: absolute; left: -4px; right: -4px; top: -10px; bottom: -6px; }
}