/* =========================================================
   app.css — global styles, resets, variables, typography
   ========================================================= */

/* CSS custom properties — single source of truth for the palette */
:root {
    /* backgrounds */
    --bg-page:        #F8FAFB;
    --bg-card:        #FFFFFF;

    /* text */
    --text-primary:   #1F2937;
    --text-secondary: #6B7280;
    --text-muted:     #9CA3AF;

    /* borders */
    --border:         #E5E7EB;
    --border-focus:   #059669;

    /* brand / CTA */
    --green-dark:     #059669;
    --green-bright:   #22C55E;

    /* deduction colors — used in charts and cards */
    --color-paye:     #F97316;
    --color-shif:     #3B82F6;
    --color-nssf:     #F59E0B;
    --color-levy:     #8B5CF6;
    --color-net:      #22C55E;

    /* feedback */
    --red:            #EF4444;
    --teal:           #14B8A6;

    /* spacing scale */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* typography */
    --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* transitions */
    --transition: all 0.3s ease;

    /* navbar height — used for scroll offset */
    --navbar-height: 64px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

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

input, select, textarea {
    font-family: inherit;
}

/* ---- main content flex-grows so footer sticks to bottom ---- */
.main-content {
    flex: 1;
}

/* =========================================================
   NAVBAR
   ========================================================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--navbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.navbar__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--green-dark);
}

.navbar__brand i {
    font-size: 1.3rem;
}

.navbar__links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.navbar__links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.navbar__links a:hover,
.navbar__links a.navbar__link--active {
    color: var(--green-dark);
}

/* underline for active link */
.navbar__links a.navbar__link--active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--green-dark);
    border-radius: 2px;
}

/* hamburger — hidden on desktop */
.navbar__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-sm);
}

.navbar__toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn--primary {
    background: var(--green-dark);
    color: #fff;
    border-color: var(--green-dark);
}

.btn--primary:hover {
    background: #047857;
    border-color: #047857;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn--outline {
    background: transparent;
    color: var(--green-dark);
    border-color: var(--green-dark);
}

.btn--outline:hover {
    background: var(--green-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn--sm {
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
}

.btn--lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

/* =========================================================
   CARDS
   ========================================================= */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* =========================================================
   SECTION / PAGE CONTAINERS
   ========================================================= */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-3xl) 0;
}

.section--sm {
    padding: var(--space-2xl) 0;
}

/* =========================================================
   TYPOGRAPHY HELPERS
   ========================================================= */

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-green     { color: var(--green-dark); }
.text-muted     { color: var(--text-muted); }

.font-tabular {
    font-variant-numeric: tabular-nums;
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    background: var(--text-primary);
    color: #D1D5DB;
    padding: var(--space-3xl) 0 var(--space-lg);
    margin-top: auto;
}

.footer__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.footer__top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--space-md);
}

.footer__logo i {
    color: var(--green-bright);
}

.footer__tagline {
    font-size: 0.9rem;
    color: #9CA3AF;
    max-width: 280px;
    line-height: 1.5;
}

.footer__group-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9CA3AF;
    margin-bottom: var(--space-md);
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer__links a {
    font-size: 0.9rem;
    color: #D1D5DB;
    transition: var(--transition);
}

.footer__links a:hover {
    color: var(--green-bright);
}

.footer__links span {
    font-size: 0.85rem;
    color: #9CA3AF;
}

.footer__bottom {
    border-top: 1px solid #374151;
    padding-top: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer__disclaimer {
    font-size: 0.82rem;
    color: #9CA3AF;
    font-style: italic;
}

.footer__copy {
    font-size: 0.82rem;
    color: #6B7280;
}

/* =========================================================
   UTILITY — PRINT
   ========================================================= */

@media print {
    .navbar,
    .footer,
    .btn,
    .settings-panel {
        display: none !important;
    }

    body {
        background: #fff;
    }
}
