* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f1923;
    color: #e1e8ed;
    min-height: 100vh;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* ─── Login Page ────────────────────────────────────────────── */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: #1a2a3a;
    border-radius: 12px;
    padding: 40px;
    width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #4fc3f7;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #90a4ae;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #2d4a5e;
    border-radius: 8px;
    background: #0f1923;
    color: #e1e8ed;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #4fc3f7;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #4fc3f7;
    color: #0f1923;
    width: 100%;
}

.btn-primary:hover {
    background: #29b6f6;
    transform: translateY(-1px);
}

.btn-success {
    background: #66bb6a;
    color: #fff;
}

.btn-success:hover {
    background: #4caf50;
}

.btn-danger {
    background: #ef5350;
    color: #fff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 24px;
    background: #1a2a3a;
    border: 1px solid #2d4a5e;
    color: #90a4ae;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.tab-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.tab-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.tab-btn.active {
    background: #4fc3f7;
    color: #0f1923;
    border-color: #4fc3f7;
}

.error-msg {
    color: #ef5350;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

.success-msg {
    color: #66bb6a;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

/* ─── Navbar ────────────────────────────────────────────────── */

.navbar {
    background: #1a2a3a;
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2d4a5e;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: #4fc3f7;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-user {
    color: #90a4ae;
    font-size: 14px;
}

.btn-logout {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #ef5350;
    color: #ef5350;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-logout:hover {
    background: #ef5350;
    color: #fff;
}

/* ─── Dashboard ─────────────────────────────────────────────── */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px;
}

.dashboard-header h2 {
    font-size: 22px;
    color: #e1e8ed;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background: #1a2a3a;
    border-radius: 10px;
    padding: 24px;
    border: 1px solid #2d4a5e;
    cursor: pointer;
    transition: all 0.2s;
}

.project-card:hover {
    border-color: #4fc3f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(79, 195, 247, 0.1);
}

.project-card h3 {
    color: #e1e8ed;
    margin-bottom: 8px;
}

.project-card .meta {
    color: #607d8b;
    font-size: 13px;
}

/* ─── Modal ─────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #1a2a3a;
    border-radius: 12px;
    padding: 30px;
    width: 450px;
    max-width: 90vw;
}

.modal-box h3 {
    margin-bottom: 20px;
    color: #4fc3f7;
}

/* ─── Table / Spreadsheet ───────────────────────────────────── */

.table-container {
    background: #1a2a3a;
    border-radius: 10px;
    overflow-x: auto;
    border: 1px solid #2d4a5e;
    margin-top: 20px;
    width: 100%;
}

.data-table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #0f1923;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    color: #4fc3f7;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #2d4a5e;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #1e3345;
    color: #cfd8dc;
    white-space: nowrap;
    vertical-align: top;
}

.data-table tbody tr:hover {
    background: #1e3345;
}

.data-table td:nth-child(11) {
    white-space: normal;
}

.data-table td:nth-child(12),
.data-table td:nth-child(13) {
    text-align: center;
    min-width: 80px;
}

.data-table td.editable {
    position: relative;
    min-width: 250px;
    white-space: normal;
    word-break: break-word;
}

.data-table td.editable textarea {
    width: 100%;
    min-width: 220px;
    min-height: 60px;
    max-height: 200px;
    padding: 8px 10px;
    background: #0f1923;
    border: 1px solid #2d4a5e;
    border-radius: 4px;
    color: #e1e8ed;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    overflow-y: auto;
}

.data-table td.editable textarea:focus {
    border-color: #4fc3f7;
    outline: none;
    min-height: 80px;
}

/* ─── Progress Bar ──────────────────────────────────────────── */

.progress-container {
    background: #1a2a3a;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 16px;
    border: 1px solid #2d4a5e;
    display: none;
}

.progress-container.active {
    display: block;
}

.progress-text {
    color: #90a4ae;
    font-size: 13px;
    margin-bottom: 8px;
}

.progress-bar {
    height: 4px;
    background: #2d4a5e;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #4fc3f7;
    width: 0%;
    transition: width 0.3s;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ─── Invite Codes ──────────────────────────────────────────── */

.invite-section {
    background: #1a2a3a;
    border-radius: 10px;
    padding: 24px;
    border: 1px solid #2d4a5e;
    margin-top: 20px;
}

.invite-section h3 {
    color: #e1e8ed;
    margin-bottom: 16px;
}

.invite-list {
    list-style: none;
}

.invite-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #1e3345;
    font-size: 14px;
}

.invite-code {
    font-family: monospace;
    color: #4fc3f7;
    background: #0f1923;
    padding: 4px 10px;
    border-radius: 4px;
}

.invite-status {
    font-size: 12px;
    color: #66bb6a;
}

.invite-status.used {
    color: #ef5350;
}

/* ─── Toolbar ───────────────────────────────────────────────── */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.connected {
    background: rgba(102, 187, 106, 0.15);
    color: #66bb6a;
}

.status-badge.disconnected {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
}
