:root {
    /* === PALETTE === */
    --ink:        #262626; /* Near-black — primary text, active fills  */
    --sand:       #F2CB9B; /* Warm amber — primary accent, CTAs        */
    --stone:      #8C8274; /* Warm gray  — secondary text, icons       */
    --fog:        #BFBFBF; /* Light gray — dividers, inactive UI       */
    --paper:      #F2F2F2; /* Near-white — page canvas, card surfaces  */

    /* Derived semantic aliases */
    --bg-main:           var(--paper);
    --bg-surface:        #ffffff;
    --bg-surface-glass:  rgba(255,255,255,0.72);
    --bg-input:          rgba(38,38,38,0.04);
    --bg-input-focus:    #ffffff;

    --text-primary:      var(--ink);
    --text-secondary:    var(--stone);
    --text-muted:        var(--fog);

    --color-primary:     var(--sand);
    --color-primary-ink: var(--ink);   /* text on sand buttons */
    --color-secondary:   var(--stone);
    --color-success:     #4a9c6d;
    --color-danger:      #b84c2e;
    --color-warning:     #c47e23;

    --shadow-card:  0 8px 32px -8px rgba(38,38,38,0.08), 0 2px 8px -2px rgba(38,38,38,0.04);
    --shadow-hover: 0 16px 48px -8px rgba(38,38,38,0.12), 0 4px 16px -2px rgba(242,203,155,0.12);
    --shadow-btn:   0 4px 14px rgba(242,203,155,0.32);

    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-card: 20px;
    --radius-btn:  10px;
    --radius-input:12px;
    --radius-pill: 9999px;
}

/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--fog); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--stone); }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
@media (min-width: 769px) {
    .app-container { flex-direction: row; }
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
    background: var(--ink);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}
@media (min-width: 769px) {
    .sidebar { width: 248px; min-height: 100vh; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}

.sidebar-brand { padding: 1.5rem 1.5rem 1rem; }
@media (min-width: 769px) { .sidebar-brand { padding: 2rem 1.75rem 1.25rem; } }

.logo-container { display: flex; align-items: center; gap: 0.75rem; }

.logo-mark {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--sand);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink);
    font-weight: 800; font-size: 1.1rem;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.2rem; font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--paper);
}

.text-accent { color: var(--sand); }

.sidebar-nav {
    display: flex; flex-direction: row;
    gap: 0.5rem; padding: 0.75rem 1.25rem;
    overflow-x: auto;
}
@media (min-width: 769px) {
    .sidebar-nav { flex: 1; flex-direction: column; padding: 1rem 1rem; overflow-x: visible; }
}

.nav-item-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--fog);
    text-decoration: none;
    border-radius: var(--radius-pill);
    font-size: 0.9rem; font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.nav-item-link i { font-size: 1.1rem; transition: transform 0.2s ease; }

.nav-item-link:hover {
    color: var(--paper);
    background: rgba(242,242,242,0.07);
}
.nav-item-link:hover i { transform: scale(1.1); }

.nav-item-link.active {
    color: var(--ink) !important;
    background: var(--sand) !important;
    box-shadow: var(--shadow-btn);
}
.nav-item-link.active i { color: var(--ink) !important; }

.sidebar-footer {
    display: none;
}
@media (min-width: 769px) {
    .sidebar-footer {
        display: block;
        padding: 1.25rem 1.5rem;
        border-top: 1px solid rgba(242,242,242,0.08);
    }
}

.status-indicator { display: flex; align-items: center; gap: 0.5rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-dot.authenticated { background: var(--color-success); }
.status-dot.guest { background: var(--color-warning); }
.status-text { font-size: 0.82rem; color: var(--fog); font-weight: 500; }

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
    flex: 1;
    display: flex; flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
    background: var(--paper);
}

/* ─── TOP BAR ────────────────────────────────────────────── */
.top-bar {
    height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem;
    background: rgba(242,242,242,0.80);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky; top: 0; z-index: 9;
    border-bottom: 1px solid rgba(191,191,191,0.3);
}
@media (min-width: 769px) { .top-bar { padding: 0 2rem; } }

.top-bar-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.2px; color: var(--ink); }
.top-bar-actions { display: flex; align-items: center; }
.user-profile { display: flex; align-items: center; gap: 0.75rem; }

.user-badge {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    background: rgba(74,156,109,0.1);
    color: var(--color-success);
    font-size: 0.8rem; font-weight: 700;
}

.btn-logout {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-btn);
    background: rgba(184,76,46,0.08);
    color: var(--color-danger);
    font-size: 0.82rem; font-weight: 700;
    border: none; cursor: pointer;
    transition: all 0.2s ease;
}
.btn-logout:hover { background: var(--color-danger); color: #fff; }

.btn-login {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-btn);
    background: var(--bg-surface);
    color: var(--ink);
    font-size: 0.85rem; font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}
.btn-login:hover { background: var(--ink); color: var(--sand); }

/* ─── PAGE CONTENT ───────────────────────────────────────── */
.page-content { padding: 1.25rem; }
@media (min-width: 769px) { .page-content { padding: 2rem; } }

/* ─── CARDS ──────────────────────────────────────────────── */
.glass-card {
    background: var(--bg-surface-glass);
    border: none;
    border-radius: var(--radius-card);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), box-shadow 0.28s ease;
}
@media (min-width: 769px) { .glass-card { padding: 2rem; } }
.glass-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.glass-card-header {
    padding-bottom: 1.1rem; margin-bottom: 1.4rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(191,191,191,0.25);
}

.card-title {
    font-size: 1.15rem; font-weight: 700; letter-spacing: -0.25px;
    color: var(--ink);
    display: flex; align-items: center; gap: 0.65rem;
}
.card-title i { color: var(--sand); }

/* ─── FORMS ──────────────────────────────────────────────── */
.form-grid {
    display: grid; grid-template-columns: 1fr;
    gap: 1.1rem; margin-bottom: 1.1rem;
}
@media (min-width: 576px) {
    .form-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

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

.form-label {
    font-size: 0.75rem; font-weight: 700;
    color: var(--stone);
    letter-spacing: 0.6px; text-transform: uppercase;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: none; border-radius: var(--radius-input);
    color: var(--ink);
    font-family: var(--font-family); font-size: 0.95rem;
    transition: all 0.2s ease;
}
.form-input:focus {
    outline: none;
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(242,203,155,0.35);
}

.form-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: var(--bg-input);
    border: none; border-radius: var(--radius-input);
    color: var(--ink);
    font-family: var(--font-family); font-size: 0.95rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%238C8274' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.form-select:focus {
    outline: none;
    background-color: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(242,203,155,0.35);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: none; border-radius: var(--radius-input);
    color: var(--ink);
    font-family: var(--font-family); font-size: 0.95rem;
    min-height: 80px; resize: vertical;
    transition: all 0.2s ease;
}
.form-textarea:focus {
    outline: none;
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(242,203,155,0.35);
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn-primary-glow {
    background: var(--sand);
    border: none; color: var(--ink);
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-btn);
    font-weight: 700; font-family: var(--font-family); font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center;
    box-shadow: var(--shadow-btn);
    transition: all 0.22s ease;
}
.btn-primary-glow:hover { background: #e8bb82; transform: translateY(-1px); }
.btn-primary-glow:active { transform: translateY(1px); }

.btn-secondary-flat {
    background: rgba(38,38,38,0.05);
    border: none; color: var(--ink);
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-btn);
    font-weight: 600; font-family: var(--font-family); font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-secondary-flat:hover { background: rgba(38,38,38,0.1); }

.btn-danger-flat {
    background: rgba(184,76,46,0.08);
    border: none; color: var(--color-danger);
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-weight: 700; font-family: var(--font-family); font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.4rem;
    transition: all 0.2s ease;
}
.btn-danger-flat:hover { background: var(--color-danger); color: #fff; }

/* ─── LAYOUT GRIDS ───────────────────────────────────────── */
.dashboard-grid {
    display: grid; grid-template-columns: 1fr;
    gap: 1.5rem; align-items: start;
}
@media (min-width: 1025px) {
    .dashboard-grid { grid-template-columns: 3fr 2fr; gap: 2rem; }
}

.metrics-row {
    display: grid; grid-template-columns: 1fr;
    gap: 1rem; margin-bottom: 1.5rem;
}
@media (min-width: 480px) { .metrics-row { grid-template-columns: repeat(2,1fr); } }

/* ─── METRIC CARDS ───────────────────────────────────────── */
.metric-card {
    background: var(--bg-surface);
    border: none; border-radius: 14px;
    padding: 1.25rem 1.5rem;
    display: flex; flex-direction: column; gap: 0.4rem;
    box-shadow: 0 4px 16px rgba(38,38,38,0.04);
}

.metric-label {
    font-size: 0.75rem; font-weight: 700;
    color: var(--stone);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.75rem; font-weight: 800;
    letter-spacing: -0.5px; color: var(--ink);
}
.metric-value.highlight { color: var(--stone); }

.metric-detail { font-size: 0.78rem; color: var(--fog); }

/* ─── BREAKDOWN LIST ─────────────────────────────────────── */
.breakdown-list { display: flex; flex-direction: column; gap: 0.6rem; }

.breakdown-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: var(--bg-surface);
    border: none;
    box-shadow: 0 2px 8px rgba(38,38,38,0.025);
    transition: all 0.18s ease;
}
.breakdown-item:hover {
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(242,203,155,0.1);
}

.breakdown-name {
    font-size: 0.9rem; color: var(--stone);
    display: flex; align-items: center; gap: 0.45rem;
}
.breakdown-name i { color: var(--sand); }

.breakdown-value { font-weight: 700; color: var(--ink); }
.breakdown-value.total { font-size: 1.2rem; color: var(--stone); }

.breakdown-divider {
    height: 1px;
    background: rgba(191,191,191,0.3);
    margin: 0.3rem 0;
}

/* ─── TABLE ──────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

.custom-table {
    width: 100%; border-collapse: collapse;
    text-align: left; font-size: 0.9rem;
    background: var(--bg-surface);
}

.custom-table th {
    background: rgba(38,38,38,0.04);
    padding: 1rem;
    font-weight: 700; color: var(--stone);
    text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.5px;
}

.custom-table td {
    padding: 1rem; color: var(--ink); vertical-align: middle;
}

.custom-table tbody tr {
    border-bottom: 1px solid rgba(191,191,191,0.18);
    transition: background 0.15s ease;
}
.custom-table tbody tr:hover { background: rgba(242,203,155,0.06); }
.custom-table tbody tr:last-child { border-bottom: none; }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge-category {
    padding: 0.28rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    display: inline-block;
}
.badge-category.direct   { background: rgba(242,203,155,0.18); color: #8a6228; }
.badge-category.indirect { background: rgba(140,130,116,0.15); color: var(--stone); }
.badge-category.utility  { background: rgba(74,156,109,0.12);  color: var(--color-success); }
.badge-category.taxes    { background: rgba(184,76,46,0.10);   color: var(--color-danger); }

/* ─── ACTION ICONS ───────────────────────────────────────── */
.action-cell { display: flex; gap: 0.4rem; justify-content: flex-end; }

.btn-icon {
    width: 30px; height: 30px;
    border-radius: 7px; border: none;
    background: rgba(38,38,38,0.04);
    color: var(--stone);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.18s ease;
}
.btn-icon:hover { background: rgba(38,38,38,0.08); color: var(--ink); }
.btn-icon.edit:hover   { color: var(--stone); background: rgba(242,203,155,0.2); }
.btn-icon.delete:hover { color: var(--color-danger); background: rgba(184,76,46,0.08); }

/* ─── ALERTS ─────────────────────────────────────────────── */
.alert-message {
    padding: 0.8rem 1.1rem;
    border-radius: 12px;
    font-size: 0.85rem; font-weight: 600;
}
.alert-message.danger  { background: rgba(184,76,46,0.1);  color: var(--color-danger);  }
.alert-message.success { background: rgba(74,156,109,0.1); color: var(--color-success); }

/* ─── LOGIN ──────────────────────────────────────────────── */
.login-container {
    min-height: calc(100vh - 140px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%; max-width: 420px;
    border-radius: var(--radius-card); border: none;
    background: var(--bg-surface);
    box-shadow: var(--shadow-card);
    padding: 2.5rem;
    display: flex; flex-direction: column; gap: 1.5rem;
}

.login-header {
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.login-header h2 {
    font-size: 1.7rem; font-weight: 800;
    color: var(--ink); letter-spacing: -0.4px;
}
.login-subtitle { font-size: 0.88rem; color: var(--stone); }

/* ─── CSS-3D SERVER RACK (no image, no lib) ──────────────── */
.server-scene-container {
    display: flex; justify-content: center; align-items: center;
    margin: 0 auto 1.5rem; width: 120px; height: 120px;
}
.perspective-wrapper { perspective: 700px; }

.server-rack-3d {
    width: 72px; height: 108px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(22deg) rotateY(-32deg);
    animation: floatServer 4s ease-in-out infinite;
}
@keyframes floatServer {
    0%,100% { transform: rotateX(22deg) rotateY(-32deg) translateY(0);   }
    50%      { transform: rotateX(22deg) rotateY(-32deg) translateY(-8px); }
}

.rack-chassis {
    position: absolute; width: 72px; height: 108px;
    background: var(--ink);
    border-radius: 6px;
    display: flex; flex-direction: column;
    justify-content: space-around; padding: 7px 6px;
    box-shadow: 10px 10px 20px rgba(38,38,38,0.18);
}

.chassis-blade {
    height: 15px; background: #3a3a3a;
    border-radius: 3px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 5px;
}
.chassis-blade.active { background: var(--stone); }

.blade-led {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--fog);
}
.chassis-blade.active .blade-led {
    background: var(--sand);
    animation: blinkLed 0.9s infinite alternate;
}
@keyframes blinkLed {
    0%   { opacity: 0.25; }
    100% { opacity: 1; }
}
.blade-lines {
    flex: 1; height: 2px;
    background: rgba(255,255,255,0.08);
    margin: 0 5px;
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.38s cubic-bezier(0.16,1,0.3,1) forwards; }

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ─── FINAL PRICE FIX ────────────────────────────────────── */
/* Override: make the total amount always high-contrast dark ink */
.breakdown-value.total {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink) !important;   /* was var(--stone) — too light */
}
/* The total row itself gets the amber accent border */
.breakdown-item.total-row {
    background: rgba(242,203,155,0.18) !important;
    border-left: 4px solid var(--sand);
}
.breakdown-item.total-row .breakdown-name {
    color: var(--ink) !important;
    font-weight: 700;
}
/* Exchange-rate sub-label under total */
.breakdown-item.total-row .tc-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--stone);
    margin-top: 2px;
}

/* ─── TOGGLE PILL (admin toggles) ───────────────────────── */
.toggle-pill {
    display: inline-flex;
    align-items: center;
    position: relative;
    width: 40px; height: 22px;
    border-radius: 9999px;
    background: var(--fog);
    cursor: pointer;
    border: none;
    transition: background 0.25s ease;
    flex-shrink: 0;
}
.toggle-pill::after {
    content: '';
    position: absolute;
    left: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(38,38,38,0.2);
    transition: left 0.25s cubic-bezier(0.16,1,0.3,1);
}
.toggle-pill.active {
    background: var(--stone);
}
.toggle-pill.user-edit.active {
    background: var(--sand);
}
.toggle-pill.active::after {
    left: 21px;
}

/* ─── 3D ORBIT LOADER (full-page) ───────────────────────── */
.loader-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    min-height: 100vh;
    background: var(--paper);
}

.orbit-wrapper {
    position: relative;
    width: 120px; height: 120px;
}

/* Central server cube */
.orbit-core {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 36px; height: 36px;
    background: var(--ink);
    border-radius: 8px;
    animation: corePulse 2s ease-in-out infinite;
}
.orbit-core::before {
    content: '';
    position: absolute;
    inset: 6px;
    background: var(--sand);
    border-radius: 4px;
    animation: blinkLed 0.8s infinite alternate;
}

@keyframes corePulse {
    0%, 100% { transform: translate(-50%,-50%) scale(1);   box-shadow: 0 0 0 0 rgba(242,203,155,0.4); }
    50%       { transform: translate(-50%,-50%) scale(1.08); box-shadow: 0 0 0 12px rgba(242,203,155,0); }
}

/* Orbit ring 1 */
.orbit-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--sand);
    border-right-color: rgba(242,203,155,0.25);
    animation: orbitSpin 1.6s linear infinite;
}
.orbit-ring-2 {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: var(--stone);
    border-left-color: rgba(140,130,116,0.2);
    animation: orbitSpin 2.4s linear infinite reverse;
}

@keyframes orbitSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Orbiting dot */
.orbit-dot {
    position: absolute;
    top: -5px; left: 50%;
    transform: translateX(-50%);
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--sand);
    box-shadow: 0 0 8px var(--sand);
}

.loader-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--stone);
    letter-spacing: 0.5px;
    animation: fadeInOut 1.8s ease-in-out infinite;
}
@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 1; }
}

/* Compact mini loader for inline use */
.loader-3d-mini {
    width: 48px; height: 48px;
    position: relative;
}
.loader-3d-mini::before,
.loader-3d-mini::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}
.loader-3d-mini::before {
    border-top-color: var(--sand);
    animation: orbitSpin 1s linear infinite;
}
.loader-3d-mini::after {
    inset: 8px;
    border-bottom-color: var(--stone);
    animation: orbitSpin 1.6s linear infinite reverse;
}

/* ─── FLOATING COIN ANIMATION (calculator hero) ──────────── */
.coin-scene {
    perspective: 500px;
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
}
.coin {
    width: 64px; height: 64px;
    position: relative;
    transform-style: preserve-3d;
    animation: coinSpin 3s ease-in-out infinite;
    border-radius: 50%;
    background: var(--sand);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(242,203,155,0.4);
    font-size: 1.5rem; font-weight: 800; color: var(--ink);
}
@keyframes coinSpin {
    0%   { transform: rotateY(0deg) rotateX(8deg); }
    50%  { transform: rotateY(180deg) rotateX(8deg); }
    100% { transform: rotateY(360deg) rotateX(8deg); }
}

/* ─── PULSE ANIMATION for metric cards ──────────────────── */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 16px rgba(38,38,38,0.04); }
    50%       { box-shadow: 0 4px 24px rgba(242,203,155,0.18); }
}
.metric-card.animate-pulse { animation: pulseGlow 2.5s ease-in-out infinite; }

/* ─── SLIDE-IN ANIMATION ─────────────────────────────────── */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
.animate-slide-in { animation: slideInRight 0.4s cubic-bezier(0.16,1,0.3,1) forwards; }