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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container h1 {
    color: #58a6ff;
    margin-bottom: 40px;
    font-size: 2.5em;
}

.login-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 24px;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
}

.login-box input:focus {
    outline: none;
    border-color: #58a6ff;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #238636;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-box button:hover {
    background: #2ea043;
}

.error {
    color: #f85149;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
}

/* Navbar */
.navbar {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    color: #58a6ff;
    font-size: 1.5em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-right span {
    color: #8b949e;
}

.nav-right button {
    padding: 8px 16px;
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-right button:hover {
    background: #30363d;
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 61px);
}

/* Sidebar */
.sidebar {
    width: 200px;
    background: #161b22;
    border-right: 1px solid #30363d;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tab-btn {
    padding: 12px 16px;
    background: transparent;
    color: #8b949e;
    border: none;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #21262d;
    color: #c9d1d9;
}

.tab-btn.active {
    background: #238636;
    color: white;
}

.tab-btn span {
    font-size: 1.2em;
}

/* Content Area */
.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

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

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tab-header h2 {
    color: #c9d1d9;
}

.tab-header button, .btn-primary {
    padding: 10px 20px;
    background: #238636;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tab-header button:hover, .btn-primary:hover {
    background: #2ea043;
}

/* Ongoing Calls */
.ongoing-calls-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ongoing-call-item {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
    position: relative;
}

.ongoing-call-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.ongoing-call-id {
    color: #d32f2f;
    font-weight: bold;
    font-size: 0.85em;
}

.ongoing-call-time {
    color: #8b949e;
    font-size: 0.85em;
}

.dismiss-btn {
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
    margin-left: 8px;
}

.dismiss-btn:hover {
    color: #f85149;
}

.ongoing-call-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.ongoing-call-field {
    background: #0d1117;
    padding: 12px;
    border-radius: 6px;
}

.ongoing-call-label {
    color: #8b949e;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ongoing-call-value {
    color: #c9d1d9;
    font-size: 0.95em;
}

.ongoing-call-notes {
    margin-top: 12px;
    padding: 12px;
    background: #0d1117;
    border-radius: 6px;
}

.ongoing-call-notes strong {
    color: #8b949e;
    font-size: 0.85em;
}

.ongoing-call-acks {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #30363d;
}

.ack-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.ack-type-label {
    color: #8b949e;
    font-size: 0.9em;
    font-weight: 600;
    min-width: 120px;
}

.ack-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.ack-responded {
    background: #238636;
    color: #ffffff;
}

.ack-acknowledged {
    background: #1f6feb;
    color: #ffffff;
}

.ack-declined {
    background: #6e7681;
    color: #ffffff;
}

/* Tables */
.data-table {
    width: 100%;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    border-collapse: collapse;
    overflow: hidden;
}

.data-table thead {
    background: #21262d;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #c9d1d9;
    border-bottom: 1px solid #30363d;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #30363d;
}

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

.data-table button {
    padding: 6px 12px;
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 8px;
    transition: background 0.2s;
}

.data-table button:hover {
    background: #30363d;
}

.data-table button.delete {
    background: #da3633;
    border-color: #da3633;
}

.data-table button.delete:hover {
    background: #f85149;
}

/* Forms */
.callout-form {
    max-width: 800px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #c9d1d9;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #58a6ff;
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.history-item-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #58a6ff;
}

.history-item-time {
    color: #8b949e;
    font-size: 0.9em;
}

.history-item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.history-detail {
    display: flex;
    flex-direction: column;
}

.history-detail-label {
    font-size: 0.85em;
    color: #8b949e;
    margin-bottom: 4px;
}

.history-detail-value {
    color: #c9d1d9;
}

.history-acks {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #30363d;
}

.history-acks h4 {
    font-size: 0.9em;
    color: #8b949e;
    margin-bottom: 8px;
}

.ack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ack-badge {
    background: #238636;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 24px;
    min-width: 400px;
    max-width: 90%;
}

.modal-content.large {
    min-width: 600px;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 16px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
    font-family: inherit;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #58a6ff;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 20px;
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-actions button:first-child {
    background: #238636;
}

.modal-actions button:hover {
    background: #30363d;
}

.modal-actions button:first-child:hover {
    background: #2ea043;
}

/* Members Modal */
.members-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.members-section h3 {
    font-size: 1em;
    margin-bottom: 12px;
    color: #8b949e;
}

.member-item, .user-item {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-item button, .user-item button {
    padding: 6px 12px;
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.member-item button:hover, .user-item button:hover {
    background: #30363d;
}

.user-item button {
    background: #238636;
    border-color: #238636;
}

.user-item button:hover {
    background: #2ea043;
}

#historyGroupFilter {
    padding: 8px 12px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
}

/* Settings */
.settings-container {
    max-width: 600px;
}

.settings-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-bottom: 20px;
    color: #58a6ff;
}
