:root {
    /* Color Palette - Core */
    --primary-color: #2c5f55;
    --primary-dark: #1e403a;
    --accent-color: #d4a373;
    --success-color: #10b981;
    --danger-color: #ef4444;

    /* Light Theme (Default) */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --bg-sidebar: #111827;
    --border-color: #e5e7eb;
    --input-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);

    /* Spacing / Density (Default: Comfortable) */
    --padding-card: 1.5rem;
    --padding-item: 0.7rem 1rem;
    --gap-grid: 1.5rem;
    --font-base: 1rem;
    --font-h1: 1.8rem;
    --font-h2: 1.5rem;
    --font-h3: 1.2rem;
    --sidebar-width: 260px;

    /* Shared */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: 0.2s ease-in-out;
    --border-radius: 12px;
}

/* Dark Theme */
body.theme-dark {
    color-scheme: dark;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --bg-body: #0b0f1a;
    --bg-card: #1f2937;
    --bg-sidebar: #05070a;
    --border-color: #374151;
    --input-bg: #111827;
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Density: Compact */
body.density-compact {
    --padding-card: 1rem;
    --padding-item: 0.5rem 0.8rem;
    --gap-grid: 1rem;
    --font-base: 0.9rem;
    --font-h1: 1.5rem;
    --font-h2: 1.3rem;
    --font-h3: 1.1rem;
    --border-radius: 8px;
}

/* Density: Comfortable (already default, but explicit) */
body.density-comfortable {
    --padding-card: 1.5rem;
    --padding-item: 0.8rem 1rem;
    --gap-grid: 1.5rem;
}

/* Density: Elegant */
body.density-elegant {
    --padding-card: 2.5rem;
    --padding-item: 1.2rem 1.5rem;
    --gap-grid: 2.5rem;
    --font-base: 1.1rem;
    --font-h1: 2.5rem;
    --font-h2: 2rem;
    --font-h3: 1.5rem;
    --border-radius: 30px;
}

body.density-elegant .glass-panel,
body.density-elegant .kpi-card,
body.density-elegant .chart-container {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-body) 100%);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
}

body.density-elegant .sidebar {
    border-right: none;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
}

/* Sidebar Item Active State (Internal Interface) */
.interface-settings .nav-item.active {
    background: var(--primary-color);
    color: white;
}

.interface-settings .nav-item.active i {
    color: white;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-body);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar - Clean Dark Theme like QuickBooks navigation */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    padding: var(--padding-card);
    transition: var(--transition), width 0.3s;
    z-index: 10;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

/* Sidebar Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    padding: 2px;
}

.brand h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: var(--padding-item);
    margin-bottom: 0.4rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    color: #9ca3af;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Submenu Styles */
.submenu {
    list-style: none;
    padding-left: 2.5rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.submenu.open {
    max-height: 500px;
    /* Large enough to fit content */
    opacity: 1;
    margin-bottom: 0.5rem;
}

/* Removed keyframes as we use transition now */

.submenu li {
    padding: 0.5rem 0;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}

.submenu li:hover,
.submenu li.active {
    color: var(--primary-color);
}

.arrow {
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.nav-item.active .arrow {
    transform: rotate(180deg);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #374151;
    padding: 4px;
}

.user-info .name {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.user-info .role {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: var(--padding-card);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-body);
    transition: var(--transition);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: var(--font-h1);
    font-weight: 700;
    color: var(--text-primary);
}

#current-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Cards (formerly glass-panel) */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius);
    padding: var(--padding-card);
    color: var(--text-primary);
    transition: var(--transition);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: var(--gap-grid);
    margin-bottom: 2rem;
}

/* KPI Cards */
.kpi-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: var(--padding-card);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-icon.income {
    background: #d1fae5;
    color: #10b981;
}

.kpi-icon.expense {
    background: #fee2e2;
    color: #ef4444;
}

.kpi-icon.balance {
    background: #e0f2fe;
    color: #0284c7;
}

.kpi-info h3 {
    font-size: calc(var(--font-base) * 0.85);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.kpi-info p {
    font-size: var(--font-h2);
    font-weight: 700;
    color: var(--text-primary);
}

/* Chart Container */
.chart-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: var(--padding-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    min-height: 350px;
}

.chart-container.full-width {
    grid-column: span 3;
}

.chart-container.half-width {
    grid-column: span 1;
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

th {
    background: var(--bg-body);
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: calc(var(--font-base) * 0.75);
    letter-spacing: 0.5px;
    padding: var(--padding-item);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: var(--padding-item);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: var(--font-base);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: var(--bg-body);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    width: 500px;
    max-width: 90%;
    padding: var(--padding-card);
    border-radius: var(--border-radius);
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.modal-content h2,
.modal-content h3,
.modal-content strong,
.modal-content p,
.modal-content div {
    color: var(--text-primary);
}

.modal-content .close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.modal-content .close:hover {
    color: var(--danger-color);
}

.modal-content h2 {
    color: var(--text-primary);
    font-size: var(--font-h2);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
}

.close:hover {
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--font-base);
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 85, 0.1);
}

select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* Force dark option background in dark mode */
body.theme-dark select option {
    background-color: #1f2937;
    color: #f9fafb;
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.btn-submit {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-icon {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-body);
    color: var(--text-primary);
}

.btn-icon.delete:hover {
    color: var(--danger-color);
    background: #fee2e2;
}

.btn-icon.edit:hover {
    color: #d97706;
    background: #fef3c7;
}

/* Attachment Buttons and Badges */
.btn-attach {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-attach:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.badge-counter {
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

/* Module Cards and Grids */
.module-card:hover {
    transform: translateX(5px);
    border-color: var(--accent-color);
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Transaction Styles */
.income-row {
    border-left: 4px solid var(--success-color);
}

.expense-row {
    border-left: 4px solid var(--danger-color);
}

/* Animation for counter */
@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.badge-counter {
    animation: bounce 0.3s ease-out;
}

/* Config Add Forms */
.add-form input,
.add-form select,
.add-form textarea {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.add-form {
    background: var(--bg-body);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Charts Text Color Fix */
/* This will be handled in JS, but defaults are black here */

/* 3D Flip System */
body {
    perspective: 2000px;
}

.app-container {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flipping-active {
    transform: rotateY(180deg);
}

/* Correct mirrored content mid-animation */
.flipping-mid {
    transform: rotateY(90deg) scale(0.9);
    filter: blur(4px);
    opacity: 0.5;
}

/* Sesiones Theme Overrides */
body.mode-sesiones {
    --primary-color: #6366f1;
    /* Indigo */
    --primary-dark: #4338ca;
    --accent-color: #f43f5e;
    /* Rose */
}

body.mode-sesiones .logo-img {
    filter: hue-rotate(240deg);
    /* Transform logo color */
}

/* Print Styling for Landscape Calendar */
@media print {
    @page {
        size: landscape;
        margin: 0.5cm;
    }

    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: white !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Hide Navigation, Sidebar, and Global UI Elements */
    .sidebar,
    .top-bar,
    #newTransBtn,
    .interface-settings,
    .user-profile,
    .app-container>nav {
        display: none !important;
    }

    /* Reset Layout Containers */
    .app-container {
        display: block !important;
        height: auto !important;
        width: 100% !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Clean up Content Area */
    #content-area {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        background: white !important;
        border: none !important;
        width: 100% !important;
    }

    /* Hide ALL Buttons */
    button,
    .btn-primary,
    .btn-icon,
    .actions,
    a.btn {
        display: none !important;
    }

    /* Calendar Specific Print Styles */
    .glass-panel {
        background: white !important;
        box-shadow: none !important;
        border: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Calendar Header */
    .glass-panel>div:first-child {
        display: block !important;
        text-align: center !important;
        margin-bottom: 20px !important;
        justify-content: center !important;
    }

    /* Ensure Month Title is visible and centered */
    .glass-panel>div:first-child h3 {
        color: black !important;
        font-size: 24pt !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
        display: block !important;
    }

    /* Hide the button containers in the header explicitly if generic button hiding fails */
    .glass-panel>div:first-child>div {
        display: none !important;
    }

    /* EXCEPT the wrapper containing H3 */
    .glass-panel>div:first-child>div:first-child {
        display: block !important;
        text-align: center !important;
        width: 100%;
    }

    /* Calendar Grid */
    .calendar-grid {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        width: 100% !important;
        border: 1px solid #000 !important;
        border-radius: 0 !important;
        gap: 0 !important;
        background: white !important;
    }

    .calendar-grid>div {
        border: 1px solid #ccc !important;
        color: black !important;
        background: white !important;
        page-break-inside: avoid;
    }

    /* Day Headers (Lun, Mar...) */
    .calendar-grid>div:nth-child(-n+7) {
        background-color: #f0f0f0 !important;
        font-weight: bold !important;
        border-bottom: 2px solid #000 !important;
    }

    /* Event items in calendar */
    .calendar-grid .calendar-event,
    .calendar-grid>div>div>div {
        border: 1px solid #999 !important;
        color: black !important;
        background: #f9f9f9 !important;
        print-color-adjust: exact !important;
    }
}

/ *   L o c k   S c r e e n   S t y l e s   * /     . l o c k - s c r e e n    {
                 p o s i t i o n :    f i x e d ;
                 t o p :    0 ;
                 l e f t :    0 ;
                 w i d t h :    1 0 0 % ;
                 h e i g h t :    1 0 0 % ;
                 b a c k g r o u n d :    r g b a ( 1 7 ,    2 4 ,    3 9 ,    0 . 9 5 ) ;
                 b a c k d r o p - f i l t e r :    b l u r ( 1 5 p x ) ;
                 z - i n d e x :    9 9 9 9 ;
                 d i s p l a y :    f l e x ;
                 a l i g n - i t e m s :    c e n t e r ;
                 j u s t i f y - c o n t e n t :    c e n t e r ;
                 f l e x - d i r e c t i o n :    c o l u m n ;
         
}

         . l o c k - c o n t e n t    {
                 b a c k g r o u n d :    v a r ( - - b g - c a r d ) ;
                 p a d d i n g :    3 r e m ;
                 b o r d e r - r a d i u s :    2 0 p x ;
                 b o x - s h a d o w :    0   2 5 p x   5 0 p x   - 1 2 p x   r g b a ( 0 ,    0 ,    0 ,    0 . 2 5 ) ;
                 t e x t - a l i g n :    c e n t e r ;
                 b o r d e r :    1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ;
                 w i d t h :    3 2 0 p x ;
         
}

         . l o c k - b r a n d   h 2    {
                 c o l o r :    v a r ( - - t e x t - p r i m a r y ) ;
                 m a r g i n - b o t t o m :    0 . 5 r e m ;
                 f o n t - w e i g h t :    7 0 0 ;
         
}

         . l o c k - b r a n d   p    {
                 c o l o r :    v a r ( - - t e x t - s e c o n d a r y ) ;
                 f o n t - s i z e :    0 . 9 r e m ;
                 m a r g i n - b o t t o m :    2 r e m ;
         
}

         . p i n - d i s p l a y    {
                 d i s p l a y :    f l e x ;
                 j u s t i f y - c o n t e n t :    c e n t e r ;
                 g a p :    1 . 5 r e m ;
                 m a r g i n - b o t t o m :    2 . 5 r e m ;
         
}

         . p i n - d o t    {
                 w i d t h :    1 5 p x ;
                 h e i g h t :    1 5 p x ;
                 b o r d e r - r a d i u s :    5 0 % ;
                 b o r d e r :    2 p x   s o l i d   v a r ( - - a c c e n t - c o l o r ) ;
                 t r a n s i t i o n :    a l l   0 . 2 s ;
         
}

         . p i n - d o t . f i l l e d    {
                 b a c k g r o u n d :    v a r ( - - a c c e n t - c o l o r ) ;
                 b o x - s h a d o w :    0   0   1 0 p x   v a r ( - - a c c e n t - c o l o r ) ;
         
}

         . p i n - k e y p a d    {
                 d i s p l a y :    g r i d ;
                 g r i d - t e m p l a t e - c o l u m n s :    r e p e a t ( 3 ,    1 f r ) ;
                 g a p :    1 . 2 r e m ;
         
}

         . p i n - k e y p a d   b u t t o n    {
                 w i d t h :    6 0 p x ;
                 h e i g h t :    6 0 p x ;
                 b o r d e r - r a d i u s :    5 0 % ;
                 b o r d e r :    1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ;
                 b a c k g r o u n d :    v a r ( - - b g - b o d y ) ;
                 c o l o r :    v a r ( - - t e x t - p r i m a r y ) ;
                 f o n t - s i z e :    1 . 5 r e m ;
                 c u r s o r :    p o i n t e r ;
                 t r a n s i t i o n :    a l l   0 . 2 s ;
                 d i s p l a y :    f l e x ;
                 a l i g n - i t e m s :    c e n t e r ;
                 j u s t i f y - c o n t e n t :    c e n t e r ;
         
}

         . p i n - k e y p a d   b u t t o n : h o v e r    {
                 b a c k g r o u n d :    v a r ( - - p r i m a r y - c o l o r ) ;
                 c o l o r :    w h i t e ;
                 b o r d e r - c o l o r :    v a r ( - - p r i m a r y - c o l o r ) ;
                 t r a n s f o r m :    s c a l e ( 1 . 1 ) ;
         
}

         . p i n - k e y p a d   b u t t o n : a c t i v e    {
                 t r a n s f o r m :    s c a l e ( 0 . 9 5 ) ;
         
}

         . p i n - k e y p a d   . a c t i o n - b t n    {
                 f o n t - s i z e :    1 . 2 r e m ;
                 b a c k g r o u n d :    t r a n s p a r e n t ;
                 b o r d e r - c o l o r :    t r a n s p a r e n t ;
         
}

         . p i n - k e y p a d   . g o - b t n    {
                 c o l o r :    v a r ( - - s u c c e s s - c o l o r ) ;
         
}

     . p i n - b o x    {
                 w i d t h :    6 0 p x ;
                 h e i g h t :    7 0 p x ;
                 f o n t - s i z e :    2 r e m ;
                 t e x t - a l i g n :    c e n t e r ;
                 b o r d e r :    2 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ;
                 b o r d e r - r a d i u s :    1 2 p x ;
                 b a c k g r o u n d :    v a r ( - - b g - b o d y ) ;
                 c o l o r :    v a r ( - - t e x t - p r i m a r y ) ;
                 f o n t - w e i g h t :    7 0 0 ;
                 t r a n s i t i o n :    a l l   0 . 2 s ;
                 o u t l i n e :    n o n e ;
         
}

         . p i n - b o x : f o c u s    {
                 b o r d e r - c o l o r :    v a r ( - - a c c e n t - c o l o r ) ;
                 b o x - s h a d o w :    0   0   0   4 p x   r g b a ( 2 1 2 ,    1 6 3 ,    1 1 5 ,    0 . 2 ) ;
                 t r a n s f o r m :    t r a n s l a t e Y ( - 2 p x ) ;
         
}

         . p i n - b o x . e r r o r    {
                 b o r d e r - c o l o r :    v a r ( - - d a n g e r - c o l o r ) ;
                 b a c k g r o u n d :    # f e f 2 f 2 ;
                 a n i m a t i o n :    s h a k e   0 . 3 s   e a s e - i n - o u t ;
         
}

         @ k e y f r a m e s   s h a k e    {

                     0 % ,
                 1 0 0 %    {
                             t r a n s f o r m :    t r a n s l a t e X ( 0 ) ;
                     
    }

                     2 5 %    {
                             t r a n s f o r m :    t r a n s l a t e X ( - 5 p x ) ;
                     
    }

                     7 5 %    {
                             t r a n s f o r m :    t r a n s l a t e X ( 5 p x ) ;
                     
    }

         
}

     . p i n - b o x    {
                 w i d t h :    4 0 p x ;
                 h e i g h t :    5 0 p x ;
                 f o n t - s i z e :    1 . 5 r e m ;
                 t e x t - a l i g n :    c e n t e r ;
                 b o r d e r :    2 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ;
                 b o r d e r - r a d i u s :    8 p x ;
                 / *   S l i g h t l y   r e d u c e d   r a d i u s   f o r   s m a l l e r   b o x   * /             b a c k g r o u n d :    v a r ( - - b g - b o d y ) ;
                 c o l o r :    v a r ( - - t e x t - p r i m a r y ) ;
                 f o n t - w e i g h t :    7 0 0 ;
                 t r a n s i t i o n :    a l l   0 . 2 s ;
                 o u t l i n e :    n o n e ;
         
}

         . p i n - b o x : f o c u s    {
                 b o r d e r - c o l o r :    v a r ( - - a c c e n t - c o l o r ) ;
                 b o x - s h a d o w :    0   0   0   4 p x   r g b a ( 2 1 2 ,    1 6 3 ,    1 1 5 ,    0 . 2 ) ;
                 t r a n s f o r m :    t r a n s l a t e Y ( - 2 p x ) ;
         
}

         . p i n - b o x . e r r o r    {
                 b o r d e r - c o l o r :    v a r ( - - d a n g e r - c o l o r ) ;
                 b a c k g r o u n d :    # f e f 2 f 2 ;
                 a n i m a t i o n :    s h a k e   0 . 3 s   e a s e - i n - o u t ;
         
}

         @ k e y f r a m e s   s h a k e    {

                     0 % ,
                 1 0 0 %    {
                             t r a n s f o r m :    t r a n s l a t e X ( 0 ) ;
                     
    }

                     2 5 %    {
                             t r a n s f o r m :    t r a n s l a t e X ( - 5 p x ) ;
                     
    }

                     7 5 %    {
                             t r a n s f o r m :    t r a n s l a t e X ( 5 p x ) ;
                     
    }

         
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 250px;
        --padding-card: 1rem;
        --padding-item: 0.6rem 0.8rem;
        --font-h1: 1.5rem;
    }

    /* Layout */
    .app-container {
        position: relative;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100%;
        background: var(--bg-sidebar);
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        width: 100%;
        padding: 1rem;
    }

    /* Top Bar */
    #mobile-menu-btn {
        display: block !important;
        margin-right: 0.5rem;
    }

    .top-bar {
        flex-direction: row;
        /* Keep row for button + title */
        flex-wrap: wrap;
        gap: 1rem;
    }

    .actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Dashboard Grid */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .chart-container.half-width,
    .chart-container.full-width {
        grid-column: span 1;
    }

    /* Modals */
    .modal-content {
        width: 95% !important;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        /* Force scroll for small screens */
    }

    /* Overlay for sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar.open+.sidebar-overlay {
        display: block;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #ffffff;
    color: #1f2937;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 280px;
    border-left: 4px solid var(--accent-color);
    animation: toast-in 0.3s ease-out forwards;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

@keyframes toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

     