/* Pool Statements Premium Styles */

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary: #3b82f6;
    --accent: #facc15;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --success: #22c55e;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: #fff;
    margin: 0;
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app-shell {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar-nav {
    width: 60px;
    background: #020617;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    border-right: 1px solid var(--border);
    gap: 20px;
}

.nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.nav-icon.active {
    background: var(--primary);
    color: #fff;
}

/* Main Body */
.module-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header-strip {
    height: 40px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.title-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-area h2 {
    font-size: 0.9rem;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-icon {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-right: 5px;
}

.header-search input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 4px 0;
    font-size: 0.8rem;
    width: 150px;
    outline: none;
}

.sync-btn {
    background: #fff;
    color: var(--primary);
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.super-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    width: 180px;
    text-align: left;
}

.super-toggle-btn.active {
    background: var(--accent);
    color: #000;
}

.user-status {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Content Area */
#main-content-area {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.status-top-bar {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-chips-wrapper {
    display: flex;
    gap: 10px;
}

.status-chip {
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
}

.status-chip.active {
    background: var(--primary);
    color: white;
}

/* Table */
.table-container {
    flex: 1;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #1e293b;
    padding: 6px 4px;
    text-align: left;
    position: sticky;
    top: 0;
    color: var(--text-muted);
    font-size: 0.65rem;
    z-index: 10;
    border-bottom: 2px solid var(--primary);
    white-space: normal;
    word-break: break-word;
    line-height: 1.1;
    min-width: 60px;
    max-width: 120px;
    vertical-align: top;
}

td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    white-space: nowrap;
}

tr:hover:not(.month-group-row) {
    background: rgba(255, 255, 255, 0.05);
}

.month-group-row {
    background: rgba(59, 130, 246, 0.15) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.copyable-cell {
    cursor: copy;
    color: var(--accent);
    text-decoration: underline dotted rgba(250, 204, 21, 0.3);
}

.copyable-cell:hover {
    background: rgba(250, 204, 21, 0.1);
    color: #fff;
}

.chat-icon {
    margin-left: 8px;
    cursor: pointer;
    filter: grayscale(1) opacity(0.7);
    transition: 0.2s;
    font-size: 0.9rem;
    vertical-align: middle;
}

.chat-icon:hover {
    filter: grayscale(0) opacity(1);
    transform: scale(1.2);
}

/* Pagination */
.pagination-footer {
    padding: 15px;
    display: flex;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid var(--border);
}

#load-more-btn {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 25px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

#load-more-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: auto;
    top: auto;
    transform: none;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    pointer-events: none;
    max-width: min(440px, 90vw);
}

@media (max-width: 768px) {
    #toast-container {
        top: 16px !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        align-items: center !important;
        width: calc(100% - 32px) !important;
    }
}

.toast {
    pointer-events: auto;
    background: #1e293b;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.hidden {
    display: none !important;
}

/* Loading Overlay & Spinner */
#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 15px;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    position: relative;
    animation: spin 1s linear infinite;
}

.loader::before,
.loader::after {
    content: "";
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
}

.loader::before {
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-top-color: var(--accent);
    animation: spin 2s linear infinite;
}

.loader::after {
    top: 13px;
    left: 13px;
    right: 13px;
    bottom: 13px;
    border-top-color: #fff;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loading-overlay p {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 768px) {
    .app-shell {
        flex-direction: column;
    }
    .sidebar-nav {
        width: 100%;
        height: 45px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 0;
        justify-content: space-around;
        background: #020617;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 1000;
        order: 3;
    }
    .sidebar-nav .nav-icon {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    .module-body {
        height: calc(100vh - 45px);
        overflow: hidden;
    }
    #main-content-area {
        padding-bottom: 50px;
    }
}
