/* Modern Finance Dashboard UI - Dark Mode Premium */
:root {
    --bg-color: #0A1016;
    /* Darker, richer background */
    --card-bg: #1A222C;
    /* Slightly lighter card bg for contrast */
    --card-bg-glass: rgba(26, 34, 44, 0.75);
    --border: rgba(255, 255, 255, 0.03);
    /* Softer borders */

    --text-main: #FFFFFF;
    --text-muted: #8b9bb4;

    --primary: #00E5FF;
    /* Cyan */
    --primary-hover: #00b8cc;
    --secondary: #00E676;
    /* Green */
    --danger: #FF3D00;
    /* Red */
    --danger-hover: #cc3100;

    --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8);
    --glass-blur: blur(20px);

    --sidebar-width: 80px;
}

/* Global Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Soft glowing background */
    background-image:
        radial-gradient(circle at 15% 15%, rgba(0, 229, 255, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(0, 230, 118, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00b8cc);
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
    border: none;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.5);
    background: linear-gradient(135deg, #00d5ed, #00a4b5);
}

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

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Glass Cards */
.glass-card {
    background: var(--card-bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

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

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.2rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.1);
}

/* Date Picker Styling */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300E5FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1em;
    padding-right: 3rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

select.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2) !important;
    background-color: rgba(255, 255, 255, 0.03);
}

select.form-control option {
    background-color: #1a222c;
    color: var(--text-main);
    padding: 1rem;
    font-size: 1rem;
}

/* Layout: Slim Sidebar */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: transparent;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    height: 100vh;
    z-index: 1001;
    padding: 1.5rem 0;
}

.sidebar-brand {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
}

.sidebar-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    color: var(--text-muted);
    font-size: 1.4rem;
    transition: all 0.2s;
    position: relative;
}

.sidebar-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    background: rgba(2, 214, 222, 0.1);
    color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}

.admin-neon-link {
    color: var(--primary) !important;
    position: relative;
    box-shadow: 0 0 10px rgba(2, 214, 222, 0.5), inset 0 0 10px rgba(2, 214, 222, 0.2) !important;
    border: 1px solid rgba(2, 214, 222, 0.5) !important;
    animation: neonPulse 2s infinite alternate;
}

@keyframes neonPulse {
    0% {
        box-shadow: 0 0 5px rgba(2, 214, 222, 0.4), inset 0 0 5px rgba(2, 214, 222, 0.1);
    }

    100% {
        box-shadow: 0 0 15px rgba(2, 214, 222, 0.8), inset 0 0 15px rgba(2, 214, 222, 0.4);
    }
}

/* Sidebar Tooltip */
.sidebar-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    background: #000;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100000;
}

.sidebar-link:hover::after {
    opacity: 1;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 51px;
    box-sizing: border-box;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    z-index: 1002;
}

.sidebar-footer::before {
    display: none;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

.main-content-inner {
    padding: 2rem 3rem;
    max-width: 1900px;
    margin: 0 auto;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1001;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    font-size: 1.2rem;
}

.header-info h2 {
    font-size: 1.2rem;
    margin: 0;
}

.header-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.header-brand {
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

/* Notification Bell & Dropdown */
.notification-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-btn.has-new ion-icon {
    color: var(--secondary);
    animation: pulse 1.5s infinite;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: #000;
    font-size: 0.65rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #161c24;
}

.notification-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 340px;
    background: #161c24;
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    padding: 1.2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-item {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

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

.notif-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.3rem;
    display: block;
}

/* Filter Bar (for Income/Expense) */
.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-bar select {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    outline: none;
}

/* Tables (Spacious & Modern) */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.data-table th {
    padding: 0.5rem 1rem;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1.2rem 1rem;
    background: var(--card-bg-glass);
    transition: transform 0.2s;
}

.data-table tr td:first-child {
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
    border-left: 1px solid var(--border);
}

.data-table tr td:last-child {
    border-top-right-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    border-right: 1px solid var(--border);
}

.data-table tr td {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
    transform: scale(1.005);
}

/* Utility Classes */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.col-span-1 {
    grid-column: span 1 / span 1;
}

.col-span-2 {
    grid-column: span 2 / span 2;
}

.col-span-3 {
    grid-column: span 3 / span 3;
}

@media (max-width: 992px) {

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .col-span-1,
    .col-span-2,
    .col-span-3 {
        grid-column: span 1 / span 1;
    }
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

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

.text-green {
    color: var(--secondary);
}

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

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

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: rgba(22, 28, 36, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.active {
    transform: translateX(0);
}

.toast-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.toast-success .toast-icon {
    background: rgba(0, 229, 255, 0.2);
    color: var(--primary);
}

.toast-error .toast-icon {
    background: rgba(255, 61, 0, 0.2);
    color: var(--danger);
}

.tr-bubble {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tr-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.2rem;
    padding: 1.2rem;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 120px;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tr-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    transform: translateX(5px);
}

.tr-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    min-width: 0;
}

.tr-details {
    min-width: 0;
}

.tr-details h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    word-break: break-word;
    overflow-wrap: break-word;
}

.tr-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-end;
}

.tr-details p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.tr-category {
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    display: inline-block;
}

.tr-amount {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: right;
}

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

.tr-actions a {
    color: var(--text-muted);
    transition: 0.2s;
    font-size: 1.3rem;
}

.tr-actions a:hover {
    color: var(--danger);
}

@media (max-width: 768px) {
    .tr-row {
        grid-template-columns: auto 1fr auto !important;
        grid-template-rows: auto auto !important;
        gap: 0.4rem 0.8rem !important;
        padding: 0.8rem 1.1rem !important;
        align-items: center !important;
    }

    .tr-info {
        grid-column: 1 / 3 !important;
        grid-row: 1 / 3 !important;
        min-width: 0 !important;
    }

    .tr-details {
        min-width: 0 !important;
    }

    .tr-details h4 {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: 0.92rem !important;
        max-width: 140px !important;
    }

    .tr-category {
        display: none !important;
    }

    .tr-amount {
        grid-column: 3 !important;
        grid-row: 1 !important;
        font-size: 0.95rem !important;
        text-align: right !important;
    }

    .tr-actions {
        grid-column: 3 !important;
        grid-row: 2 !important;
        display: flex !important;
        gap: 0.9rem !important;
        justify-content: flex-end !important;
        align-items: center !important;
        margin-top: 3px !important;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
}

/* Specific Cards */
.card-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
}

.overview-balance {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.overview-balance span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary);
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-item span {
    font-size: 1.4rem;
    font-weight: 600;
}

.t-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

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

.t-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.t-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.t-info h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.t-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.t-amount span {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.t-amount small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Quick Actions Grid */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.btn-quick {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 0.8rem;
    border-radius: 0.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-quick:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-icon.text-red:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* Tabs System */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.75rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    transform: scale(0.95);
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Mobile Navigation Bar (Bottom) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(22, 28, 36, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 5000;
    justify-content: space-around;
    align-items: center;
    padding: 0 1rem;
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.mobile-nav-link ion-icon {
    font-size: 1.4rem;
}

.mobile-nav-link.active {
    color: var(--primary);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 769px) {
    .sidebar {
        display: flex;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding-bottom: 0;
    }

    .mobile-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-bottom: 80px;
        width: 100%;
    }

    .main-content-inner {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

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

    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.5rem 0;
        margin-bottom: 1.5rem;
    }

    .header-brand {
        width: 100%;
        justify-content: space-between;
        font-size: 0.9rem;
    }

    .header-brand span {
        font-size: 1rem;
    }

    .mobile-nav {
        display: flex !important;
    }

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

    .page-header .btn {
        width: 100%;
    }

    .notification-dropdown {
        width: calc(100vw - 2rem) !important;
        right: -10px;
        position: fixed;
        top: 110px;
        left: 1rem;
    }

    .overview-balance {
        font-size: 1.8rem;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar form {
        flex-direction: column;
    }

    .filter-bar .form-control {
        width: 100% !important;
        max-width: none !important;
    }

    /* Responsive Table to Card */
    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border);
        border-radius: 1.2rem;
        margin-bottom: 1rem;
        padding: 1.2rem;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left !important;
        padding: 0.6rem 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    }

    .data-table td:last-child {
        border-bottom: none !important;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        font-size: 0.85rem;
    }

    /* Hide empty labels or specific cells before */
    .data-table td:first-child::before {
        content: none;
    }

    .data-table td:first-child {
        border-bottom: 1px solid var(--border) !important;
        padding-bottom: 1rem !important;
        margin-bottom: 0.5rem;
    }

    /* Total row specific mobile fix */
    .data-table tr:last-child {
        background: rgba(0, 229, 255, 0.05);
        border-color: var(--primary);
        margin-top: 1.5rem;
    }

    .data-table tr:last-child td {
        border: none !important;
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }

    .data-table tr:last-child td::before {
        content: none;
    }
}

@media (max-width: 480px) {
    .header-info h2 {
        font-size: 1.1rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 1.5rem;
        border-radius: 1rem;
    }
}

/* Auth Pages (Login/Register) Styles */
.auth-container {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    z-index: 10;
    padding: 3rem 2rem;
}

.auth-logo {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blob {
    position: absolute;
    filter: blur(80px);
    z-index: 0;
    border-radius: 50%;
    opacity: 0.15;
    animation: float 10s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -10%;
    right: -10%;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.05);
    }

    100% {
        transform: translateY(0px) scale(1);
    }
}

/* Landing Page Specific Styles */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 3rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.hero {
    display: grid;
    align-items: center;
    gap: 4rem;
    position: relative;
}

.hero-content {
    z-index: 10;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-dashboard-mockup {
    width: 100%;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.hero-dashboard-mockup:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        margin: 0 auto 2rem auto;
    }

    .hero-buttons {
        justify-content: center;
    }
}

/* Rotating Border Animation */
@keyframes rotateBorder {
    100% {
        transform: rotate(360deg);
    }
}

.rotating-border-modal {
    position: relative;
    padding: 2px !important;
    overflow: hidden;
    background: transparent !important;
}

.rotating-border-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8);
    z-index: 0;
    border-radius: 1.5rem;
    pointer-events: none;
}

/* Remove separate color classes to keep it uniform neon */
.rotating-border-modal.expense-border::before {
    background: conic-gradient(from 0deg,
            #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
}

.modal-content-inner {
    background: #0a0f19;
    width: 100%;
    height: 100%;
    border-radius: 1.4rem;
    padding: 2.5rem;
    position: relative;
    z-index: 1;
}

.global-neon-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    pointer-events: none;
    padding: 2px;
    /* Border thickness */
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    overflow: hidden;
}

.global-neon-overlay::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(#ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    animation: rotateBorder 10s linear infinite;
    z-index: -1;
}

.neon-input-frame {
    position: relative;
    padding: 2px;
    border-radius: 1rem;
    overflow: hidden;
    background: transparent;
}

.neon-input-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8);
    z-index: 0;
    border-radius: 1rem;
    pointer-events: none;
    transition: opacity 0.3s;
}

.neon-input-frame:hover::before {
    background: conic-gradient(from 0deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000) !important;
    animation: rotateBorder 3s linear infinite;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
}

.neon-input-frame {
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2), 0 0 20px rgba(122, 0, 255, 0.1);
}

.neon-input-frame .form-control {
    position: relative;
    z-index: 1;
    background: #0a0f19 !important;
    border: none !important;
    border-radius: 0.9rem !important;
}

/* Specialized Neon Frames */
.neon-frame-income::before {
    background: linear-gradient(45deg, var(--primary), #00b8cc) !important;
}

.neon-frame-expense::before {
    background: linear-gradient(45deg, var(--danger), #ff1744) !important;
}

.neon-frame-income {
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2) !important;
}

.neon-frame-expense {
    box-shadow: 0 0 15px rgba(255, 61, 0, 0.2) !important;
}

/* Icon Hover Effects */
.tr-actions ion-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
}

.tr-actions ion-icon:hover {
    opacity: 1 !important;
    transform: scale(1.2) translateY(-2px);
    filter: drop-shadow(0 0 8px currentColor);
}

/* Clean Neon Filter Logic */
.neon-filter-frame {
    position: relative;
    padding: 1px;
    border-radius: 0.8rem;
    overflow: hidden;
    background: transparent;
    display: inline-flex;
    transition: all 0.3s ease;
}

.neon-filter-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.05);
    z-index: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Base colors for static state */
.neon-filter-income::before {
    background: rgba(0, 229, 255, 0.15) !important;
}

.neon-filter-expense::before {
    background: rgba(255, 61, 0, 0.15) !important;
}

/* The "Neon Effect" (Rainbow & Rotation) - Triggered by Hover OR Active */
.neon-filter-frame:hover::before,
.neon-filter-frame.active::before {
    background: conic-gradient(from 0deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000) !important;
    animation: rotateBorder 3s linear infinite;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    opacity: 1;
}

.neon-filter-frame select,
.neon-filter-frame label {
    position: relative;
    z-index: 1;
    background: #0a0f19 !important;
    /* Always opaque */
    height: 48px !important;
    display: flex;
    align-items: center;
    color: white !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Brighten ONLY when specifically hovered or ACTIVE */
.neon-filter-frame:hover::before,
.neon-filter-frame.active::before {
    background: conic-gradient(from 0deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000) !important;
    animation: rotateBorder 3s linear infinite;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    opacity: 1 !important;
}

/* Active State Backgrounds - Use solid background but slightly lighter */
.neon-filter-frame.active label {
    background: #151d2a !important;
    /* Slightly lighter but solid */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.neon-filter-frame.active.neon-filter-income label {
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.2);
}

.neon-filter-frame.active.neon-filter-expense label {
    box-shadow: inset 0 0 10px rgba(255, 61, 0, 0.2);
}

/* Targeted Neon Logic - All Time Filter Only */
.neon-filter-frame.active::before {
    opacity: 0 !important;
}

.neon-filter-all-time.active::before {
    opacity: 1 !important;
    background: conic-gradient(from 0deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000) !important;
    animation: rotateBorder 3s linear infinite !important;
    width: 250% !important;
    height: 250% !important;
    top: -75% !important;
    left: -75% !important;
}

/* Custom scrollbar for premium/gentle appearance */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    transition: background 0.2s;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.3);
}

/* ==========================================================================
   MOBILE & RESPONSIVE LAYOUT EXTENSIONS (By Antigravity)
   ========================================================================== */

/* Global viewport constraint to prevent ANY horizontal body overflow */
html,
body {
    overflow-x: hidden !important;
    position: relative;
    max-width: 100vw;
    width: 100%;
}

.app-layout {
    overflow-x: hidden !important;
    max-width: 100vw;
    width: 100%;
}

/* Responsive scrollable table wrapper to prevent wide tables from pushing page width */
.table-responsive {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    border-radius: 0.8rem;
}

.table-responsive::-webkit-scrollbar {
    height: 4px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.15);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.35);
}

/* Table header class to cleanly hide headers on small screens where rows transform to cards */
@media (max-width: 768px) {
    .tr-header-row {
        display: none !important;
    }

    /* Strict stacking of dashboard columns below 768px width */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
    }

    /* Force top-header to stack beautifully without items flowing out of view */
    .top-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1.2rem !important;
        padding-bottom: 0.5rem;
    }

    .header-profile {
        width: 100%;
        justify-content: space-between;
    }
}

/* Mobile More Menu (Drawer Sheet) Styles */
.mobile-more-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-more-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-more-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #0f1622, #070a10);
    border-top: 1.5px solid rgba(0, 229, 255, 0.25);
    border-radius: 1.8rem 1.8rem 0 0;
    padding: 1.5rem 1.5rem 2.5rem 1.5rem;
    box-shadow: 0 -10px 40px rgba(0, 229, 255, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-more-overlay.active .mobile-more-content {
    transform: translateY(0);
}

.mobile-more-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-more-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.mobile-more-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
}

.mobile-more-indicator {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: -0.5rem auto 1rem auto;
}

.mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.mobile-drawer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.mobile-drawer-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 229, 255, 0.2);
}

.drawer-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.drawer-icon-wrapper.danger {
    color: var(--danger);
    background: rgba(255, 61, 0, 0.1);
}

.drawer-icon-wrapper.info {
    color: var(--primary);
    background: rgba(0, 229, 255, 0.1);
}

.drawer-icon-wrapper.success {
    color: var(--secondary);
    background: rgba(0, 230, 118, 0.1);
}

.drawer-icon-wrapper.warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.drawer-icon-wrapper.danger-bg {
    color: #fff;
    background: var(--danger);
}

.mobile-drawer-item span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

.mobile-drawer-item:hover span {
    color: #fff;
}

/* Premium Checkboxes Styles */
.premium-checkbox-container {
    display: inline-block;
    position: relative;
    cursor: pointer;
    user-select: none;
    width: 18px;
    height: 18px;
}

.premium-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.premium-checkbox-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.premium-checkbox-container:hover input ~ .premium-checkbox-checkmark {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.5);
}

.premium-checkbox-container input:checked ~ .premium-checkbox-checkmark {
    background-color: rgba(0, 229, 255, 0.1);
    border-color: #00e5ff;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.premium-checkbox-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.premium-checkbox-container input:checked ~ .premium-checkbox-checkmark:after {
    display: block;
}

.premium-checkbox-container .premium-checkbox-checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #00e5ff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Selected row highlighted in log table */
.log-row-checked {
    background: rgba(245, 158, 11, 0.07) !important;
}

.log-row-checked td {
    border-bottom: 1px solid rgba(245, 158, 11, 0.15) !important;
}

.log-row:hover {
    background: rgba(255, 255, 255, 0.015) !important;
}

.user-select-pill:hover {
    background: rgba(255,255,255,0.06) !important;
    border-color: rgba(0, 229, 255, 0.3) !important;
}

.user-select-pill.selected {
    background: rgba(0, 229, 255, 0.08) !important;
    border-color: #00e5ff !important;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

/* Chat Viewport and Responsive Layout */
@media (max-width: 992px) {
    .chat-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }
    .chat-wrapper > .glass-card {
        border-radius: 0.8rem !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    .chat-wrapper > .glass-card > div[style*="padding: 2rem"] {
        padding: 0.4rem !important;
    }
    .chat-wrapper > .glass-card > div[style*="padding: 1.8rem 2rem"] {
        padding: 0.8rem 1rem !important;
    }
    .chat-wrapper h2 {
        font-size: 1.25rem !important;
    }
    .chat-wrapper p {
        display: none !important;
    }

    .chat-container {
        position: relative;
        height: calc(100vh - 265px) !important;
        min-height: 380px !important;
        border-radius: 0.8rem !important;
    }
    
    /* Hide Administrators sidebar completely on small screen */
    .chat-container > .glass-card:nth-child(3) {
        display: none !important;
    }
    
    /* Left Pane (Contacts) */
    .chat-container > .glass-card:nth-child(1) {
        width: 100% !important;
        flex: 1 !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Right Pane (Messages thread) */
    .chat-container > .glass-card:nth-child(2) {
        position: absolute !important;
        inset: 0.5rem !important;
        z-index: 10;
        transform: translateX(105%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        background: #0f1622 !important;
        border-radius: 0.8rem !important;
    }
    
    /* When active-chat is active, slide-in right pane, slide-out left pane */
    .chat-container.active-chat > .glass-card:nth-child(1) {
        transform: translateX(-105%);
    }
    
    .chat-container.active-chat > .glass-card:nth-child(2) {
        transform: translateX(0);
    }
    
    /* Show mobile-only back buttons */
    .mobile-chat-back-btn {
        display: inline-flex !important;
    }

    body {
        padding-bottom: 90px !important;
    }

    /* Send form button text ellipsis and sizing on mobile */
    .chat-send-text {
        display: none !important;
    }
    #chatSendForm {
        padding: 0.5rem 0.6rem !important;
        gap: 0.4rem !important;
    }
    #chatSendForm button[type="submit"] {
        padding: 0.55rem !important;
        width: 36px !important;
        height: 36px !important;
        justify-content: center !important;
    }
    #chatSendForm button[type="submit"] ion-icon {
        font-size: 1.15rem !important;
        margin: 0 !important;
    }
}

/* Responsive Admin Tab and Form Grids */
.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.messages-tab-grid {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 2.5rem;
}
.inflation-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.inflation-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2.5rem;
}
.settings-main-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 1fr;
    gap: 2rem;
}
.settings-sub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}
.log-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
    gap: 1rem;
    align-items: end;
    margin: 0;
}
.log-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.user-select-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.responsive-header-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 992px) {
    .inflation-metrics-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 768px) {
    .categories-grid,
    .messages-tab-grid,
    .inflation-grid,
    .settings-main-grid,
    .settings-sub-grid,
    .log-details-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .inflation-metrics-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
    }
    
    .log-filter-grid {
        grid-template-columns: 1fr !important;
    }
    
    .user-select-grid {
        grid-template-columns: 1fr !important;
    }

    .global-neon-overlay {
        display: none !important;
    }

    .neon-filter-frame select {
        padding-left: 0.8rem !important;
        padding-right: 2.2rem !important;
        background-position: right 0.8rem center !important;
        font-size: 0.85rem !important;
    }

    .neon-filter-frame label {
        padding: 0 1rem !important;
        font-size: 0.8rem !important;
        height: 48px !important;
    }

    .inflation-power-card-left {
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.06) !important;
        padding-right: 0 !important;
        padding-bottom: 1.5rem !important;
    }

    /* Mobile Header adjustments */
    .responsive-header-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.2rem !important;
        padding: 1.5rem !important;
    }
    .responsive-header-title-group {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.8rem !important;
        width: 100% !important;
    }
    .responsive-header-title-group > div:nth-child(2) {
        display: none !important; /* Hide vertical line separator */
    }
    .responsive-header-actions {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8rem !important;
    }
    .responsive-header-actions button,
    .responsive-header-actions .btn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Filter Group Mobile Wraps */
    .responsive-filter-group {
        width: 100% !important;
        flex: none !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    .responsive-filter-group .neon-filter-frame {
        flex: 1 1 calc(50% - 0.25rem) !important;
        min-width: 100px !important;
    }
    .responsive-filter-group .neon-filter-all-time {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 100% !important;
    }
    .responsive-filter-group .neon-filter-all-time label {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Dashboard Overview Gauge stack */
    .flex-responsive-dashboard-card {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .flex-responsive-dashboard-card > div {
        width: 100% !important;
    }

    /* Draggable FAB placement on mobile */
    .fab-container {
        bottom: 6rem !important;
        right: 1.5rem !important;
    }

    /* Inflation result wrapping */
    .responsive-result-display {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center !important;
        gap: 1rem !important;
    }
    .responsive-result-display > div {
        text-align: center !important;
    }
    .responsive-formula {
        font-size: 0.75rem !important;
        display: block !important;
        margin-top: 0.4rem !important;
        word-break: break-all !important;
        white-space: normal !important;
    }

    /* Settings View Mobile adjustments */
    .responsive-two-cols {
        grid-template-columns: 1fr !important;
    }
    .avatar-grid-container {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* Dashboard Grid alignment fix */
    .dashboard-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    .grid-col {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 0 1.2rem 0 !important;
        box-sizing: border-box !important;
    }
    .dashboard-grid .glass-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Site Footer Mobile Layout static placement */
    #siteFooter {
        position: relative !important;
        width: 100% !important;
        right: auto !important;
        bottom: auto !important;
        margin: 2rem 0 1rem 0 !important;
        padding: 1.5rem 1rem !important;
        text-align: center !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        display: block !important;
        height: auto !important;
    }
    #siteFooter > span, #siteFooter > a {
        display: block !important;
        margin: 0.5rem auto !important;
        text-align: center !important;
        width: 100% !important;
    }
    #siteFooter > div {
        display: none !important; /* Hide vertical line separators on mobile */
    }

    /* Currency/Amount Wrap Prevention */
    .tr-amount {
        white-space: nowrap !important;
        font-size: 1rem !important;
    }

    /* Chat input & send button layout */
    .chat-send-text {
        display: none !important;
    }
    #chatSendForm {
        align-items: center !important;
        width: 100% !important;
    }
    #chatSendForm button[type="submit"] {
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        justify-content: center !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
    }

    /* Net balance typography on mobile */
    .responsive-balance-summary {
        font-size: 2rem !important;
        white-space: nowrap !important;
        text-align: center !important;
        margin: 0.5rem 0 !important;
    }

    /* Admin messages columns stack & layout spacing */
    .messages-tab-grid > div {
        width: 100% !important;
        max-width: 100% !important;
    }
    .messages-tab-grid .glass-card {
        position: static !important; /* Remove sticky on mobile */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Export buttons responsive styling */
    .btn-text-export {
        display: none !important;
    }
    .export-btn-compact {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.9rem !important;
    }

    /* Admin sub-tab headers & filters */
    .responsive-subtab-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8rem !important;
    }
    .responsive-subtab-header h3 {
        text-align: center !important;
        justify-content: center !important;
    }
    .responsive-subtab-header > div {
        justify-content: center !important;
    }
    .responsive-subtab-filter {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.6rem !important;
    }
    .responsive-subtab-filter label {
        text-align: center !important;
    }
    .responsive-subtab-filter select {
        max-width: 100% !important;
        width: 100% !important;
    }
}