body,
html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    background: #fff;
}

* {
    box-sizing: border-box;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: #2c3e50;
    color: white;
    padding: 0 15px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

a {
    color: #3498db;
    text-decoration: none;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Pane: Data Grid */
.grid-pane {
    flex: 1;
    /* Variable width */
    overflow: auto;
    border-right: 1px solid #ccc;
    background: #f8f9fa;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* Fixed columns for speed */
}

th,
td {
    border-bottom: 1px solid #e0e0e0;
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

th {
    position: sticky;
    top: 0;
    background: #e9ecef;
    font-weight: 600;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    z-index: 10;
    border-bottom: 1px solid #ccc;
}

tr {
    cursor: pointer;
}

tr:hover {
    background: #eaf6ff;
}

tr.selected {
    background: #3498db;
    color: white;
}

td.status-resolved {
    color: #2ecc71;
    font-weight: bold;
}

td.status-pending {
    color: #f1c40f;
    font-weight: bold;
}

tr.selected td.status-resolved,
tr.selected td.status-pending {
    color: white;
}

/* Right Pane: Detail View */
.detail-pane {
    width: 600px;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
}

.detail-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 12px;
    color: #555;
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #eee;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    background: #f1f1f1;
}

.tab {
    padding: 8px 15px;
    cursor: pointer;
    border-right: 1px solid #ddd;
    background: #f1f1f1;
    font-weight: 500;
}

.tab.active {
    background: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
    color: #333;
}

.tab-content {
    display: none;
    padding: 10px 0;
    line-height: 1.5;
    height: 300px;
    overflow-y: auto;
}

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

.actions {
    margin-top: auto;
    padding: 15px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    text-align: right;
}

button {
    padding: 6px 12px;
    border: 1px solid #bbb;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

button.primary {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

button.danger {
    background: #e74c3c;
    color: white;
    border-color: #c0392b;
}

button:hover {
    opacity: 0.9;
}

.hidden {
    display: none;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: #aaa;
    margin-top: 50px;
}
/* Advanced UI Additions */
.toolbar {
    background: #e9ecef;
    padding: 8px 15px;
    border-bottom: 1px solid #ccc;
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 12px;
}
.toolbar select, .toolbar button, .toolbar label { font-size: 12px; }
.count-badge {
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 11px;
}
.flag-icon { color: #e74c3c; font-weight: bold; }
.flag-btn {
    background: transparent; border: 1px solid #e74c3c; color: #e74c3c;
}
.flag-btn.active { background: #e74c3c; color: white; }

.association-box {
    margin-top: 15px;
    padding: 10px;
    background: #fff8e1;
    border: 1px solid #ffe0b2;
    border-radius: 4px;
}
.nav-links a { color: #ddd; margin-left: 15px; font-size: 12px; }
.nav-links a:hover { color: white; }

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #f4f4f4;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 0.5rem;
    color: #333;
}

.login-container p {
    color: #666;
    margin-bottom: 2rem;
}

.login-container .form-group {
    text-align: left;
    margin-bottom: 1rem;
}

.login-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.login-container input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box; /* Fix padding issue */
}

.login-container button {
    width: 100%;
    padding: 0.8rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

.login-container button:hover {
    background: #0056b3;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}
