/* ==========================================================
   Cayvoy Design System — Global CSS Tokens & Components
   ========================================================== */

/* ----------------------------------------------------------
   1. DARK SURFACE TOKENS
   ---------------------------------------------------------- */
:root {
    --ds-base:    #121212;
    --ds-surface: #181818;
    --ds-raised:  #1C1C1F;
    --ds-hover:   rgba(255, 255, 255, 0.04);
    --ds-border:  rgba(255, 255, 255, 0.07);
    --ds-text:    rgba(255, 255, 255, 0.88);
    --ds-muted:   rgba(255, 255, 255, 0.42);
    --ds-faint:   rgba(255, 255, 255, 0.18);
    --ds-shadow:  0 2px 8px rgba(0, 0, 0, 0.35);
    --ds-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
    --brand-lime: #B9FF66;
}

/* ----------------------------------------------------------
   2. PAGE LAYOUT
   ---------------------------------------------------------- */
.ds-page {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2.5rem 1rem;
}
@media (min-width: 640px)  { .ds-page { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .ds-page { padding-top: 4rem; padding-bottom: 4rem; } }

.ds-section-gap > * + * { margin-top: 1.5rem; }
.ds-grid { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1024px) { .ds-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); } }

/* ----------------------------------------------------------
   3. CARD SURFACE
   ---------------------------------------------------------- */
.dash-card {
    background: var(--ds-surface);
    border-radius: 1rem;
    border: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow);
    transition: box-shadow 0.2s ease;
}

/* ----------------------------------------------------------
   4. TYPOGRAPHY
   ---------------------------------------------------------- */
.stat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ds-muted);
    display: block;
}

.ds-heading {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.3;
}

.ds-subheading {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ds-text);
}

/* ----------------------------------------------------------
   5. BUTTON SYSTEM
   ---------------------------------------------------------- */

/* Base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.625rem 1.25rem;
    transition: opacity 0.15s ease, background 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    outline: none;
}

/* Primary — brand-lime fill */
.btn-primary {
    background: #B9FF66;
    color: #000;
    border: none;
}
.btn-primary:hover { opacity: 0.88; }

/* Secondary — raised surface */
.btn-secondary {
    background: var(--ds-raised);
    color: var(--ds-text);
    border: 1px solid var(--ds-border);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.06); }

/* Ghost — transparent */
.btn-ghost {
    background: transparent;
    color: var(--ds-muted);
    border: 1px solid var(--ds-border);
}
.btn-ghost:hover {
    background: var(--ds-hover);
    color: var(--ds-text);
}

/* Danger */
.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.18); }

/* Icon only — square */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 0.625rem;
    background: transparent;
    color: var(--ds-muted);
    border: 1px solid var(--ds-border);
}
.btn-icon:hover {
    background: var(--ds-hover);
    color: var(--ds-text);
}

/* Size modifiers */
.btn-sm { font-size: 0.6875rem; padding: 0.375rem 0.875rem; border-radius: 0.5rem; }
.btn-lg { font-size: 0.875rem;  padding: 0.75rem 1.75rem;   border-radius: 1rem; }
.btn-full { width: 100%; }

/* ----------------------------------------------------------
   6. INPUTS
   ---------------------------------------------------------- */
.ds-input {
    background: var(--ds-raised);
    border: 1px solid var(--ds-border);
    color: var(--ds-text);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    outline: none;
    width: 100%;
    transition: border-color 0.15s ease;
}
.ds-input:focus { border-color: rgba(255, 255, 255, 0.22); }
.ds-input::placeholder { color: var(--ds-faint); }
.ds-input:read-only { opacity: 0.7; cursor: default; }

/* Textarea variant */
.ds-textarea {
    background: var(--ds-raised);
    border: 1px solid var(--ds-border);
    color: var(--ds-text);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    outline: none;
    width: 100%;
    resize: vertical;
    transition: border-color 0.15s ease;
}
.ds-textarea:focus { border-color: rgba(255, 255, 255, 0.22); }
.ds-textarea::placeholder { color: var(--ds-faint); }

/* Select */
.ds-select {
    background: var(--ds-raised);
    border: 1px solid var(--ds-border);
    color: var(--ds-text);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.ds-select:focus { border-color: rgba(255, 255, 255, 0.22); }

/* ----------------------------------------------------------
   7. TAB STRIPS
   ---------------------------------------------------------- */
.ds-tabs {
    display: inline-flex;
    padding: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
}

.ds-tab {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 11px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
    color: var(--ds-muted);
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}
.ds-tab:hover { color: var(--ds-text); }
.ds-tab.active {
    background: var(--ds-raised);
    color: var(--ds-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ----------------------------------------------------------
   8. ICON WRAP
   ---------------------------------------------------------- */
.ds-icon-wrap {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--ds-muted);
}

/* ----------------------------------------------------------
   9. ICON BUTTON (header row variant)
   ---------------------------------------------------------- */
.dash-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    border: 1px solid var(--ds-border);
    color: var(--ds-muted);
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}
.dash-icon-btn:hover {
    background: var(--ds-hover);
    color: var(--ds-text);
}

/* ----------------------------------------------------------
   10. SIDEBAR / NAV ROWS
   ---------------------------------------------------------- */
.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    transition: background 0.15s ease;
    text-decoration: none;
}
.dash-nav-item:hover { background: var(--ds-hover); }

/* ----------------------------------------------------------
   11. ACTIVITY / DONOR CARDS
   ---------------------------------------------------------- */
.donate-card {
    border-radius: 0.75rem;
    border: 1px solid var(--ds-border);
    background: var(--ds-raised);
    padding: 0.875rem 1rem;
    transition: background 0.15s ease;
}
.donate-card:hover { background: rgba(255, 255, 255, 0.04); }
.donate-card.archived-card { background: rgba(255, 255, 255, 0.02); border-style: dashed; }
.donate-card.archived-card:hover { background: rgba(255, 255, 255, 0.035); }

/* ----------------------------------------------------------
   12. STAT BLOCKS
   ---------------------------------------------------------- */
.ds-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.ds-stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--ds-text);
    line-height: 1;
}
.ds-stat-value--accent { color: #B9FF66; }
.ds-stat-value--muted  { font-size: 1.5rem; color: var(--ds-muted); }
.ds-stat-hint {
    font-size: 0.75rem;
    color: var(--ds-faint);
}

/* ----------------------------------------------------------
   13. EMPTY STATES
   ---------------------------------------------------------- */
.ds-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1rem;
    text-align: center;
    gap: 0.75rem;
}
.ds-empty-icon {
    font-size: 3rem;
    color: var(--ds-faint);
}
.ds-empty-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ds-muted);
}

/* ----------------------------------------------------------
   14. BADGES / CHIPS
   ---------------------------------------------------------- */
.ds-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ds-muted);
}
.ds-badge--accent {
    background: rgba(185, 255, 102, 0.12);
    color: #B9FF66;
}
.ds-badge--success {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}
.ds-badge--danger {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
}
.ds-badge--warning {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

/* ----------------------------------------------------------
   15. DIVIDERS
   ---------------------------------------------------------- */
.ds-divider {
    height: 1px;
    background: var(--ds-border);
    margin: 1.25rem 0;
}

/* ----------------------------------------------------------
   16. LOADING STATES
   ---------------------------------------------------------- */
.ds-skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.07) 50%,
        rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: ds-shimmer 1.5s infinite;
    border-radius: 0.375rem;
}
@keyframes ds-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ----------------------------------------------------------
   17. SCROLLBAR RESET
   ---------------------------------------------------------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ----------------------------------------------------------
   18. PAGE ENTRY ANIMATION
   ---------------------------------------------------------- */
@keyframes ds-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ds-fade-in { animation: ds-fade-in 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
