/* CashBookPro — Main / Theme
 * ------------------------------------------------
 * Design tokens, CSS reset, base typography.
 * Accessibility: focus-visible outlines preserved (was incorrectly
 * disabled globally in the v1 release).
 */

/* ════════════════════════════════════════════════
 * DESIGN TOKENS
 * ════════════════════════════════════════════════ */
:root {
    /* Surfaces */
    --bg-dark:        #121212;
    --card-bg:        #1E1E1E;
    --panel-bg:       #222222;
    --input-bg:       #383838;
    --border-color:   #434343;

    /* Text */
    --text-primary:   #E0E0E0;
    --text-secondary: #9E9E9E;

    /* Brand & state */
    --orange-accent:  #ff9200;
    --orange-soft:    rgba(255, 146, 0, 0.1);
    --danger-color:   #ff5252;
    --success-color:  #4caf50;
    --warning-color:  #f1c40f;
    --info-color:     #3498db;

    /* Type */
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                  Helvetica, Arial, sans-serif;

    /* Layout */
    --safe-top:    env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Radius / shadows */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 2px 12px rgba(0,0,0,0.4);
}

/* ════════════════════════════════════════════════
 * RESET
 * ════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Allow text selection in form inputs */
body, button, [role="button"] {
    user-select: none;
    -webkit-user-select: none;
}
input, textarea, [contenteditable], .selectable {
    user-select: text;
    -webkit-user-select: text;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

body {
    overflow-x: hidden;
}

/* Accessibility: keep focus rings for keyboard users only */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--orange-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

button {
    font-family: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* ════════════════════════════════════════════════
 * SCROLLBAR
 * ════════════════════════════════════════════════ */
::-webkit-scrollbar          { width: 5px; height: 5px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: var(--orange-accent); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #ffaa33; }

/* ════════════════════════════════════════════════
 * REDUCED MOTION
 * ════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ════════════════════════════════════════════════
 * UTILITY CLASSES
 * ════════════════════════════════════════════════ */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-orange { color: var(--orange-accent); }
.text-danger { color: var(--danger-color); }
