/* =============================================================
   Classification Codes Update — Per-Code Editor
   ============================================================= */

.ccu-page {
    padding: 0 0 3rem 0;
}

/* ===== Hero card ===== */
.ccu-hero {
    background: linear-gradient(135deg, #00A1BE 0%, #007a8f 100%);
    border-radius: .75rem;
    padding: 1.5rem 2.25rem 2rem 2.25rem;
    margin-bottom: 1.5rem;
    color: #FFF;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    box-shadow: 0 .5rem 1.25rem rgba(0, 161, 190, 0.18);
    position: relative;
    overflow: hidden;
}

.ccu-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.ccu-hero-left {
    flex: 1 1 360px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.ccu-back-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none !important;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: .85rem;
    padding: .3rem .7rem .3rem .55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    transition: all .15s ease;
}

.ccu-back-link:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #FFF;
    transform: translateX(-2px);
}

.ccu-hero-title {
    font-family: var(--font-headings);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: .55rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    color: #FFF;
}

.ccu-hero-title i {
    font-size: 1.8rem;
    opacity: .9;
}

.ccu-hero-sub {
    font-size: .9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
    max-width: 540px;
}

.ccu-hero-right {
    flex: 0 1 380px;
    min-width: 280px;
    position: relative;
    z-index: 1;
}

/* ===== Search box ===== */
.ccu-search-wrap {
    position: relative;
    margin-bottom: .75rem;
}

.ccu-search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 1rem;
    pointer-events: none;
}

.ccu-search-input {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: .85rem 3rem .85rem 2.85rem;
    font-family: var(--font-primary);
    font-size: .95rem;
    color: #27282A;
    background: #FFF;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, 0.12);
    outline: none;
    transition: box-shadow .2s ease, transform .15s ease;
}

.ccu-search-input:focus {
    box-shadow: 0 .35rem 1rem rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.ccu-search-input::placeholder {
    color: #999;
}

.ccu-search-clear {
    position: absolute;
    right: .85rem;
    top: 50%;
    transform: translateY(-50%);
    background: #F0F0F0;
    border: none;
    color: #666;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
}

.ccu-search-clear:hover {
    background: #FF4A11;
    color: #FFF;
}

.ccu-stats {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    color: #FFF;
    padding-left: 1.25rem;
}

.ccu-stats-num {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFF;
}

.ccu-stats-label {
    font-size: .85rem;
    text-transform: lowercase;
    color: rgba(255, 255, 255, 0.88);
}

.ccu-stats-of {
    font-size: .8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-left: .25rem;
}

/* ===== Tile grid ===== */
.ccu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .85rem;
}

/* ===== Add New tile (special, always first) ===== */
.ccu-add-tile {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .95rem 1.15rem;
    background: linear-gradient(135deg, rgba(0, 204, 120, 0.06) 0%, rgba(0, 161, 190, 0.06) 100%);
    border: 2px dashed #00CC78;
    border-radius: .5rem;
    color: #007a47;
    text-align: left;
    cursor: pointer;
    transition: all .18s ease;
    font-family: var(--font-primary);
    width: 100%;
}

.ccu-add-tile:hover {
    transform: translateY(-2px);
    border-color: #00A1BE;
    background: linear-gradient(135deg, rgba(0, 204, 120, 0.12) 0%, rgba(0, 161, 190, 0.12) 100%);
    color: #00A1BE;
    box-shadow: 0 .375rem .75rem rgba(0, 161, 190, 0.15);
}

.ccu-add-icon {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .425rem;
    background: #00CC78;
    color: #FFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: all .2s ease;
}

.ccu-add-tile:hover .ccu-add-icon {
    background: #00A1BE;
    transform: scale(1.05) rotate(90deg);
}

.ccu-add-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.ccu-add-title {
    font-size: .9rem;
    font-weight: 700;
    color: inherit;
}

.ccu-add-sub {
    font-size: .72rem;
    color: #6C757D;
    margin-top: .15rem;
}

/* ===== Record tiles ===== */
.ccu-tile {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .95rem 1.15rem .95rem .85rem;
    background: #FFF;
    border: 1px solid #E9ECEF;
    border-radius: .5rem;
    color: #27282A;
    position: relative;
    overflow: hidden;
    transition: all .18s ease;
}

.ccu-tile:hover {
    transform: translateY(-2px);
    border-color: #00A1BE;
    box-shadow: 0 .375rem .75rem rgba(0, 161, 190, 0.15);
    background: #F5FBFC;
}

/* System tiles get a slightly different look — locked/protected */
.ccu-tile.is-system {
    background: #FAFBFC;
}

.ccu-tile.is-system:hover {
    border-color: #C5CBD2;
    background: #F5F7F9;
    box-shadow: 0 .25rem .5rem rgba(0, 0, 0, 0.06);
}

/* Left accent bar */
.ccu-tile-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #00A1BE 0%, #00CC78 100%);
    transform: scaleY(0.4);
    transform-origin: center;
    opacity: 0;
    transition: all .25s ease;
}

.ccu-tile:hover .ccu-tile-accent {
    transform: scaleY(1);
    opacity: 1;
}

.ccu-tile.is-system .ccu-tile-accent {
    background: linear-gradient(180deg, #C5CBD2 0%, #6C757D 100%);
}

.ccu-tile-icon {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .425rem;
    background: #E0F5F9;
    color: #00A1BE;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: all .2s ease;
}

.ccu-tile.is-system .ccu-tile-icon {
    background: #EEF1F4;
    color: #6C757D;
}

.ccu-tile:hover .ccu-tile-icon {
    background: #00A1BE;
    color: #FFF;
    transform: scale(1.05);
}

.ccu-tile.is-system:hover .ccu-tile-icon {
    background: #6C757D;
    color: #FFF;
    transform: none;
}

.ccu-tile-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: .15rem;
}

.ccu-tile-name {
    font-family: var(--font-primary);
    font-size: .9rem;
    font-weight: 600;
    color: #27282A;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ccu-tile-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6C757D;
    background: #EEF1F4;
    padding: .15rem .5rem;
    border-radius: 999px;
    align-self: flex-start;
}

.ccu-tile-badge i {
    font-size: .7rem;
}

.ccu-tile-delete {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #C5CBD2;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all .15s ease;
    opacity: 0;
}

.ccu-tile:hover .ccu-tile-delete {
    opacity: 1;
}

.ccu-tile-delete:hover {
    background: #FDE8F0;
    color: #D8237C;
    transform: scale(1.1);
}

/* ===== Empty state ===== */
.ccu-empty {
    background: #FFF;
    border: 2px dashed #DEE2E6;
    border-radius: .75rem;
    padding: 3rem 2rem;
    text-align: center;
    color: #6C757D;
    margin-top: 1.5rem;
}

.ccu-empty i {
    font-size: 2.75rem;
    color: #C5CBD2;
    margin-bottom: 1rem;
    display: block;
}

.ccu-empty-title {
    font-family: var(--font-headings);
    font-size: 1.15rem;
    font-weight: 600;
    color: #27282A;
    margin-bottom: .35rem;
}

.ccu-empty-sub {
    font-size: .9rem;
    color: #6C757D;
    margin-bottom: .5rem;
}

/* ===== Add New Modal ===== */
.ccu-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2050;
    padding: 1rem;
    animation: ccuFadeIn .15s ease-out;
}

@keyframes ccuFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ccuSlideIn {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.ccu-modal {
    background: #FFF;
    border-radius: .75rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: ccuSlideIn .2s ease-out;
}

.ccu-modal-header {
    background: linear-gradient(135deg, #00A1BE 0%, #007a8f 100%);
    color: #FFF;
    padding: 1.15rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ccu-modal-title {
    font-family: var(--font-headings);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .65rem;
}

.ccu-modal-title i {
    font-size: 1.05rem;
    opacity: .9;
}

.ccu-modal-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #FFF;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
    font-size: .95rem;
}

.ccu-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ccu-modal-body {
    padding: 1.5rem;
}

.ccu-modal-input {
    border-radius: .5rem;
    border: 1px solid #DEE2E6;
    padding: .65rem .85rem;
    font-size: .95rem;
    transition: all .15s ease;
}

.ccu-modal-input:focus {
    border-color: #00A1BE;
    box-shadow: 0 0 0 .2rem rgba(0, 161, 190, 0.15);
    outline: none;
}

.ccu-modal-hint {
    display: flex;
    justify-content: space-between;
    margin-top: .5rem;
    font-size: .75rem;
    color: #6C757D;
}

.ccu-hint-warn {
    color: #FF4A11 !important;
    font-weight: 600;
}

.ccu-modal-tip {
    color: #ADB5BD;
    font-style: italic;
}

.ccu-modal-error {
    margin-top: .85rem;
    padding: .65rem .85rem;
    background: #FDE8F0;
    color: #D8237C;
    border-radius: .425rem;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.ccu-modal-footer {
    padding: 1rem 1.5rem 1.25rem 1.5rem;
    background: #F8F9FA;
    border-top: 1px solid #E9ECEF;
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
}

/* ===== Responsive ===== */
@media (max-width: 767.98px) {
    .ccu-hero {
        padding: 1.25rem 1.25rem 1.5rem 1.25rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .ccu-hero-title {
        font-size: 1.5rem;
    }

    .ccu-hero-title i {
        font-size: 1.4rem;
    }

    .ccu-hero-right {
        flex: 1 1 100%;
        min-width: 0;
    }

    .ccu-stats {
        padding-left: 0;
        justify-content: flex-end;
    }

    .ccu-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================
   Account Detail Types — Account Type filter chips + parent badges
   ============================================================= */

.adt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.adt-chip {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem 1rem;
    background: #FFF;
    border: 1.5px solid #DEE2E6;
    border-radius: 999px;
    color: #6C757D;
    font-family: var(--font-primary);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}

.adt-chip:hover {
    border-color: #00A1BE;
    color: #00A1BE;
    transform: translateY(-1px);
    box-shadow: 0 .2rem .4rem rgba(0, 161, 190, 0.1);
}

.adt-chip.active {
    background: #00A1BE;
    border-color: #00A1BE;
    color: #FFF;
}

.adt-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 .45rem;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    color: inherit;
}

.adt-chip.active .adt-chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #FFF;
}

.adt-chip.adt-chip-asset.active {
    background: #00CC78;
    border-color: #00CC78;
}

.adt-chip.adt-chip-liability.active {
    background: #FF4A11;
    border-color: #FF4A11;
}

.adt-chip.adt-chip-equity.active {
    background: #00A1BE;
    border-color: #00A1BE;
}

/* ===== Parent badges on detail type tiles ===== */

.adt-tile-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-top: .15rem;
}

.adt-parent-badge {
    display: inline-flex;
    align-items: center;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .15rem .55rem;
    border-radius: 999px;
    line-height: 1.3;
}

.adt-parent-badge.adt-parent-asset {
    background: #E0F8EE;
    color: #007a47;
}

.adt-parent-badge.adt-parent-liability {
    background: #FFE7DE;
    color: #B32E0A;
}

.adt-parent-badge.adt-parent-equity {
    background: #E0F5F9;
    color: #00657A;
}

.adt-parent-badge.adt-parent-neutral {
    background: #EEF1F4;
    color: #6C757D;
}
