:root {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --radius: 1rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
}


.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    box-sizing: border-box;
    z-index: 50;
    /* Lower than backdrop/modal */
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    margin-bottom: 2.5rem;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a,
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.sidebar-nav a i,
.sidebar-footer a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-nav a:hover,
.sidebar-footer a:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary-color);
}

.sidebar-nav li.active a,
.sidebar-footer a.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-separator {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 1rem;
}

.sidebar-nav li.active a i,
.sidebar-nav li.active a .text-danger,
.sidebar-nav li.active a .text-success {
    color: white !important;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.main-content {
    flex-grow: 1;
    margin-left: 260px;
    padding: 2.5rem 3rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center horizontally */
}

.main-content>* {
    width: 100%;
}

.main-content>.full-width {
    max-width: none;
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

/* Typography */
h1,
h2,
h3 {
    margin-top: 0;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.025em;
}

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

/* Components */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    /* Pill shape */
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow);
}

.btn-danger {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #fca5a5;
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input,
select {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #ffffff;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Utilities */
.flex {
    display: flex;
}

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

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.flex-col {
    flex-direction: column;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.ml-1 {
    margin-left: 0.25rem;
}

.mr-1 {
    margin-right: 0.25rem;
}

.gap-4 {
    gap: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-4 {
    margin-top: 1rem;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

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

.font-bold {
    font-weight: 700;
}

/* Dashboard Specific */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.summary-value {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0.5rem 0;
    letter-spacing: -0.05em;
}

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

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

.transaction-list {
    list-style: none;
    padding: 0;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s;
}

.transaction-item:hover {
    background-color: #f8fafc;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-date {
    background: #e2e8f0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    margin-right: 1.5rem;
    text-transform: uppercase;
    text-align: center;
    min-width: 40px;
}

.transaction-main {
    flex-grow: 1;
}

.transaction-category {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transaction-amount {
    font-weight: 800;
    font-size: 1.25rem;
    margin-left: 1rem;
}

/* Tags Styles - "Typical Tag" Shape */
.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    position: relative;
    border-radius: 4px;
    /* Slight roundness */
    /* Clip path for tag shape */
    clip-path: polygon(10px 0%, 100% 0%, 100% 100%, 10px 100%, 0% 50%);
    padding-left: 15px;
    /* Compense for the point */
}

/* Hole in the tag */
.tag-badge::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0.7;
}

.category-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.category-row:last-child {
    border-bottom: none;
}

.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    /* Higher than sidebar */
    display: none;
    transition: opacity 0.2s;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    z-index: 300;
    /* Higher than backdrop */
    display: none;
    width: 90%;
    max-width: 400px;
}

.backdrop.active {
    display: block;
}

.modal.active {
    display: block;
    animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.persistent-footer {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    text-align: center;
    z-index: 40;
}

.persistent-footer p {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
}

.main-content {
    padding-bottom: 5rem;
    /* Space for the fixed footer */
}

@media (max-width: 768px) {
    .persistent-footer {
        left: 0;
    }

    .main-content {
        padding-bottom: 4rem;
    }
}