/**
 * 신용카드 리볼빙 이자 계산기
 * @package Zipper
 */

.ccric-hidden {
    display: none !important;
}

.ccric-main-layout {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ccric-main-layout,
.ccric-main-layout *,
.ccric-main-layout *::before,
.ccric-main-layout *::after {
    box-sizing: border-box;
}

.ccric-main-layout input:not([type="checkbox"]):not([type="radio"]),
.ccric-main-layout select,
.ccric-main-layout textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ccric-main-layout input[type="checkbox"],
.ccric-main-layout input[type="radio"] {
    width: 16px;
    height: 16px;
    max-width: none;
    flex: 0 0 auto;
}

.ccric-input-col {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ccric-result-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ccric-section,
.ccric-result-summary,
.ccric-chart-section,
.ccric-table-section {
    border: 1px solid #e8e3d9;
    border-radius: 12px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ccric-section-title {
    margin: 0 0 12px;
    color: #2d2a26;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ccric-section-title i {
    color: #d4af37;
}

.ccric-input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.ccric-input-group {
    margin: 0;
    min-width: 0;
}

.ccric-label {
    display: block;
    margin-bottom: 6px;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.42;
}

.ccric-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    overflow: hidden;
    background: #fbfaf8;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ccric-input-wrap:hover {
    border-color: #d4c67a;
}

.ccric-input-wrap:focus-within {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    background: #fff;
}

.ccric-input {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #2d2a26;
    font-size: 13px;
    line-height: 1.3;
    padding: 10px 12px;
    min-height: 42px;
    box-shadow: none;
    text-align: right;
}

.ccric-input:hover,
.ccric-input:focus {
    border: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
}

.ccric-input::placeholder {
    color: #b7b1a8;
}

.ccric-input[type="number"] {
    -moz-appearance: textfield;
}

.ccric-input[type="number"]::-webkit-outer-spin-button,
.ccric-input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
}

.ccric-unit {
    min-width: 56px;
    padding: 0 10px;
    border-left: 1px solid #e4ddd0;
    background: linear-gradient(180deg, #fcfbf8 0%, #f3efe8 100%);
    color: #7b7467;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    user-select: none;
}

.ccric-toggle-row {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e8dfd2;
    min-width: 0;
}

.ccric-toggle {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #4d473f;
    font-size: 12px;
    line-height: 1.45;
}

.ccric-toggle input[type="checkbox"] {
    margin-top: 1px;
    accent-color: #d4af37;
}

.ccric-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.ccric-tab {
    border: 1px solid #e4ded2;
    border-radius: 10px;
    background: #f7f5f1;
    color: #5f5a56;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ccric-tab:hover {
    border-color: #d4c67a;
    color: #2d2a26;
}

.ccric-tab.active,
.ccric-tab[aria-selected="true"] {
    border-color: #d4af37;
    background: #fff8e7;
    color: #704f00;
    box-shadow: 0 1px 3px rgba(212, 175, 55, 0.2);
}

.ccric-tab-panel {
    min-width: 0;
}

.ccric-tab-panel[hidden] {
    display: none !important;
}

.ccric-panel-note {
    margin: 0;
    color: #6b645a;
    font-size: 12px;
    line-height: 1.55;
}

.ccric-btn-group {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.ccric-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    min-height: 44px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ccric-btn-primary {
    flex: 1;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #c69a23 100%);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.ccric-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.ccric-btn-ghost {
    color: #5f5a56;
    background: #f5f3f0;
    border: 1px solid #e8e4dc;
}

.ccric-btn-ghost:hover {
    border-color: #d4c67a;
    color: #2d2a26;
}

.ccric-btn[hidden] {
    display: none !important;
}

.ccric-waiting {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px dashed #e7d8b8;
    background: #fffcf4;
    color: #6b645a;
    font-size: 13px;
}

.ccric-waiting[hidden] {
    display: none !important;
}

.ccric-waiting i {
    color: #d4af37;
    font-size: 14px;
}

.ccric-waiting p {
    margin: 0;
    line-height: 1.45;
}

.ccric-warning-section {
    border-color: #efe3c8;
    background: #fffdf8;
}

.ccric-warning-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #544f47;
    font-size: 12px;
    line-height: 1.5;
}

.ccric-warning-list li.is-warning {
    color: #8a5c00;
}

.ccric-warning-list li.is-danger {
    color: #a2362a;
}

.ccric-summary-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: #f8f2df;
    color: #8d6a12;
    font-size: 11px;
    font-weight: 700;
}

.ccric-summary-title {
    margin: 10px 0 6px;
    color: #2d2a26;
    font-size: 20px;
    line-height: 1.35;
}

.ccric-summary-note {
    margin: 0;
    color: #6b645a;
    font-size: 13px;
    line-height: 1.55;
}

.ccric-kpi-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ccric-kpi-card,
.ccric-sub-card {
    border: 1px solid #eee6d9;
    border-radius: 10px;
    background: #fcfbf8;
    padding: 12px;
    min-width: 0;
}

.ccric-kpi-card {
    background: linear-gradient(180deg, #fffcf6 0%, #fcf7eb 100%);
    border-color: #ebdfc9;
}

.ccric-kpi-label,
.ccric-sub-label {
    display: block;
    margin-bottom: 6px;
    color: #7b7467;
    font-size: 12px;
    line-height: 1.4;
}

.ccric-kpi-value,
.ccric-sub-value {
    display: block;
    color: #2d2a26;
    line-height: 1.25;
    letter-spacing: -0.01em;
    word-break: keep-all;
}

.ccric-kpi-value {
    font-size: 22px;
    font-weight: 800;
}

.ccric-sub-value {
    font-size: 16px;
    font-weight: 700;
}

#ccricKpiFee,
#ccricSubTotalOutflow {
    color: #9a4d08;
}

#ccricKpiCarry,
#ccricSubPeakCarry {
    color: #a2362a;
}

#ccricKpiPayment,
#ccricKpiRate,
#ccricSubCurrentBilled,
#ccricSubRevolvingTarget {
    color: #1f7f4d;
}

.ccric-sub-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ccric-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ccric-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
}

#ccricDownloadBtn.tool-btn.tool-btn-excel,
.ccric-download-btn.tool-btn.tool-btn-excel {
    color: #fff;
    background: linear-gradient(135deg, #59ab79 0%, #4b9a69 100%);
    border: 1px solid #448e62;
    box-shadow: 0 2px 6px rgba(72, 146, 103, 0.28);
}

#ccricDownloadBtn.tool-btn.tool-btn-excel:hover,
.ccric-download-btn.tool-btn.tool-btn-excel:hover {
    background: linear-gradient(135deg, #4f9f70 0%, #438f62 100%);
    box-shadow: 0 4px 12px rgba(67, 133, 93, 0.34);
}

.ccric-chart-sub {
    margin: 0 0 10px;
    color: #6b645a;
    font-size: 12px;
    line-height: 1.5;
}

.ccric-chart-wrap {
    position: relative;
    width: 100%;
    height: 320px;
    min-width: 0;
}

.ccric-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.ccric-chart-fallback {
    margin: 8px 0 0;
    color: #8a5c00;
    font-size: 12px;
    line-height: 1.45;
}

.ccric-chart-fallback[hidden],
.ccric-chart-fallback-wrap[hidden] {
    display: none !important;
}

.ccric-chart-fallback-wrap,
.ccric-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.ccric-chart-fallback-wrap {
    margin-top: 8px;
}

.ccric-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.ccric-fallback-table {
    min-width: 560px;
}

.ccric-table th,
.ccric-table td {
    border-bottom: 1px solid #f0ece4;
    padding: 10px 8px;
    text-align: right;
    color: #4d473f;
    font-size: 12px;
    line-height: 1.45;
    vertical-align: middle;
    white-space: nowrap;
}

.ccric-table th:first-child,
.ccric-table td:first-child {
    text-align: left;
}

.ccric-table thead th {
    background: #faf7f0;
    color: #665f53;
    font-weight: 700;
}

.ccric-empty-row td {
    text-align: center !important;
    color: #9b9387;
}

.ccric-notice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ccric-notice-item {
    border: 1px solid #eee7dc;
    border-radius: 10px;
    background: #fbfaf8;
    padding: 10px;
    min-width: 0;
}

.ccric-notice-label {
    display: block;
    margin-bottom: 4px;
    color: #7b7467;
    font-size: 11px;
}

.ccric-notice-value {
    display: block;
    color: #2d2a26;
    font-size: 12px;
    line-height: 1.45;
    word-break: keep-all;
}

@media (max-width: 1200px) {
    .ccric-kpi-grid,
    .ccric-sub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ccric-notice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ccric-main-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ccric-input-col {
        position: static;
    }

    .ccric-section,
    .ccric-result-summary,
    .ccric-chart-section,
    .ccric-table-section {
        padding: 16px;
    }

    .ccric-input-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ccric-chart-head {
        flex-direction: column;
        align-items: stretch;
    }

    .ccric-download-btn {
        width: 100%;
        justify-content: center;
    }

    .ccric-chart-wrap {
        height: 280px;
    }

    .ccric-table {
        min-width: 760px;
    }

    .ccric-fallback-table {
        min-width: 520px;
    }
}

@media (max-width: 768px) {
    .ccric-input-grid,
    .ccric-kpi-grid,
    .ccric-sub-grid,
    .ccric-notice-grid {
        grid-template-columns: 1fr;
    }

    .ccric-tabs {
        grid-template-columns: 1fr;
    }

    .ccric-btn-group {
        flex-direction: column;
    }

    .ccric-btn {
        width: 100%;
    }

    .ccric-chart-wrap {
        height: 250px;
    }

    .ccric-table {
        min-width: 700px;
    }

    .ccric-fallback-table {
        min-width: 500px;
    }
}

@media (max-width: 480px) {
    .ccric-section,
    .ccric-result-summary,
    .ccric-chart-section,
    .ccric-table-section {
        padding: 14px;
        border-radius: 10px;
    }

    .ccric-summary-title {
        font-size: 18px;
    }

    .ccric-kpi-value {
        font-size: 19px;
    }

    .ccric-sub-value {
        font-size: 15px;
    }

    .ccric-input,
    .ccric-btn,
    .ccric-tab {
        font-size: 14px;
    }

    .ccric-unit {
        min-width: 48px;
        padding: 0 8px;
        font-size: 11px;
    }

    .ccric-table {
        min-width: 620px;
    }

    .ccric-fallback-table {
        min-width: 460px;
    }

    .ccric-chart-wrap {
        height: 220px;
    }
}
