* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

/* Header with double line borders */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-top: 3px solid #414143;
    border-bottom: 3px solid #414143;
    padding: 20px 40px;
    margin: 0;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ffd600;
}

header::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ffd600;
}

.header-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.header-logo-right {
    display: block;
}

.header-text {
    flex: 1;
    text-align: center;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    color: #414143;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2em;
    color: #414143;
    font-weight: 500;
}

/* Thick grey divider line */
.header-divider {
    width: 100%;
    height: 5px;
    background: #414143;
    margin: 0;
}

/* Dashboard Styles */
.dashboard {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.dashboard-title {
    text-align: center;
    color: #414143;
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: white;
    border: 2px solid #ffd600;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 3px 10px rgba(65, 65, 67, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(65, 65, 67, 0.2);
}

.dashboard-card h3 {
    color: #414143;
    font-size: 1em;
    margin-bottom: 12px;
    font-weight: 600;
}

.dashboard-card .value {
    color: #ffd600;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.dashboard-card .count {
    color: #666;
    font-size: 0.95em;
}

.dashboard-card.highlight {
    background: linear-gradient(135deg, #ffd600 0%, #ffdb1a 100%);
}

.dashboard-card.highlight h3,
.dashboard-card.highlight .value,
.dashboard-card.highlight .count {
    color: #414143;
}

/* Data Source Text */
.data-source {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Navigation buttons */
.main-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-btn {
    background: #ffd600;
    border: none;
    border-radius: 12px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(65, 65, 67, 0.15);
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(65, 65, 67, 0.25);
    background: #ffdb1a;
}

.btn-icon {
    font-size: 3em;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.btn-text h3 {
    color: #414143;
    margin-bottom: 8px;
    font-size: 1.3em;
    font-weight: 700;
}

.btn-text p {
    color: #414143;
    font-size: 0.9em;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .nav-btn {
        padding: 20px;
    }
    
    .btn-icon {
        font-size: 2em;
    }
    
    .btn-text h3 {
        font-size: 1.1em;
    }
}

/* Content Sections */
.content-section {
    display: none;
    background: white;
    padding: 30px 20px;
    max-width: 1400px;
    margin: 20px auto;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #ffd600;
}

.section-header h2 {
    color: #414143;
    font-size: 2em;
    font-weight: 700;
}

.back-btn {
    background: #ffd600;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #ffdb1a;
    transform: scale(1.05);
}

/* Search Box */
.search-box {
    margin-bottom: 25px;
}

.search-box input {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #ffd600;
    box-shadow: 0 0 0 3px rgba(255, 214, 0, 0.1);
}

/* Filter Container */
.filter-container {
    margin-bottom: 25px;
}

.filter-dropdowns {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.filter-dropdowns select {
    padding: 12px 20px;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    color: #414143;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-dropdowns select:focus {
    outline: none;
    border-color: #ffd600;
    box-shadow: 0 0 0 3px rgba(255, 214, 0, 0.1);
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(65, 65, 67, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: #414143;
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1em;
    color: #ffffff;
    border-bottom: 2px solid #ffd600;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    color: #414143;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: #fffef5;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr.hidden {
    display: none;
}

.type-given {
    color: #e74c3c;
    font-weight: 600;
}

.type-received {
    color: #27ae60;
    font-weight: 600;
}

.type-collaboration {
    color: #3498db;
    font-weight: 600;
}

.type-deal {
    color: #9b59b6;
    font-weight: 600;
}

.type-reference {
    color: #f39c12;
    font-weight: 600;
}

/* Responsive table */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .section-header h2 {
        font-size: 1.5em;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 0.9em;
    }
    
    .search-box input {
        max-width: 100%;
    }
}

/* Member-Wise Section Styles */
.member-search-container {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.autocomplete-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.autocomplete-wrapper input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.autocomplete-wrapper input:focus {
    outline: none;
    border-color: #ffd600;
    box-shadow: 0 0 0 3px rgba(255, 214, 0, 0.1);
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #ffd600;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(65, 65, 67, 0.15);
}

.suggestions-list.active {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #414143;
}

.suggestion-item:hover {
    background: #fffef5;
}

.suggestion-item.selected {
    background: #ffd600;
    font-weight: 600;
}

.fetch-btn {
    background: #ffd600;
    color: #414143;
    border: none;
    padding: 15px 35px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fetch-btn:hover {
    background: #ffdb1a;
    transform: scale(1.05);
}

.member-data-display {
    margin-top: 20px;
}

.member-info-header {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.member-info-header h3 {
    color: #414143;
    font-size: 1.8em;
    margin-bottom: 5px;
}

.member-info-header p {
    color: #666;
    font-size: 1em;
}

.business-section {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
}

.business-section-header {
    background: #ffd600;
    color: #414143;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.business-section-header h4 {
    font-size: 1.4em;
    font-weight: 700;
}

.transaction-list {
    list-style: none;
    padding: 0;
}

.transaction-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

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

.transaction-item:hover {
    background: #fffef5;
}

.transaction-details {
    flex: 1;
}

.transaction-member {
    font-weight: 600;
    color: #414143;
    font-size: 1.05em;
}

.transaction-chapter {
    color: #666;
    font-size: 0.9em;
    margin-left: 10px;
}

.transaction-value {
    font-weight: 700;
    color: #414143;
    font-size: 1.1em;
}

.total-section {
    background: #414143;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-section .label {
    font-weight: 600;
    font-size: 1.2em;
}

.total-section .value {
    font-weight: 700;
    font-size: 1.3em;
}

.no-transactions {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

/* Responsive styles for member-wise */
@media (max-width: 768px) {
    .member-search-container {
        flex-direction: column;
    }
    
    .autocomplete-wrapper {
        max-width: 100%;
    }
    
    .fetch-btn {
        width: 100%;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .total-section {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Consolidated Transactions Styles */
.consolidated-data-display {
    margin-top: 20px;
}

.consolidated-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(65, 65, 67, 0.1);
    margin-bottom: 30px;
}

.consolidated-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.consolidated-table thead {
    background: #414143;
}

.consolidated-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1em;
    color: #ffffff;
    border-bottom: 2px solid #ffd600;
}

.consolidated-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    color: #414143;
}

.consolidated-table tbody tr:hover {
    background: #fffef5;
}

.consolidated-table tbody tr:last-child td {
    border-bottom: none;
}

.chapter-section {
    margin-bottom: 30px;
}

.chapter-section-header {
    background: #ffd600;
    color: #414143;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.chapter-section-header h4 {
    font-size: 1.4em;
    font-weight: 700;
}

.chapter-totals {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.chapter-total-item {
    padding: 8px 0;
    color: #414143;
    font-size: 1.05em;
}

.chapter-total-item strong {
    color: #414143;
    font-weight: 700;
}

.pie-chart-container {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.pie-chart-title {
    text-align: center;
    color: #414143;
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.chart-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ffd600;
    box-shadow: 0 2px 8px rgba(65, 65, 67, 0.1);
}

.chart-item h5 {
    text-align: center;
    color: #414143;
    font-size: 1.2em;
    margin-bottom: 15px;
}

canvas {
    max-width: 100%;
    height: auto !important;
}

/* Connections Section Styles */
.connections-search-container {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    margin-bottom: 30px;
    align-items: end;
}

.connections-search-container label {
    display: block;
    margin-bottom: 8px;
    color: #414143;
    font-weight: 600;
    font-size: 1em;
}

.connection-data-display {
    margin-top: 20px;
}

.connection-header {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.connection-header h3 {
    color: #414143;
    font-size: 1.6em;
    margin-bottom: 10px;
}

.connection-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.connection-summary-item {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.connection-summary-item .label {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.connection-summary-item .value {
    color: #414143;
    font-size: 1.3em;
    font-weight: 700;
}

@media (max-width: 768px) {
    .connections-search-container {
        grid-template-columns: 1fr;
    }
    
    .fetch-btn {
        width: 100%;
    }
}

/* Footer Styles */
footer {
    background: #ffd600;
    color: #414143;
    text-align: center;
    padding: 20px;
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 40px;
}

footer p {
    margin: 0;
}

/* Responsive header */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }
    
    .header-logo {
        height: 60px;
    }
    
    .header-logo-right {
        display: none;
    }
    
    header h1 {
        font-size: 2em;
    }
}
