/* Niyara EMI Calculator — all rules scoped under .nec so theme/Elementor styles don't leak in or out. */
.nec {
	--nec-primary: #1A56DB;
	--nec-accent: #E8740C;
	--nec-header-from: #1A56DB;
	--nec-header-to: #1E3A8A;
	--nec-panel: #F5F8FF;
	--nec-text: #0F172A;
	--nec-muted: #64748B;
	--nec-line: #E2E8F0;
	--nec-radius: 24px;
	font-family: inherit;
	color: var(--nec-text);
	border: 1px solid #DBE5FF;
	border-radius: var(--nec-radius);
	overflow: hidden;
	box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .12);
	background: var(--nec-panel);
	line-height: 1.4;
}
.nec *, .nec *::before, .nec *::after { box-sizing: border-box; }

.nec__header {
	background: linear-gradient(90deg, var(--nec-header-from), var(--nec-header-to));
	padding: 28px clamp(20px, 4vw, 48px);
}
.nec .nec__title { margin: 0; color: #fff; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; line-height: 1.2; }
.nec .nec__subtitle { margin: 6px 0 0; color: rgba(255, 255, 255, .82); font-size: 15px; }

.nec__body { padding: clamp(20px, 4vw, 48px); }
.nec__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 48px); align-items: center; }

/* Controls */
.nec__controls { display: flex; flex-direction: column; gap: 30px; }
.nec__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.nec .nec__label { font-weight: 600; font-size: 16px; color: #334155; margin: 0; }
.nec__box {
	display: inline-flex; align-items: center; gap: 4px;
	background: #fff; border: 1px solid var(--nec-line); border-radius: 8px;
	padding: 6px 12px; font-weight: 700; font-size: 15px; color: var(--nec-text);
}
.nec__box:focus-within { border-color: var(--nec-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nec-primary) 18%, transparent); }
.nec .nec__input {
	border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none;
	padding: 0 !important; margin: 0; min-height: 0; height: auto;
	font: inherit; font-weight: 700; color: inherit; text-align: right;
}
.nec .nec__input--amount { width: 7.5em; }
.nec .nec__input--rate { width: 3.2em; }
.nec .nec__input--tenure { width: 2.6em; }
.nec__unit-suffix { margin-left: 4px; }

.nec__tenure-head { display: flex; align-items: center; gap: 10px; }
.nec__unit { display: inline-flex; border: 1px solid var(--nec-line); border-radius: 6px; overflow: hidden; }
.nec .nec__unit-btn {
	border: 0; margin: 0; border-radius: 0; cursor: pointer;
	padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 700; line-height: 1.4;
	background: #fff; color: #475569; transition: background .15s, color .15s;
}
.nec .nec__unit-btn:hover { background: #F1F5F9; }
.nec .nec__unit-btn.is-active { background: var(--nec-primary); color: #fff; }

/* Range slider */
.nec .nec__range {
	-webkit-appearance: none; appearance: none; width: 100%; height: 8px; margin: 0; padding: 0;
	border: 0; border-radius: 999px; cursor: pointer; outline: none;
	background: linear-gradient(var(--nec-primary), var(--nec-primary)) 0 / var(--nec-fill, 0%) 100% no-repeat, #E2E8F0;
}
.nec .nec__range::-webkit-slider-thumb {
	-webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
	background: var(--nec-primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .3);
}
.nec .nec__range::-moz-range-thumb {
	width: 18px; height: 18px; border-radius: 50%;
	background: var(--nec-primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .3);
}
.nec .nec__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--nec-primary) 30%, transparent); }

/* Results */
.nec__chart-row { display: flex; align-items: center; gap: 28px; margin-bottom: 28px; }
.nec__donut {
	position: relative; flex-shrink: 0; width: 184px; height: 184px; border-radius: 50%;
	background: conic-gradient(var(--nec-accent) 0 var(--nec-interest, 50%), var(--nec-primary) 0);
	box-shadow: 0 10px 25px -8px rgba(15, 23, 42, .25);
}
.nec__donut-inner {
	position: absolute; inset: 16px; border-radius: 50%; background: #fff;
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.nec__donut-label { font-size: 12px; color: var(--nec-muted); }
.nec__donut-value { font-size: 24px; font-weight: 800; white-space: nowrap; }
.nec__legend { display: flex; flex-direction: column; gap: 14px; }
.nec__legend-item { display: flex; align-items: center; gap: 12px; }
.nec__swatch { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; }
.nec__swatch--principal { background: var(--nec-primary); }
.nec__swatch--interest { background: var(--nec-accent); }
.nec__legend-label { font-size: 13px; color: var(--nec-muted); }
.nec__legend-value { font-size: 18px; font-weight: 700; }

.nec__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.nec__card { background: #fff; border: 1px solid var(--nec-line); border-radius: 12px; padding: 16px 10px; text-align: center; }
.nec__card-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94A3B8; margin-bottom: 4px; }
.nec__card-value { font-size: 17px; font-weight: 800; color: var(--nec-primary); white-space: nowrap; }
.nec__card-value--accent { color: var(--nec-accent); }

/* Buttons */
.nec__actions { display: flex; justify-content: center; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.nec .nec__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: 0; border-radius: 12px; padding: 14px 28px; margin: 0; cursor: pointer;
	font: inherit; font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2;
	box-shadow: 0 8px 18px -8px rgba(15, 23, 42, .4); transition: filter .15s, transform .15s;
}
.nec .nec__btn:hover { filter: brightness(.92); }
.nec .nec__btn:active { transform: translateY(1px); }
.nec .nec__btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--nec-primary) 40%, transparent); outline-offset: 2px; }
.nec .nec__btn--primary { background: var(--nec-primary); }
.nec .nec__btn--accent { background: var(--nec-accent); }
.nec .nec__btn[disabled] { opacity: .6; cursor: progress; }

/* Schedule */
.nec__schedule { margin-top: 28px; }
.nec__schedule[hidden] { display: none; }
.nec__table-wrap { max-height: 420px; overflow: auto; background: #fff; border: 1px solid var(--nec-line); border-radius: 16px; }
.nec .nec__table { width: 100%; min-width: 600px; border-collapse: collapse; margin: 0; font-size: 14px; border: 0; }
.nec .nec__table th, .nec .nec__table td { border: 0; padding: 10px 18px; text-align: right; background: transparent; }
.nec .nec__table th:first-child, .nec .nec__table td:first-child { text-align: left; }
.nec .nec__table thead th {
	position: sticky; top: 0; z-index: 1; background: var(--nec-primary); color: #fff;
	font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.nec .nec__table tbody tr { border-bottom: 1px solid #F1F5F9; }
.nec .nec__table tbody tr:hover td { background: #F8FAFC; }
.nec .nec__table .nec__year td {
	background: color-mix(in srgb, var(--nec-primary) 7%, #fff); color: var(--nec-primary);
	font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-align: left; padding: 8px 18px;
}
.nec .nec__table .nec__c-month { color: var(--nec-muted); }
.nec .nec__table .nec__c-principal { color: var(--nec-primary); }
.nec .nec__table .nec__c-interest { color: var(--nec-accent); }
.nec .nec__table .nec__c-balance { font-weight: 600; }

.nec .nec__note { margin: 16px 0 0; text-align: center; font-size: 12px; color: #94A3B8; }

/* Responsive */
@media (max-width: 1024px) {
	.nec__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.nec__chart-row { flex-direction: column; gap: 20px; }
	.nec__legend { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 16px 24px; }
	.nec__cards { grid-template-columns: 1fr; }
	.nec__card { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; text-align: left; }
	.nec__card-label { margin: 0; }
	.nec .nec__btn { width: 100%; }
}
