/* Modern CSS variables and reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #0f172a;
    --muted: #64748b;
    --border: #e6e9f0;
    --surface: #ffffff;
    --bg: #f4f6fb;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04), 0 1px 3px 0 rgb(15 23 42 / 0.06);
    --shadow-md: 0 4px 10px -2px rgb(15 23 42 / 0.08), 0 2px 6px -2px rgb(15 23 42 / 0.06);
    --shadow-lg: 0 12px 24px -8px rgb(15 23 42 / 0.18);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    background-image: radial-gradient(circle at 0% 0%, rgb(99 102 241 / 0.06), transparent 40%),
        radial-gradient(circle at 100% 0%, rgb(236 72 153 / 0.05), transparent 40%);
    color: var(--ink);
    line-height: 1.5;
}

/* Nav styles */
.main-nav {
    background: linear-gradient(135deg, var(--primary-color, #4f46e5), var(--secondary-color, #4338ca));
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0.6rem 1rem;
    gap: 1rem;
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.65rem;
}

.nav-logo {
    height: 48px;
    width: auto;
    border-radius: 8px;
    background: rgb(255 255 255 / 0.9);
    padding: 2px;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    flex-wrap: nowrap;
}

.nav-links a {
    text-decoration: none;
    color: rgb(255 255 255 / 0.92);
    font-weight: 550;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #ffffff;
    background-color: rgb(255 255 255 / 0.18);
}

.user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.nav-username {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    font-weight: 600;
}

.user-greeting {
    font-size: 0.9rem;
    color: rgb(255 255 255 / 0.95);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--surface);
    min-width: 190px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 101;
    top: 100%;
    overflow: hidden;
    padding: 0.35rem;
}

.dropdown-content a {
    color: var(--ink);
    padding: 0.6rem 0.75rem;
    display: flex;
    border-radius: 8px;
}

.dropdown-content a:hover {
    background-color: #eef2ff;
    color: #4338ca;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-right .dropdown-content {
    right: 0;
    left: auto;
}


/* Page layouts */
.main-content {
    max-width: 1440px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: calc(100vh - 180px);
}

.main-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    margin-top: 2rem;
}

/* Buttons */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.btn-info,
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.35;
    box-sizing: border-box;
}

.btn-primary {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4338ca;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #4338ca;
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.btn-danger {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.btn-danger:hover {
    background-color: #fecaca;
    color: #991b1b;
}

.nav-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Compact Table Action Buttons */
table td .btn,
table td .btn-primary,
table td .btn-secondary,
table td .btn-danger,
table td .nav-btn,
.table td .btn,
.table td .btn-primary,
.table td .btn-secondary,
.table td .btn-danger,
.table td .nav-btn {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.main-nav .nav-btn.btn-danger,
.main-nav .nav-btn.btn-secondary {
    background-color: rgb(255 255 255 / 0.16);
    color: #ffffff;
    border-color: transparent;
}

.main-nav .nav-btn.btn-danger:hover,
.main-nav .nav-btn.btn-secondary:hover {
    background-color: rgb(255 255 255 / 0.28);
    color: #ffffff;
}

/* Grid & Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    position: relative;
    overflow: hidden;
    border-left: none !important;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.kpi-icon.blue {
    background: linear-gradient(135deg, #60a5fa, #2563eb);
}

.kpi-icon.green {
    background: linear-gradient(135deg, #34d399, #059669);
}

.kpi-icon.amber {
    background: linear-gradient(135deg, #fbbf24, #d97706);
}

.kpi-icon.purple {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
}

.kpi-icon.pink {
    background: linear-gradient(135deg, #f472b6, #db2777);
}

.kpi-icon.teal {
    background: linear-gradient(135deg, #2dd4bf, #0d9488);
}

.kpi-icon.indigo {
    background: linear-gradient(135deg, #818cf8, #4f46e5);
}

.kpi-icon.red {
    background: linear-gradient(135deg, #f87171, #dc2626);
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.kpi-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.kpi-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Section headers - Upgraded premium styling */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--primary-color, #4f46e5);
    background: rgb(79 70 229 / 0.08);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

/* Collapsible Filter Panel */
.filter-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.filter-panel summary {
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fafc;
    user-select: none;
}

.filter-panel summary::-webkit-details-marker {
    display: none;
}

.filter-panel summary:hover {
    background-color: #f1f5f9;
}

.filter-panel[open] summary {
    border-bottom: 1px solid var(--border);
}

.filter-panel .toggle-icon {
    font-size: 0.85rem;
    transition: transform 0.2s;
}

.filter-panel[open] .toggle-icon {
    transform: rotate(180deg);
}

.filter-content {
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-content .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

/* Collapsible Ledger Panel */
.ledger-details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.ledger-summary {
    padding: 1.1rem 1.5rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fafc;
    user-select: none;
}

.ledger-summary::-webkit-details-marker {
    display: none;
}

.ledger-summary:hover {
    background-color: #f1f5f9;
}

.ledger-details[open] .ledger-summary {
    border-bottom: 1px solid var(--border);
}

.ledger-details .toggle-icon {
    transition: transform 0.2s;
}

.ledger-details[open] .toggle-icon {
    transform: rotate(180deg);
}

/* Chart Styles */
.chart-card {
    padding: 1.5rem;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-title i {
    color: var(--primary-color, #4f46e5);
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Sub-nav tabs */
.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    background-color: #eef1f8;
    transition: all 0.2s;
}

.nav-tab:hover {
    background-color: #e2e6f0;
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--primary-color, #4f46e5), var(--secondary-color, #4338ca));
    color: #ffffff;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

th,
td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tbody tr {
    transition: background-color 0.15s;
}

tbody tr:hover td {
    background-color: #f5f6fe;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Forms styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.form-control {
    padding: 0.65rem 0.9rem;
    font-size: 0.875rem;
    border: 1px solid #d8dce8;
    border-radius: 9px;
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #4f46e5);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.12);
}

.form-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color, #4f46e5);
}

/* Alert styles */
.alert {
    padding: 0.8rem 1.1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fee2e2;
}

.alert-success {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #dcfce7;
}

/* Filters bar */
.filter-bar {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.filter-bar .form-group {
    flex: 1;
    min-width: 200px;
}

/* Ledger Matrix */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
}

.matrix-table th {
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.matrix-table td.matrix-cell {
    padding: 0.35rem 0.2rem;
    text-align: center;
    vertical-align: middle;
}

.matrix-pill {
    display: inline-block;
    min-width: 42px;
    padding: 0.25rem 0.35rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.matrix-pill-paid {
    background-color: #dcfce7;
    color: #15803d;
    cursor: pointer;
}

.matrix-pill-paid:hover {
    background-color: #bbf7d0;
}

.matrix-pill-unpaid {
    background-color: #fef2f2;
    color: #ef4444;
    cursor: pointer;
}

.matrix-pill-unpaid:hover {
    background-color: #fee2e2;
}

.matrix-pill-waiver {
    background-color: #f3f4f6;
    color: #4b5563;
    cursor: default;
}

.matrix-pill-muted {
    background-color: #f8fafc;
    color: #cbd5e1;
    cursor: default;
}

.status-cell {
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.status-paid {
    background-color: #dcfce7;
    color: #15803d;
    cursor: pointer;
}

.status-unpaid {
    background-color: #fef2f2;
    color: #b91c1c;
    cursor: pointer;
}

.status-pending {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    cursor: pointer;
}

.cell-amount {
    font-weight: 600;
}

/* Mobile Responsive Overrides */
.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    margin-left: auto;
    padding: 0.35rem 0.65rem;
    line-height: 1;
    transition: background 0.2s;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.25);
}

.dropdown-icon-chevron {
    font-size: 0.62rem;
    margin-left: 2px;
    opacity: 0.75;
    transition: transform 0.25s ease;
}

.dropdown.open .dropdown-icon-chevron,
.dropdown.active .dropdown-icon-chevron {
    transform: rotate(180deg);
}

@media (max-width: 1200px) {
    .nav-container {
        flex-wrap: wrap;
        padding: 0.65rem 0.85rem;
    }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .dropdown-icon-chevron {
        margin-left: auto;
        font-size: 0.75rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 0.85rem;
        gap: 0.35rem;
        padding: 0.5rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links > li {
        width: 100%;
    }

    .nav-links a,
    .nav-links .dropbtn {
        width: 100%;
        padding: 0.65rem 0.85rem;
        font-size: 0.95rem;
        justify-content: flex-start;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.06);
    }

    .nav-links a:hover,
    .nav-links .dropbtn:hover {
        background: rgba(255, 255, 255, 0.18);
    }

    .dropdown {
        width: 100%;
        display: block;
    }

    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        min-width: unset;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.18);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 8px;
        margin-top: 0.3rem;
        margin-bottom: 0.3rem;
        padding: 0.4rem;
        box-sizing: border-box;
    }

    .dropdown.open > .dropdown-content,
    .dropdown.active > .dropdown-content {
        display: flex !important;
        flex-direction: column;
        gap: 0.25rem;
    }

    .dropdown-content a {
        color: rgba(255, 255, 255, 0.92) !important;
        background: transparent !important;
        padding: 0.55rem 0.85rem;
        font-size: 0.88rem;
        border-radius: 6px;
    }

    .dropdown-content a:hover,
    .dropdown-content a:active {
        background: rgba(255, 255, 255, 0.18) !important;
        color: #ffffff !important;
    }

    .user-menu {
        margin-left: 0;
        margin-top: 0.4rem;
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin: 1rem auto;
        padding: 0 0.85rem;
    }

    /* KPI Grid Mobile Optimization */
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        gap: 0.85rem;
        margin-bottom: 1.25rem;
    }

    .kpi-card {
        padding: 1rem;
        gap: 0.4rem;
    }

    .kpi-value {
        font-size: 1.4rem;
    }

    .kpi-icon {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
    }

    /* Section Header and Action Buttons */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }

    .section-title {
        font-size: 1.35rem;
    }

    /* Filter Bars */
    .filter-bar,
    .filter-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }

    .filter-bar .form-group,
    .filter-content .form-group {
        min-width: 100%;
        width: 100%;
    }

    /* Force Form Grids to 1 column */
    .form-grid,
    .form-grid[style*="grid-template-columns"],
    div[style*="grid-template-columns: 1fr 2fr"],
    div[style*="grid-template-columns: 2fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    /* Table Mobile Touch Support */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius);
        margin-bottom: 1.25rem;
    }

    table {
        min-width: 580px;
    }

    th,
    td {
        padding: 0.6rem 0.75rem;
        font-size: 0.82rem;
    }

    /* Ensure modals fit comfortably on mobile */
    .card[id$="Modal"],
    [id$="Modal"].card,
    #classChallanModal,
    #appConfirmModal {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: calc(100vw - 24px) !important;
        max-width: 480px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        padding: 1.25rem 1rem !important;
        margin: 0 !important;
    }
}

/* Ensure global modal constraints across all viewport sizes */
.card[id$="Modal"],
[id$="Modal"].card,
#classChallanModal {
    max-height: 90vh !important;
    overflow-y: auto !important;
    width: 95%;
    max-width: 500px;
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* ==========================================================================
   Modern Ambient Form Validation & UX Enhancer Styles
   ========================================================================== */
.form-group {
    position: relative;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.label-row label,
.form-group > label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.field-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    user-select: none;
}

.field-pill.required {
    background-color: #f1f5f9;
    color: #475569;
}

.field-pill.optional {
    background-color: transparent;
    color: #94a3b8;
}

.form-control.is-invalid {
    border-color: #f43f5e !important;
    background-color: #fff1f2 !important;
    box-shadow: 0 0 0 3px rgb(244 63 94 / 0.12) !important;
    animation: gentleShake 0.25s ease-in-out;
}

.form-error-hint {
    font-size: 0.75rem;
    font-weight: 500;
    color: #e11d48;
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    animation: fadeIn 0.2s ease-in;
}

.char-meter {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s, background-color 0.2s;
    pointer-events: none;
    z-index: 2;
}

.char-meter.visible {
    opacity: 1;
}

.char-meter.limit-reached {
    color: #dc2626;
    background-color: #fef2f2;
    border-color: #fecaca;
}

.live-currency-preview {
    font-size: 0.75rem;
    font-weight: 600;
    color: #059669;
    background-color: #ecfdf5;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 0.25rem;
    display: inline-block;
    opacity: 0;
    transition: opacity 0.2s ease-in;
    width: fit-content;
}

.live-currency-preview.visible {
    opacity: 1;
}

@keyframes gentleShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: translateY(0); }
}