/* MyFinance — Core & Component Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

[x-cloak] { display: none !important; }

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --primary-50: #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
}

* {
    box-sizing: border-box;
    border-color: #e5e7eb;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f9fafb;
    color: #111827;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Base resets & layouts */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
#sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-width: 0;
    min-height: 100vh;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .sidebar-expanded #sidebar {
        width: 260px;
        transform: translateX(0);
    }
    .sidebar-collapsed #sidebar {
        width: 72px;
        transform: translateX(0);
    }
    .sidebar-expanded .main-content {
        margin-left: 260px;
    }
    .sidebar-collapsed .main-content {
        margin-left: 72px;
    }
}

@media (max-width: 1023px) {
    #sidebar {
        width: 260px;
        transform: translateX(-100%);
    }
    #sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
    }
}

/* Navigation Links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin: 0.125rem 0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.sidebar-link.active {
    background-color: #ecfdf5;
    color: #047857;
    font-weight: 600;
}

.sidebar-link.active svg {
    color: #059669;
}

.sidebar-section-label {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9ca3af;
}

/* Cards */
.card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.card-body {
    padding: 1.25rem 1.5rem;
}

/* Summary Card */
.summary-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.summary-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Buttons - TailAdmin Design System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
    transition: all 0.15s ease-in-out;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background-color: #059669;
    color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: #047857;
}

.btn-primary:active {
    background-color: #065f46;
}

.btn-secondary {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #334155;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

.btn-secondary:active {
    background-color: #f1f5f9;
}

.btn-outline {
    background-color: transparent;
    border-color: #059669;
    color: #059669;
}

.btn-outline:hover {
    background-color: #ecfdf5;
    color: #047857;
}

.btn-outline:active {
    background-color: #d1fae5;
}

.btn-ghost {
    background-color: transparent;
    border-color: transparent;
    color: #64748b;
}

.btn-ghost:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.btn-ghost:active {
    background-color: #e2e8f0;
}

.btn-danger {
    background-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

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

.btn-danger:active {
    background-color: #991b1b;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    color: #64748b;
    background-color: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease-in-out;
}

.btn-icon:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.btn-icon:active {
    background-color: #e2e8f0;
}

/* Button Sizes */
.btn-sm {
    height: 2rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.375rem;
}

.btn-md {
    height: 2.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.btn-lg {
    height: 3rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    gap: 0.625rem;
}

.btn-icon-sm {
    width: 2rem;
    height: 2rem;
    padding: 0.375rem;
}

.btn-icon-md {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
}

.btn-icon-lg {
    width: 3rem;
    height: 3rem;
    padding: 0.625rem;
}

/* Form inputs */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #111827;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-green { background-color: #d1fae5; color: #065f46; }
.badge-red { background-color: #fee2e2; color: #991b1b; }
.badge-yellow { background-color: #fef3c7; color: #92400e; }
.badge-blue { background-color: #dbeafe; color: #1e40af; }
.badge-gray { background-color: #f3f4f6; color: #374151; }

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid;
}

.alert-success { background-color: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background-color: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background-color: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background-color: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1rem;
    text-align: center;
}

.empty-state-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem;
}

.empty-state-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1.5rem;
    max-width: 20rem;
}

/* Page Header & Breadcrumbs */
.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 1.375rem; font-weight: 700; color: #111827; margin: 0; }
.page-subtitle { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #111827;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
