body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar: 10% */
.sidebar {
    width: 10%;
    background-color: #2c3e50;
    color: white;
    border-right: 1px solid #34495e;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #34495e;
    text-align: center;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.project-item {
    padding: 12px 16px;
    border-bottom: 1px solid #34495e;
    cursor: pointer;
    transition: background-color 0.3s;
}

.project-item:hover {
    background-color: #34495e;
}

.project-item.active {
    background-color: #3498db;
    border-left: 4px solid #2980b9;
    padding-left: 12px;
}

.project-item a {
    color: white;
    text-decoration: none;
    display: block;
}

/* User section at bottom of sidebar */
.sidebar-user {
    position: relative;
    /* width: 100%; removed to prevent overflow */
    border-top: 1px solid #34495e;
    padding: 12px;
    background-color: #34495e;
    flex-shrink: 0;
}

.user-button {
    width: auto;
    min-width: 80px;
    max-width: 90%;
    padding: 6px 16px;
    background-color: #2c3e50;
    color: white;
    border: 1px solid #5d6d7b;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.user-button:hover {
    background-color: #3a5269;
}



/* User popup menu */
.user-menu {
    position: fixed;
    bottom: 70px;
    left: 12px;
    background-color: white;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
}

.user-menu-content {
    padding: 12px;
}

.user-info {
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
    margin-bottom: 12px;
}

.user-info-item {
    font-size: 13px;
    color: #2c3e50;
    margin: 4px 0;
}

.user-info-label {
    font-weight: bold;
    color: #34495e;
}

.logout-btn {
    width: 100%;
    padding: 8px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #c0392b;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

.modal-header {
    background-color: #2c3e50;
    color: white;
    padding: 16px;
    border-bottom: 1px solid #34495e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: #34495e;
    border-radius: 4px;
}

.login-form {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.error-message {
    background-color: #fadbd8;
    color: #c0392b;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
    border-left: 4px solid #c0392b;
}

.login-btn {
    width: 100%;
    padding: 7px 0;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #2980b9;
}

.login-btn:active {
    background-color: #2573a6;
}
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ecf0f1;
}

.content-header {
    background-color: white;
    padding: 20px;
    border-bottom: 1px solid #bdc3c7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.content-header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 28px;
}

.content-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: white;
    margin: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* iframe for subprojects */
.project-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar,
.content-body::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.content-body::-webkit-scrollbar-track {
    background: #34495e;
}

.sidebar::-webkit-scrollbar-thumb,
.content-body::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.content-body::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Responsive: collapse sidebar on small screens (optional) */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

/* ========== User Management Styles ========== */
.um-section {
    margin-bottom: 28px;
}
.um-section-title {
    font-size: 17px;
    color: #2c3e50;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #3498db;
    display: inline-block;
}

/* Chip list for admins */
.um-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.um-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eaf2fb;
    color: #2c3e50;
    border: 1px solid #b8d4f0;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 13px;
    white-space: nowrap;
}
.um-chip-self {
    background: #d5f5e3;
    border-color: #82d8a2;
}
.um-chip-you {
    font-size: 11px;
    color: #7f8c8d;
    margin-left: 2px;
}
.um-chip-remove {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.15s;
}
.um-chip-remove:hover {
    background: #fadbd8;
}

/* Add row */
.um-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* Selects & buttons */
.um-select {
    padding: 5px 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    color: #2c3e50;
}
.um-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,.15);
}
.um-btn {
    padding: 5px 14px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.um-btn:disabled {
    opacity: .5;
    cursor: default;
}
.um-btn-primary {
    background: #3498db;
    color: #fff;
}
.um-btn-primary:hover:not(:disabled) {
    background: #2980b9;
}
.um-btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
}
.um-btn-secondary:hover:not(:disabled) {
    background: #d5dbdb;
}
.um-btn-icon {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.15s;
}
.um-btn-icon:hover {
    background: #fadbd8;
}

.um-status-text {
    font-size: 13px;
    color: #7f8c8d;
    margin-left: 8px;
}

/* Project cards */
.um-project-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.um-card {
    background: #fafbfc;
    border: 1px solid #d5dbdb;
    border-radius: 6px;
    padding: 14px 18px;
}
.um-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.um-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}
.um-card-default {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #555;
}

.um-override-list {
    margin-bottom: 8px;
}
.um-override-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #ecf0f1;
}
.um-override-row:last-child {
    border-bottom: none;
}
.um-override-user {
    min-width: 160px;
    font-size: 13px;
    color: #2c3e50;
}

.um-muted {
    font-size: 13px;
    color: #95a5a6;
    font-style: italic;
}
.um-loading {
    font-size: 13px;
    color: #7f8c8d;
}

/* Searchable User Dropdown */
.um-searchable-dropdown {
    position: relative;
    min-width: 200px;
}
.um-searchable-input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    color: #2c3e50;
    box-sizing: border-box;
}
.um-searchable-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,.15);
}
.um-searchable-input::placeholder {
    color: #95a5a6;
}
.um-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #bdc3c7;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
}
.um-dropdown-list.open {
    display: block;
}
.um-dropdown-item {
    padding: 8px 10px;
    font-size: 13px;
    color: #2c3e50;
    cursor: pointer;
    border-bottom: 1px solid #ecf0f1;
}
.um-dropdown-item:last-child {
    border-bottom: none;
}
.um-dropdown-item:hover,
.um-dropdown-item.highlighted {
    background: #ebf5fb;
}
.um-dropdown-item.selected {
    background: #d4edfa;
    font-weight: 500;
}
.um-dropdown-empty {
    padding: 8px 10px;
    font-size: 13px;
    color: #95a5a6;
    font-style: italic;
}
