/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* Money/Balance colors */
    --color-positive: #16a34a;      /* green-600 */
    --color-negative: #dc2626;      /* red-600 */
    --color-neutral: #6b7280;       /* gray-500 */
    
    /* Flash highlight colors */
    --color-flash-success: #f0fdf4; /* green-50 */
    --color-flash-info: #f0f9ff;    /* blue-50 */
    
    /* Status colors */
    --color-status-active: #16a34a;
    --color-status-inactive: #9ca3af;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Money display */
.positive, .stat-positive { 
    color: var(--color-positive); 
}

.negative, .stat-negative { 
    color: var(--color-negative); 
}

.neutral, .stat-neutral { 
    color: var(--color-neutral); 
}

/* Status */
.status-active { 
    color: var(--color-status-active); 
}

.status-inactive { 
    color: var(--color-status-inactive); 
}

/* Override badges - consistent styling for all override indicators */
.override-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;  /* py-0.5 px-1.5 */
    font-size: 0.625rem;         /* text-[10px] */
    font-weight: 500;            /* font-medium */
    background-color: #fef3c7;   /* amber-100 */
    color: #b45309;              /* amber-700 */
    border-radius: 9999px;       /* rounded-full */
    white-space: nowrap;
}

/* Card-level cleared badge (same styling) */
.card-cleared-badge {
    display: inline-block;
    margin-left: 0.5rem;         /* ml-2 */
    padding: 0.125rem 0.375rem;  /* py-0.5 px-1.5 */
    font-size: 0.625rem;         /* text-[10px] */
    font-weight: 500;            /* font-medium */
    background-color: #fef3c7;   /* amber-100 */
    color: #b45309;              /* amber-700 */
    border-radius: 9999px;       /* rounded-full */
    white-space: nowrap;
}

/* iOS date input fix - prevent overflow */
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    max-width: 100%;
}

/* Webkit date input calendar icon */
input[type="date"]::-webkit-calendar-picker-indicator {
    padding: 0;
    margin: 0;
}

/* ============================================
   STATE CLASSES FOR JAVASCRIPT TOGGLING
   ============================================ */

/* Hidden state */
.is-hidden {
    display: none !important;
}

/* Body scroll lock (for modals) */
body.modal-open {
    overflow: hidden;
}

/* Flash highlight animation */
.flash-highlight-success {
    background-color: var(--color-flash-success);
    transition: background-color 0.3s;
}

.flash-highlight-info {
    background-color: var(--color-flash-info);
    transition: background-color 0.3s;
}

/* Fade out animation for element removal */
.fade-out {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 300ms, transform 300ms;
}

/* Chevron rotation */
.chevron-rotated {
    transform: rotate(90deg);
    transition: transform 0.2s;
}

.chevron-rotated-180 {
    transform: rotate(180deg);
    transition: transform 0.2s;
}

.chevron-default {
    transform: rotate(0deg);
    transition: transform 0.2s;
}

/* Opacity states */
.opacity-0 {
    opacity: 0;
}

.opacity-1 {
    opacity: 1;
}

/* Visibility states */
.visibility-hidden {
    visibility: hidden;
}

.visibility-visible {
    visibility: visible;
}

/* Position states for sticky headers */
.position-relative {
    position: relative;
}

.position-sticky {
    position: sticky;
}

/* Pointer events control */
.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}

/* Avatar fallback display */
.avatar-fallback {
    display: none;
}

.avatar-fallback.show {
    display: flex;
}

/* Transition for opacity changes */
.transition-opacity {
    transition: opacity 0.3s;
}

/* Toast fade animation */
.toast-fade {
    transition: opacity 0.3s;
}

/* ============================================
   SEMANTIC UTILITY CLASSES
   (Common Tailwind patterns extracted)
   ============================================ */

/* Form labels */
.form-label {
    display: block;
    font-size: 0.875rem;        /* text-sm */
    font-weight: 500;            /* font-medium */
    color: #6b7280;              /* text-gray-500 */
    margin-bottom: 0.375rem;     /* mb-1.5 */
}

.form-label-xs {
    display: block;
    font-size: 0.75rem;          /* text-xs */
    color: #9ca3af;              /* text-gray-400 */
    margin-bottom: 0.25rem;      /* mb-1 */
}

/* Form inputs */
.form-input {
    width: 100%;
    background-color: #f9fafb;   /* bg-gray-50 */
    border: 0;
    border-radius: 0.75rem;      /* rounded-xl */
    padding: 0.75rem 1rem;       /* px-4 py-3 */
    font-size: 1rem;             /* text-base */
}

.form-input:focus {
    outline: none;
    ring: 2px solid #3b82f6;     /* focus:ring-2 focus:ring-blue-500 */
    background-color: #ffffff;   /* focus:bg-white */
}

/* Modal containers */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);  /* bg-black/50 */
    display: flex;
    align-items: flex-end;                  /* items-end on mobile */
    justify-content: center;
    z-index: 50;
}

@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;                /* md:items-center */
    }
}

.modal-content {
    background-color: white;
    border-radius: 1rem 1rem 0 0;          /* rounded-t-2xl on mobile */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-content {
        border-radius: 1rem;                /* md:rounded-2xl */
        max-width: 32rem;                   /* md:max-w-lg */
        margin: 0 1rem;                     /* md:mx-4 */
    }
}

/* Section headers */
.section-header {
    font-size: 1.25rem;          /* text-xl */
    font-weight: 600;            /* font-semibold */
    color: #1f2937;              /* text-gray-800 */
    margin-bottom: 0.75rem;      /* mb-3 */
}

/* Card headers (with border) */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;       /* px-4 py-3 */
    border-bottom: 1px solid #f3f4f6;  /* border-b border-gray-100 */
}

.card-header.shrink {
    flex-shrink: 0;              /* shrink-0 */
}

/* Note: These semantic classes are optional. Templates can still use 
   Tailwind directly when one-off customization is needed. Use these 
   classes for consistency, but don't force everything into them. */
