
/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS CUSTOM PROPERTIES (THEME) */
:root {
    /* Colors - Dark Theme */
    --background: #1e1e1e;
    --foreground: #f2f2f2;
    --card: #292929;
    --card-foreground: #f2f2f2;
    --primary: #a78bfa;
    --primary-foreground: #fafafa;
    --secondary: #383838;
    --secondary-foreground: #e0e0e0;
    --muted: #383838;
    --muted-foreground: #999999;
    --accent: #383838;
    --accent-foreground: #f2f2f2;
    --destructive: #ef4444;
    --destructive-foreground: #fafafa;
    --border: #383838;
    --input: #383838;
    --ring: #a78bfa;

    /* Sidebar Colors */
    --sidebar: #242424;
    --sidebar-foreground: #e0e0e0;
    --sidebar-accent: #383838;
    --sidebar-accent-foreground: #f2f2f2;
    --sidebar-border: #383838;

    /* Typography */
    --font-size: 16px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;

    /* Spacing */
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 20px;

    /* Chart Colors */
    --chart-1: #a78bfa;
    --chart-2: #60a5fa;
    --chart-3: #34d399;
    --chart-4: #a855f7;
    --chart-5: #f472b6;

    /* Status Colors */
    --green: #4ade80;
    --yellow: #fbbf24;
    --red: #ef4444;
}

/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    overflow-x: hidden;
}

h1 {
    font-size: 1.875rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

h2 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

h3 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

h4 {
    font-size: 1.125rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

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

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

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


/* FORMS & INPUTS  */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  color: rgba(242, 242, 242, 0.8);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 1rem;
  outline: none;
}

select.form-input {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23f2f2f2" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.form-input::placeholder {
  color: var(--muted-foreground);
}


/* BUTTONS */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: rgba(167, 139, 250, 0.9);
}

.btn-secondary {
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  background-color: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
}

.btn-secondary:hover {
  background-color: rgba(56, 56, 56, 0.8);
}

.btn-danger {
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.9);
}

.btn-full {
  width: 100%;
  margin-top: 2rem;
}

.btn-icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* UTILITY CLASSES  */
.text-muted {
    color: var(--muted-foreground);
}

.text-primary {
    color: var(--primary);
}

/* APP LAYOUT  */
.app-layout {
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 16rem;
    background-color: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 1.5rem;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 0 0.60rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    color: rgba(224, 224, 224, 0.7);
    font-size: 0.875rem;
    text-decoration: none;
}

.nav-item:hover {
    background-color: rgba(56, 56, 56, 0.5);
    color: var(--sidebar-foreground);
}

.nav-item.active {
    background-color: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
}

.nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 16rem;
    overflow-y: auto;
    min-height: 100vh;
}

.page-container {
    padding: 2rem;
    max-width: 90rem;
    margin: 0 auto;
}

.page-title {
    font-size: 1.875rem;
    margin-bottom: 2rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

/*  CARDS */
.card {
    padding: 2rem;
    border-radius: var(--radius-lg);
    background-color: var(--card);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.card-label {
    font-size: 0.875rem;
    color: rgba(242, 242, 242, 0.6);
}

/* MOBILE NAVBAR */
.mobile-navbar {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--sidebar);
    border-bottom: 1px solid var(--sidebar-border);
    padding: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.mobile-navbar-brand {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--sidebar-foreground);
}

/* HAMBURGER BUTTON */
.hamburger-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 0.35rem;
    padding: 0.5rem;
}

.hamburger-btn span {
    width: 1.5rem;
    height: 0.2rem;
    background-color: var(--foreground);
    border-radius: 0.1rem;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(0.5rem, 0.5rem);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0.5rem, -0.5rem);
}

/* RESPONSIVE DESIGN  */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .budgets-grid {
        grid-template-columns: 1fr;
    }

    .tax-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .mobile-navbar {
        display: flex;
    }

    .sidebar {
        width: 16rem;
        position: fixed;
        height: 100vh;
        left: 0;
        top: 0;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .page-container {
        padding: 1rem;
    }

    .dashboard-stats {
        flex-direction: row;
    }

    .transactions-filters {
        flex-direction: column;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .tax-result-stats {
        grid-template-columns: 1fr;
    }

    /* Overlay to close sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 480px) {
    .balance-amount {
        font-size: 2.25rem;
    }

    .tax-result-amount {
        font-size: 2.25rem;
    }

    .stat-amount {
        font-size: 1.25rem;
    }
}

/* loading */
#global-loader {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.global-loader-backdrop {
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 14, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  color: #d6d9df;
  font-size: 0.95rem;
}
.global-loader-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: rgba(167, 139, 250, 1);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

/* Botones */
.pagination button {
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #e4e4e7;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover */
.pagination button:hover {
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.4);
}

/* Active (cuando quieras agregarlo luego) */
.pagination button.active {
    background: hsl(270, 60%, 65%);
    color: white;
    border-color: transparent;
}

/* Disabled */
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Label de página */
.pagination span {
    font-size: 0.85rem;
    color: hsl(0, 0%, 60%);
}