/* ============================================
   Utility Bills — Styles
   Modern Dark Theme with Glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(30, 30, 60, 0.6);
    --bg-card-hover: rgba(40, 40, 80, 0.7);
    --bg-input: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.2);
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #0f0f1a 0%, #1e1e3a 100%);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ---- Layout ---- */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    position: relative;
    z-index: 1;
}

/* ---- Header ---- */
.header {
    text-align: center;
    margin-bottom: 48px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.logout-icon {
    font-size: 1rem;
    font-style: normal;
}

/* ---- Card ---- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title .icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--gradient-1);
    flex-shrink: 0;
}

/* ---- Form ---- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-glow);
}

.form-group .hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-group .error-text {
    font-size: 0.75rem;
    color: var(--danger);
    display: none;
}

.form-group .error-text.visible {
    display: block;
}

/* ---- Meter Input Row ---- */
.meter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 12px;
    align-items: end;
    grid-column: 1 / -1;
}

.meter-row .arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    padding-bottom: 14px;
}

.meter-row .result {
    font-weight: 600;
    color: var(--accent-light);
    font-size: 0.9rem;
    padding-bottom: 14px;
    min-width: 80px;
    text-align: right;
}

/* ---- Summary ---- */
.summary-grid {
    display: grid;
    gap: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.summary-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.summary-row .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-row .label .tariff-detail {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.01em;
}

.summary-row .value {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.summary-row.metered .value {
    color: var(--accent-light);
}

.summary-row.total-row {
    background: var(--gradient-1);
    border: none;
    padding: 16px 20px;
    margin-top: 8px;
}

.summary-row.total-row .label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 600;
}

.summary-row.total-row .value {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.form-actions {
    margin-top: 28px;
    display: flex;
    justify-content: flex-end;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: rgba(34, 197, 94, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px var(--success-glow);
}

.toast.error {
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px var(--danger-glow);
}

/* ---- History Table ---- */
.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.history-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}

.history-table tbody tr {
    background: var(--bg-input);
    transition: var(--transition);
}

.history-row-clickable {
    cursor: pointer;
}

.history-row-clickable:hover {
    background: rgba(139, 92, 246, 0.07) !important;
}

.history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

.history-table tbody td {
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
}

.history-table tbody td:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-left: 1px solid var(--border);
}

.history-table tbody td:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-right: 1px solid var(--border);
}



.history-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- Collapsible Summary ---- */
.summary-card {
    padding-bottom: 28px;
    transition: padding-bottom var(--transition);
}

.summary-card.summary-open {
    padding-bottom: 0;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding-bottom: 0;
    transition: var(--transition);
}

.summary-header:hover .summary-toggle-icon {
    color: var(--accent-light);
    transform: scale(1.2);
}

.btn-save-inline {
    padding: 9px 18px;
    font-size: 0.85rem;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: none;
    opacity: 0.35;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn-save-inline:not(:disabled) {
    opacity: 1;
}

.btn-save-inline:disabled {
    cursor: not-allowed;
    transform: none;
}

.summary-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-header-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-header-period {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.summary-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-header-total {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
}

.summary-toggle-icon {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
    line-height: 1;
}

.summary-details {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 0;
    padding-bottom: 0;
}

.summary-details.open {
    max-height: 900px;
    padding-top: 4px;
    padding-bottom: 28px;
}

/* ---- Heating Season ---- */
.heating-season-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.seasons-list {
    display: grid;
    gap: 8px;
}

.season-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.season-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.season-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.season-item-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.season-item-dates {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.btn-delete-season {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    line-height: 1;
    opacity: 0;
}

.season-item:hover .btn-delete-season {
    opacity: 1;
}

.btn-delete-season:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

/* ---- Row Tooltip ---- */
.has-tooltip > td:first-child {
    position: relative;
}

.row-tooltip {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    top: auto;
    z-index: 200;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    min-width: 240px;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.has-tooltip:hover .row-tooltip {
    display: block;
    animation: fadeInUp 0.15s ease-out;
}

.tooltip-row {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.tooltip-row:last-child {
    border-bottom: none;
}

/* ---- Date Cell ---- */
.date-cell {
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
    font-weight: 400 !important;
    white-space: nowrap;
}

/* ---- Delete Button ---- */
.delete-cell {
    width: 36px;
    text-align: center;
    padding: 8px 6px !important;
}

.btn-delete-payment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.history-table tbody tr:hover .btn-delete-payment {
    opacity: 1;
}

.btn-delete-payment:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

/* ---- Row Remove Animation ---- */
@keyframes rowFadeOut {
    from { opacity: 1; transform: scaleY(1); }
    to   { opacity: 0; transform: scaleY(0); }
}

.row-removing {
    animation: rowFadeOut 0.3s ease-out forwards;
    transform-origin: top;
    pointer-events: none;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px 28px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
    line-height: 1;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-cancel {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 11px 24px;
    font-size: 0.9rem;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 11px 24px;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(239, 68, 68, 0.7);
    color: #fca5a5;
    transform: translateY(-1px);
}

.btn-copy {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: var(--accent-light);
    padding: 11px 24px;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-copy:hover {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(139, 92, 246, 0.7);
    transform: translateY(-1px);
}

/* ---- Payment Detail Modal ---- */
.payment-detail-modal {
    max-width: 480px;
    text-align: left;
    position: relative;
    padding: 32px 28px 24px;
}

.payment-detail-modal .modal-icon {
    text-align: center;
}

.payment-detail-modal .modal-title {
    text-align: center;
    margin-bottom: 20px;
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.detail-status-paid {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.detail-status-pending {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.detail-rows {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 2px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.87rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.detail-label {
    white-space: nowrap;
}

.detail-value {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.detail-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.detail-total span:last-child {
    color: var(--accent-light);
}

/* ---- Payment Status Badge ---- */
.status-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-paid {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-toggle-paid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.btn-toggle-paid:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* ---- Loading Spinner ---- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .container {
        padding: 24px 16px 40px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .card {
        padding: 20px;
    }

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

    .meter-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .meter-row .arrow {
        display: none;
    }

    .meter-row .result {
        grid-column: 1 / -1;
        text-align: left;
    }

    .history-table {
        font-size: 0.8rem;
    }
}

/* ---- Fade-in Animation ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease-out backwards;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.2s;
}

.card:nth-child(4) {
    animation-delay: 0.3s;
}

.card:nth-child(5) {
    animation-delay: 0.4s;
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
}

.tab {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    background: var(--gradient-1);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* ---- Tariff Section Label ---- */
.tariff-section-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ---- Tariff History ---- */
.tariff-history-list {
    display: grid;
    gap: 16px;
}

.tariff-history-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: var(--transition);
}

.tariff-history-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.tariff-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tariff-month-badge {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-light);
}

.btn-edit-tariff {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--accent-light);
}

.btn-edit-tariff:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: scale(1.05);
}

.btn-delete-tariff {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: #f87171;
    opacity: 0;
}

.tariff-history-item:hover .btn-delete-tariff {
    opacity: 1;
}

.btn-delete-tariff:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.05);
}

.tariff-history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.tariff-history-grid span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 4px 0;
}

@media (max-width: 640px) {
    .tariff-history-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tabs {
        flex-direction: row;
    }

    .tab {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}