:root {
    color-scheme: only light;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --bg-main: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.05);
}

/* Base Styles */
html {
    font-size: 90%;
    -webkit-text-size-adjust: none;
    -moz-text-size-adjust: none;
    -ms-text-size-adjust: none;
    text-size-adjust: none;
}

body {
    background-color: var(--bg-main);
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px !important;
    -webkit-text-size-adjust: none;
    -moz-text-size-adjust: none;
    -ms-text-size-adjust: none;
    text-size-adjust: none;
}

.fw-black,
.font-black {
    font-weight: 900 !important;
}

.font-extrabold {
    font-weight: 800 !important;
}

.smallest {
    font-size: 0.7rem !important;
}

.uppercase {
    text-transform: uppercase !important;
}

.tracking-widest {
    letter-spacing: 0.1em !important;
}

.tracking-wider {
    letter-spacing: 0.05em !important;
}

.hover-bg-light:hover {
    background-color: #f8fafc !important;
}

.cursor-pointer {
    cursor: pointer !important;
}

/* Dropdown Custom */
.dropdown-menu-custom {
    display: none;
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #e2e8f0;
    min-width: 150px;
    overflow: hidden;
}

/* Standard Header Design System */
.header-icon-box {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
}

.header-icon-box i {
    color: #2563eb !important;
}

.header-main-title {
    font-size: 0.85rem;
    font-weight: 900;
    color: #334155;
    line-height: 1;
    letter-spacing: 0.5px;
}

.header-sub-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* FIXED HEADER SYSTEM */
#rumren-nav-fixed-root.rumren-monify-main-navigation {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    background: rgba(239, 246, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.main-content-wrapper {
    padding-top: 85px !important;
}

/* Hide main nav if it gets wrapped inside a drawer (direct access hack) */
.drawer-sheet .rumren-monify-main-navigation {
    display: none !important;
}

.rumren-nav-inner-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-badge-pill {
    display: flex;
    align-items: center;
    background: #eff6ff;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    padding: 2px 2px 2px 12px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.05);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.profile-badge-pill:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.12);
    border-color: #dbeafe;
}

.profile-info {
    line-height: 1;
    text-align: right;
}

.profile-name {
    color: #1e293b;
    font-weight: 900;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.profile-status {
    color: #2563eb;
    font-weight: 800;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
}

/* RUMREN HUB BUTTON */
.rumren-hub-btn {
    background: #131926;
    border: 2px solid #232a3b;
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.05);
}

.rumren-hub-btn .rh-text {
    font-size: 0.3rem;
    color: #94a3b8;
    font-weight: 800;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.rumren-hub-btn .rh-bold {
    font-size: 0.6rem;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: -0.2px;
}

.rumren-hub-btn:hover {
    background: #1e293b;
    transform: translateY(-1px);
    border-color: #334155;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.rumren-hub-btn:active {
    transform: scale(0.95);
}



.profile-img-wrapper {
    width: 34px;
    height: 34px;
    margin-left: 6px;
    flex-shrink: 0;
}

.profile-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Floating Glass Menu */
.floating-dock-wrapper {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1000 !important;
    width: auto;
    max-width: 95%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

body.drawer-open .floating-dock-wrapper {
    transform: translate(-50%, 100px) !important;
    opacity: 0;
    pointer-events: none;
}

.floating-dock {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 12px !important;
    padding: 6px 10px !important;
    display: flex !important;
    align-items: flex-end !important;
    gap: 4px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

.dock-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 50px !important;
    height: auto !important;
    padding: 4px 8px !important;
    flex-direction: column !important;
    border-radius: 8px !important;
    color: var(--text-muted) !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.dock-item i {
    font-size: 1.4rem !important;
    margin-bottom: 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 28px !important;
    width: 28px !important;
    color: inherit !important;
}

.dock-item span {
    display: block !important;
    font-size: 0.55rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    line-height: 1.2 !important;
}

.dock-item:hover,
.dock-item.active {
    background: transparent !important;
    color: var(--primary) !important;
}

.dock-item.fab-main i {
    font-size: 1.8rem !important;
}

.dock-item.fab-main:hover {
    transform: scale(1.1) translateY(-3px) !important;
}

/* Rest of the styles */
.container {
    max-width: 1000px;
}

.premium-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.premium-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.navbar-glass {
    min-height: 56px;
    display: flex;
    align-items: center;
    padding: 0.2rem 0;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.4rem 0.8rem !important;
    border-radius: var(--radius-md);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.smallest {
    font-size: 0.7rem;
}

.btn-premium {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .premium-card {
        border-radius: 12px;
        padding: 1rem !important;
    }
}

/* Global Drawer (Bottom Sheet) */
/* Global Drawer (Bottom Sheet) */
/* Global Drawer System (Uniform Sizes) */
[class*='drawer-overlay-'],
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 9999;
    display: none;
    align-items: flex-end;
    justify-content: center;
    transition: background 0.4s cubic-bezier(0.32, 0.72, 0, 1), backdrop-filter 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

[class*='drawer-overlay-'].show,
.drawer-overlay.show {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
}

[class*='drawer-panel-'],
.drawer-sheet {
    width: 100%;
    max-width: 550px;
    background: #fff;
    border-radius: 3.5rem 3.5rem 0 0;
    padding: 0 0 2.5rem 0;
    position: relative;
    height: 95vh;
    max-height: 95vh;
    scrollbar-width: thin;
    overscroll-behavior: contain;
    overflow: hidden;
    /* Changed to hidden to support masking */
    transform: translate3d(0, 100%, 0);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);

    /* MASK APPLIED TO ENTIRE DRAWER TO CLIP SCROLLING CONTENT */
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40 V15 C0 5 5 0 15 0 H35 C42 0 42 12 50 12 C58 12 58 0 65 0 H85 C95 0 100 5 100 15 V40 Z' fill='black'/%3E%3C/svg%3E"),
        linear-gradient(black, black);
    mask-position: top center, bottom center;
    mask-size: 100% 40px, 100% calc(100% - 40px);
    mask-repeat: no-repeat;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40 V15 C0 5 5 0 15 0 H35 C42 0 42 12 50 12 C58 12 58 0 65 0 H85 C95 0 100 5 100 15 V40 Z' fill='black'/%3E%3C/svg%3E"),
        linear-gradient(black, black);
    -webkit-mask-position: top center, bottom center;
    -webkit-mask-size: 100% 40px, 100% calc(100% - 40px);
    -webkit-mask-repeat: no-repeat;
}

/* Remove mask from pseudo-element as it's now on parent */
[class*='drawer-panel-']::before,
.drawer-sheet::before {
    display: none;
}

[class*='drawer-panel-'].show,
.drawer-sheet.show {
    transform: translate3d(0, 0, 0);
}

/* Internal content wrapper spacing (shifted below notch) */
[class*='drawer-panel-']>div:not(.drawer-handle):not(.drawer-footer) {
    padding: 1.5rem 1.1rem 0 1.1rem;
    /* Added top padding to clear notch */
    position: relative;
    z-index: 2;
    height: 100%;
    overflow-y: auto;
}

.drawer-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 0;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.drawer-handle {
    width: 42px;
    height: 4px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    position: absolute;
    top: 1px;
    /* Aligned with the top shoulder line of the notch */
    left: 50%;
    transform: translateX(-50%);
    flex-shrink: 0;
    z-index: 10;
}

@media (min-width: 769px) {

    [class*='drawer-overlay-'],
    .drawer-overlay {
        align-items: center;
        padding: 2rem;
    }

    [class*='drawer-panel-'],
    .drawer-sheet {
        border-radius: 1.5rem;
        height: 90vh;
        margin-bottom: 0;
        transform: scale(0.95) translate3d(0, 20px, 0);
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.32, 0.72, 0, 1);
        mask-image: none !important;
        -webkit-mask-image: none !important;
    }

    .drawer-handle {
        display: none !important;
    }

    [class*='drawer-panel-'].show,
    .drawer-sheet.show {
        transform: scale(1) translate3d(0, 0, 0);
        opacity: 1;
    }

    /* Support for wider admin/dashboard panels */
    [class*='drawer-panel-admin'] {
        max-width: 900px !important;
    }
}

/* Redefine/Remove old keyframes as we use transitions now */
@keyframes slideFromBottom {
    from {
        transform: translate3d(0, 100%, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideDownToBottom {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(0, 100%, 0);
    }
}

.drawer-open {
    overflow: hidden !important;
}

/* Premium Tab Switcher (Drawer) */
.drawer-pills-container {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    margin-right: -1.5rem;
    /* Allow scroll to edge */
    padding-right: 1.5rem;
    /* Padding for end of scroll */
}

/* Hide scrollbar */
.drawer-pills-container::-webkit-scrollbar {
    display: none;
}

.nav-pills-custom {
    display: flex;
    gap: 0.5rem;
    width: max-content;
}

.nav-pills-custom .nav-link {
    border-radius: 12px;
    padding: 0.5rem 1rem;
    /* Compact padding */
    font-weight: 600;
    font-size: 0.8rem;
    /* Slightly smaller */
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

.nav-pills-custom .nav-link:hover {
    color: #334155;
    background: #f8fafc;
}

/* Specific Active States */
.nav-pills-custom .nav-link.active {
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.nav-pills-custom .nav-link.active[href*="type=income"] {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.nav-pills-custom .nav-link.active[href*="type=expense"] {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.nav-pills-custom .nav-link.active[href*="type=account"] {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

.nav-pills-custom .nav-link.active[href*="type=gold"] {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.2);
}

.nav-pills-custom .nav-link .nav-label {
    display: none;
    transition: all 0.3s;
}

.nav-pills-custom .nav-link.active .nav-label {
    display: block;
}

.form-control-premium {
    border: none;
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 16px;
    /* Prevent auto-zoom on mobile (min 16px) */
    font-weight: 500;
}

/* Global Mobile Zoom Fix */
@media (max-width: 768px) {

    input,
    select,
    textarea,
    .form-control {
        font-size: 16px !important;
    }
}

.form-control-premium:focus {
    background: #e2e8f0;
    box-shadow: none;
}

.label-premium {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Premium Drawer Header */
.drawer-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: none !important;
    outline: none !important;
    text-decoration: none !important;
    transition: all 0.2s;
}

.drawer-icon-box:hover {
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none !important;
}

.btn-close-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-close-circle:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.drawer-subtitle {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    line-height: 1;
}

/* SweetAlert2 Fix for Drawer */
.swal2-container {
    z-index: 12000 !important;
}