/* ===== CSS Custom Properties ===== */
:root {
    --color-primary: #667eea;
    --color-primary-dark: #764ba2;
    --color-contracts: #4facfe;
    --color-feasibilities: #764ba2;
    --color-permits: #d69e2e;
    --color-workorders: #2b6cb0;
    --color-green: #38a169;
    --color-red: #e53e3e;
    --color-yellow: #d69e2e;
    --color-blue: #3182ce;
    --color-purple: #805ad5;
    --color-orange: #dd6b20;

    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: #a0aec0;
    --text-white: #ffffff;

    --bg-body: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card: #ffffff;
    --bg-muted: #f7fafc;
    --bg-field: #ffffff;

    --border-light: #e2e8f0;
    --border-input-focus: #667eea;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-btn: 0 4px 12px rgba(102, 126, 234, 0.4);

    --transition: all 0.3s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background: var(--bg-body);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
}

/* ===== Header ===== */
.header {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== Buttons ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--text-white);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-secondary);
}
.btn-secondary:hover { background: #cbd5e0; }

.btn-icon { font-size: 16px; }
.full-width { width: 100%; }

.btn-view {
    padding: 5px 10px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-view:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.35);
}

.btn-contracts { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.btn-contracts:hover { box-shadow: 0 3px 10px rgba(79, 172, 254, 0.35); }
.btn-feasibilities { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.btn-feasibilities:hover { box-shadow: 0 3px 10px rgba(118, 75, 162, 0.35); }
.btn-permits { background: linear-gradient(135deg, #d69e2e 0%, #ed8936 100%); }
.btn-permits:hover { box-shadow: 0 3px 10px rgba(214, 158, 46, 0.35); }
.btn-workorders { background: linear-gradient(135deg, #2b6cb0 0%, #4299e1 100%); }
.btn-workorders:hover { box-shadow: 0 3px 10px rgba(43, 108, 176, 0.35); }

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== Statistics Section ===== */
.stats-section {
    margin-bottom: 24px;
}

.stats-group {
    margin-bottom: 16px;
}

.stats-group-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid transparent;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card.accent-blue { border-left-color: var(--color-primary); }
.stat-card.accent-green { border-left-color: var(--color-green); }
.stat-card.accent-cyan { border-left-color: var(--color-contracts); }
.stat-card.accent-purple { border-left-color: var(--color-feasibilities); }
.stat-card.accent-yellow { border-left-color: var(--color-permits); }
.stat-card.accent-indigo { border-left-color: var(--color-workorders); }

.stat-icon {
    font-size: 36px;
    line-height: 1;
}

.stat-content { flex: 1; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Charts Section ===== */
.charts-section { margin-bottom: 24px; }

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* ===== Filters Section ===== */
.filters-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.filters-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
    padding: 10px 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 13px;
    transition: var(--transition);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--border-input-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== Results Section ===== */
.results-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.results-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Table ===== */
.table-container {
    overflow-x: auto;
    margin-bottom: 16px;
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
}

.accounts-table thead { background: var(--bg-muted); }

.accounts-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

.accounts-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: #2d3748;
    vertical-align: middle;
}

.accounts-table tbody tr:hover { background: var(--bg-muted); }

.accounts-table .loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Relation badges in table (compact icons) */
.relation-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.rel-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.rel-badge:hover { transform: scale(1.05); }

.rel-badge.contracts { background: #ebf8ff; color: #2b6cb0; }
.rel-badge.feasibilities { background: #f3e8ff; color: #6b46c1; }
.rel-badge.permits { background: #fefcbf; color: #975a16; }
.rel-badge.workorders { background: #bee3f8; color: #2a4365; }
.rel-badge.notes { background: #c6f6d5; color: #22543d; }
.rel-badge.tickets { background: #fed7d7; color: #742a2a; }
.rel-badge.serviceorders { background: #e2e8f0; color: #2d3748; }

.rel-none {
    color: var(--text-light);
    font-size: 12px;
    font-style: italic;
}

/* ===== Status Badge ===== */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.status-activo { background: #c6f6d5; color: #22543d; }
.status-inactivo { background: #fed7d7; color: #742a2a; }
.status-proceso { background: #feebc8; color: #7c2d12; }

/* ===== Services Tags ===== */
.services-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.service-tag {
    display: inline-block;
    padding: 2px 6px;
    background: #e6fffa;
    color: #234e52;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination-numbers {
    display: flex;
    gap: 6px;
}

.page-number {
    padding: 6px 10px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}
.page-number:hover { border-color: var(--color-primary); color: var(--color-primary); }
.page-number.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--text-white);
    border-color: transparent;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.modal.show { opacity: 1; }

.modal-content {
    background: var(--bg-card);
    margin: 2% auto;
    padding: 0;
    border-radius: var(--radius-xl);
    width: 95%;
    max-width: 1100px;
    max-height: 92vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}
.modal.show .modal-content { transform: translateY(0); }

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-muted);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.close {
    font-size: 28px;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}
.close:hover { color: var(--text-primary); }

.modal-body {
    padding: 0;
    overflow-y: auto;
    max-height: calc(92vh - 60px);
}

/* ===== Modal Tabs ===== */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-card);
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 10;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
    -webkit-overflow-scrolling: touch;
}
.modal-tabs::-webkit-scrollbar { height: 3px; }
.modal-tabs::-webkit-scrollbar-track { background: transparent; }
.modal-tabs::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.modal-tab {
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    gap: 6px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.modal-tab:hover { color: var(--text-secondary); background: var(--bg-muted); }
.modal-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.modal-tab .tab-count {
    background: var(--border-light);
    color: var(--text-secondary);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}
.modal-tab.active .tab-count {
    background: var(--color-primary);
    color: var(--text-white);
}

.modal-tab-content {
    display: none;
    padding: 20px 24px;
}
.modal-tab-content.active { display: block; }

/* ===== Modal Account Header ===== */
.modal-account-header {
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--text-white);
}

.modal-account-header h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-account-header .meta {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 2px;
}
.modal-account-header .meta strong { opacity: 1; }
.modal-account-header .meta .meta-sep {
    opacity: 0.5;
    margin: 0 2px;
}

/* ===== Reusable Modal Components ===== */
.m-section {
    margin-top: 16px;
    margin-bottom: 8px;
}

.m-section-title {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.m-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.m-field {
    background: var(--bg-muted);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    min-width: 0;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
}
.m-field:hover {
    background: #e8ecf1;
}
.m-field .copy-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s;
}
.m-field:hover .copy-icon {
    opacity: 0.7;
}
.m-field.copied {
    background: #d1fae5;
}
.m-field.copied .copy-icon {
    opacity: 1;
    color: #059669;
}

.m-field-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.m-field-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

.m-field-value a {
    color: var(--color-blue);
    text-decoration: none;
}
.m-field-value a:hover { text-decoration: underline; }

/* ===== Modal Card (for items in list) ===== */
.m-card {
    background: var(--bg-muted);
    padding: 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    border-left: 4px solid var(--text-light);
}

.m-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.m-card-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.m-card-title i,
.m-section-title i,
.m-badge i,
.rel-badge i,
.m-note strong i,
.modal-tab i,
.btn i {
    font-size: inherit;
    line-height: 1;
}

.m-card-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 2px;
}

.m-card-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== Modal Badge/Tag ===== */
.m-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.m-badge-outline {
    border: 1px solid;
}

.m-badge-neutral { background: #edf2f7; color: var(--text-secondary); }
.m-badge-blue { background: #ebf8ff; color: #2b6cb0; }
.m-badge-purple { background: #faf5ff; color: #553c9a; }
.m-badge-green { background: #c6f6d5; color: #22543d; }
.m-badge-red { background: #fed7d7; color: #742a2a; }
.m-badge-yellow { background: #fefcbf; color: #744210; }
.m-badge-orange { background: #feebc8; color: #7b341e; }
.m-badge-cyan { background: #e6fffa; color: #234e52; }
.m-badge-pink { background: #fed7e2; color: #702459; }

/* ===== Modal Service Tags ===== */
.m-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.m-tag {
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 500;
}

/* ===== Modal Note Block ===== */
.m-note {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border-left: 3px solid;
    font-size: 13px;
    line-height: 1.5;
}

.m-note strong {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
}

.m-note-green { background: #f0fff4; border-left-color: #48bb78; color: #276749; }
.m-note-green strong { color: #22543d; }
.m-note-yellow { background: #fffff0; border-left-color: #ecc94b; color: #744210; }
.m-note-yellow strong { color: #975a16; }
.m-note-blue { background: #ebf8ff; border-left-color: #4299e1; color: #2a4365; }
.m-note-blue strong { color: #2b6cb0; }
.m-note-purple { background: #faf5ff; border-left-color: #805ad5; color: #44337a; }
.m-note-purple strong { color: #553c9a; }
.m-note-red { background: #fff5f5; border-left-color: #fc8181; color: #742a2a; }
.m-note-red strong { color: #c53030; }
.m-note-orange { background: #feebc8; border-left-color: #d69e2e; color: #744210; }
.m-note-orange strong { color: #975a16; }

/* ===== Articulo sub-card ===== */
.m-articulo {
    background: #f0fff4;
    padding: 14px;
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    border-left: 4px solid #48bb78;
}

.m-articulo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.m-articulo-title {
    font-weight: 700;
    color: #2d3748;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.m-articulo-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.m-articulo .m-field-grid {
    gap: 6px;
}

.m-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.m-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.m-table thead {
    background: var(--bg-muted);
}

.m-table th {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 2px solid var(--border-light);
}

.m-table td {
    padding: 10px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.m-table tbody tr:last-child td { border-bottom: none; }
.m-table tbody tr:hover { background: var(--bg-muted); }

.m-totals {
    margin-top: 10px;
    margin-left: auto;
    max-width: 300px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.m-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.m-totals-row:last-child { border-bottom: none; }

.m-totals-grand {
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-muted);
}

/* ===== Scrollable list container ===== */
.m-scroll-list {
    max-height: 500px;
    overflow-y: auto;
}

/* ===== Detail Grid (account raw details) ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.detail-item {
    padding: 12px;
    background: var(--bg-muted);
    border-radius: var(--radius-md);
}

.detail-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.loading-overlay.visible { display: flex; }

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--border-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== Skeleton Loader ===== */
.skeleton-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 0.8fr 0.8fr 0.8fr 1.2fr 1fr 1.5fr;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
}

.skeleton-cell {
    height: 16px;
    background: linear-gradient(90deg, #edf2f7 25%, #e2e8f0 50%, #edf2f7 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    color: var(--text-white);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

.toast-success { background: #38a169; }
.toast-error { background: #e53e3e; }
.toast-info { background: #3182ce; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .charts-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .modal-content { width: 97%; max-width: 95vw; margin: 1.5% auto; }
    .modal-tab-content { padding: 16px 18px; }
    .m-field-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 768px) {
    body { padding: 12px; }
    .header h1 { font-size: 22px; }
    .header { padding: 16px 20px; }
    .charts-grid { grid-template-columns: 1fr; }
    .filters-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-icon { font-size: 28px; }
    .stat-value { font-size: 22px; }
    .results-section, .filters-section { padding: 16px; }
    .table-container { font-size: 12px; }
    .accounts-table th, .accounts-table td { padding: 8px 6px; }
    .modal-content { margin: 0; max-height: 100vh; width: 100%; border-radius: 0; max-width: 100%; }
    .modal-body { max-height: calc(100vh - 56px); }
    .modal-header { padding: 14px 16px; }
    .modal-header h2 { font-size: 15px; }
    .modal-account-header { padding: 12px 16px; }
    .modal-account-header h3 { font-size: 15px; }
    .modal-account-header .meta { font-size: 11px; }
    .modal-tab { padding: 10px 12px; font-size: 12px; }
    .modal-tab-content { padding: 14px 16px; }
    .m-field-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
    .m-field { padding: 8px 10px; }
    .m-field-label { font-size: 9px; }
    .m-field-value { font-size: 12px; }
    .m-card { padding: 12px; }
    .m-card-title { font-size: 14px; }
    .m-section-title { font-size: 13px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .filters-grid { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; align-items: stretch; }
    .modal-tabs { gap: 0; }
    .modal-tab { padding: 8px 10px; font-size: 11px; }
    .modal-tab .tab-count { font-size: 10px; padding: 1px 5px; }
    .m-field-grid { grid-template-columns: 1fr 1fr; }
    .modal-tab-content { padding: 12px; }
    .modal-account-header h3 { font-size: 14px; }
    .modal-account-header .meta { font-size: 10px; }
    .m-card-header { flex-direction: column; }
}
