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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --accent: #00ff9d;
    --accent-dim: #00cc7d;
    --text-primary: #ffffff;
    --text-secondary: #888899;
    --error: #ff4d6d;
    --success: #00ff9d;
    --border: #2a2a3a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* auth screen */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.logo-img {
    width: 60px;
    height: auto;
    margin-bottom: 1rem;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
}

.tagline {
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1rem;
}

.auth-form {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input, select, textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

input::placeholder, textarea::placeholder {
    color: var(--text-secondary);
}

.btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 2rem;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.primary {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
}

.btn.primary:hover {
    background: var(--accent-dim);
}

.btn.secondary {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.btn.secondary:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn.large {
    padding: 1.5rem 3rem;
    font-size: 1.2rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.switch-auth {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.switch-auth a {
    color: var(--accent);
    text-decoration: none;
}

.error {
    color: var(--error);
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* main screen */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    color: var(--accent);
    letter-spacing: -1px;
}

main {
    padding: 4.5rem 1rem 5rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
}

.nav-btn.active {
    color: var(--accent);
}

.nav-icon {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

/* dashboard */
.welcome h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.welcome span {
    color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.quick-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* lists */
.list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.list-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.list-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.list-item .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.list-item .badge {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.list-item .badge.secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* filter bar */
.filter-bar {
    margin-bottom: 1rem;
}

.filter-bar select {
    max-width: 200px;
}

/* clock view */
.clock-status {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.clock-status p {
    font-size: 1.2rem;
}

.clock-status.clocked-in {
    border: 2px solid var(--accent);
}

#clock-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

#clock-history h3 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab {
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.tab.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.tab-content {
    display: none;
}

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

/* messages */
textarea {
    min-height: 120px;
    resize: vertical;
    margin: 1rem 0;
}

.full-width {
    width: 100%;
}

/* bulletin */
#new-post-btn {
    margin-bottom: 1rem;
}

#new-post-form {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

#new-post-form input {
    margin-bottom: 0.5rem;
}

.pinned {
    border-left: 3px solid var(--accent);
}

/* loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* responsive */
@media (min-width: 768px) {
    main {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* PWA install banner */
.install-banner {
    position: fixed;
    bottom: 70px;
    left: 1rem;
    right: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 99;
}

.install-banner p {
    font-size: 0.9rem;
}

.install-banner button {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

/* settings */
.settings-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
}

.settings-section h3 {
    font-size: 0.9rem;
    color: #a78bfa;
    margin-bottom: 0.75rem;
    text-transform: lowercase;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.setting-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #8b5cf6;
}

.settings-about {
    margin-top: 0.5rem;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}

/* hamburger menu */
.ham-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.ham-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.ham-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.ham-btn.active span:nth-child(2) {
    opacity: 0;
}

.ham-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.settings-icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #a78bfa;
    transition: color 0.2s;
}

.settings-icon-btn:hover {
    color: #c4b5fd;
}

.ham-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ham-menu.active {
    opacity: 1;
    visibility: visible;
}

.ham-menu.hidden {
    display: none;
}

.ham-menu-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.ham-item {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: color 0.2s;
    font-family: inherit;
}

.ham-item:hover {
    color: #a78bfa;
}

.ham-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 1rem 0;
}

.ham-logout {
    color: #f87171;
    font-size: 1rem;
}

.ham-logout:hover {
    color: #fca5a5;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    position: relative;
    z-index: 1001;
}

header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* hide old bottom nav */
.bottom-nav {
    display: none !important;
}

/* door easter egg target */
#door-trigger {
    cursor: pointer;
    user-select: none;
}

/* 2FA Screens */
.tfa-card{background:#18181b;padding:40px;border-radius:12px;width:100%;max-width:450px;text-align:center;margin:auto;margin-top:10vh}
.tfa-logo{font-size:28px;font-weight:bold;background:linear-gradient(90deg,#a78bfa,#8b5cf6);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;margin-bottom:8px}
.tfa-sub{color:#a78bfa;font-size:18px;margin-bottom:8px}
.tfa-hint{color:#666;font-size:14px;margin-bottom:20px}
.tfa-qr{margin:20px 0}
.tfa-qr img{border-radius:8px;background:#fff;padding:10px}
.tfa-manual{color:#666;font-size:12px;margin-bottom:20px}
.tfa-manual code{background:#27272a;padding:4px 8px;border-radius:4px;color:#a78bfa;font-size:11px}
.tfa-copy-btn{background:none;border:none;cursor:pointer;font-size:14px;vertical-align:middle;padding:2px 6px;border-radius:4px}
.tfa-copy-btn:hover{background:#27272a}
.tfa-input{width:100%;padding:14px;margin-bottom:16px;border:1px solid #3f3f46;border-radius:8px;background:#27272a;color:#fff;font-size:18px;text-align:center;letter-spacing:8px}
.tfa-input:focus{outline:none;border-color:#a78bfa}
.tfa-input.backup{letter-spacing:2px;font-size:16px}
.tfa-btn{width:100%;padding:14px;background:#8b5cf6;border:none;border-radius:8px;color:#fff;font-size:16px;font-weight:600;cursor:pointer;margin-bottom:10px}
.tfa-btn:hover{background:#a78bfa}
.tfa-btn.secondary{background:transparent;border:1px solid #3f3f46;color:#888}
.tfa-btn.secondary:hover{border-color:#a78bfa;color:#a78bfa}
.tfa-backup{background:#27272a;border-radius:8px;padding:20px;margin:20px 0;border:1px solid #ef4444}
.tfa-backup h3{color:#a78bfa;margin-bottom:10px}
.tfa-warning{color:#ef4444;font-size:14px;margin-bottom:15px}
.tfa-codes{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:15px}
.tfa-codes .backup-code{background:#18181b;padding:10px;border-radius:4px;font-family:monospace;font-size:14px;color:#a78bfa}
.tfa-download-options{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.tfa-download-btn{background:#27272a;border:1px solid #3f3f46;color:#a78bfa;padding:8px 16px;border-radius:6px;cursor:pointer;font-size:12px}
.tfa-download-btn:hover{border-color:#a78bfa}
.tfa-backup-option{margin-top:30px;padding-top:20px;border-top:1px solid #27272a}
.tfa-backup-option p{color:#666;font-size:12px;margin-bottom:10px}
.tfa-error{color:#ef4444;font-size:14px;margin-top:10px}
.tfa-error.hidden{display:none}

/* ==================== PHONE / JMP.CHAT ==================== */

.jmp-section {
    padding: 1rem;
}

.jmp-setup-card {
    background: var(--card-bg, #1a1a2e);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

.jmp-setup-card h3 {
    margin-bottom: 0.5rem;
    color: var(--accent, #9d4edd);
}

.jmp-hint {
    color: var(--text-muted, #888);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.jmp-setup-card input {
    width: 100%;
    margin-bottom: 1rem;
}

.commd-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border, #333);
    padding-bottom: 0.5rem;
}

.commd-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.commd-tab.active {
    background: var(--accent, #9d4edd);
    color: white;
}

.commd-tab-content {
    display: none;
}

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

/* dialer */
.dialer-display {
    text-align: center;
    margin-bottom: 1rem;
}

.dialer-display input {
    font-size: 2rem;
    text-align: center;
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    max-width: 300px;
}

.dialer-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 300px;
    margin: 0 auto 1rem;
}

.dial-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border, #333);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.dial-btn:hover {
    background: var(--accent, #9d4edd);
}

.dial-btn:active {
    transform: scale(0.95);
}

.dial-btn span {
    font-size: 0.6rem;
    color: var(--text-muted, #888);
    letter-spacing: 1px;
}

.dialer-actions {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.dial-action {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border, #333);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.15s;
}

.dial-action.call-btn {
    background: #22c55e;
    border-color: #22c55e;
}

.dial-action:hover {
    opacity: 0.8;
}

/* sms */
.sms-list {
    max-height: 400px;
    overflow-y: auto;
}

    height: 500px;
}

.sms-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border, #333);
}

.sms-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sms-msg {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.95rem;
}

.sms-msg.sent {
    align-self: flex-end;
    background: var(--accent, #9d4edd);
    color: white;
    border-bottom-right-radius: 4px;
}

.sms-msg.received {
    align-self: flex-start;
    background: var(--card-bg, #1a1a2e);
    border-bottom-left-radius: 4px;
}

.sms-compose {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border, #333);
}

.sms-compose input {
    flex: 1;
}

/* call history */
.call-list {
    max-height: 400px;
    overflow-y: auto;
}

.call-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border, #333);
}

.call-item .call-type {
    width: 30px;
    text-align: center;
}

.call-item .call-info {
    flex: 1;
    margin-left: 1rem;
}

.call-item .call-number {
    font-weight: 500;
}

.call-item .call-time {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
}

.call-item .call-actions {
    display: flex;
    gap: 0.5rem;
}

.jmp-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #333);
    text-align: center;
}

.btn.danger-outline {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
}

.btn.danger-outline:hover {
    background: #ef4444;
    color: white;
}

.empty-state {
    text-align: center;
    color: var(--text-muted, #888);
    padding: 2rem;
}


/* jmp settings form */
.jmp-settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.jmp-settings-form input {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border, #333);
    background: var(--input-bg, #1a1a2e);
    color: white;
}

#jmp-settings-connected {
    margin-top: 1rem;
}

#jmp-settings-connected .btn {
    margin-top: 1rem;
    width: 100%;
}


/* phone view container fix */
#commd-view {
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
}

#jmp-interface {
    width: 100%;
}

.commd-tab-content {
    padding: 1rem 0;
}

/* commd/dialer - compact layout */
#commd-view {
    max-width: 400px;
    margin: 0 auto;
    padding: 0.5rem;
    height: calc(100vh - 140px);
    overflow-y: auto;
}

#commd-view h2 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.commd-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.commd-tab {
    flex: 1;
    padding: 0.5rem;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    color: var(--text-muted, #888);
    cursor: pointer;
    font-size: 0.85rem;
}

.commd-tab.active {
    background: var(--accent, #9d4edd);
    color: white;
    border-color: var(--accent, #9d4edd);
}

.commd-tab-content {
    display: none;
    padding: 0.5rem 0;
}

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

/* dialer compact */
.dialer-display {
    text-align: center;
    margin-bottom: 0.5rem;
}

.dialer-display input {
    font-size: 1.5rem;
    text-align: center;
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    max-width: 250px;
}

.dialer-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 240px;
    margin: 0 auto 0.5rem;
}

.dial-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border, #333);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.dial-btn:hover {
    background: var(--accent, #9d4edd);
}

.dial-btn:active {
    transform: scale(0.95);
}

.dial-btn span {
    font-size: 0.5rem;
    color: var(--text-muted, #888);
    letter-spacing: 1px;
}

.dialer-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.dial-action {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border, #333);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.15s;
}

.dial-action.call-btn {
    background: #22c55e;
    border-color: #22c55e;
}

.dial-action:hover {
    opacity: 0.8;
}

#jmp-interface {
    width: 100%;
}

.jmp-footer {
    margin-top: 1rem;
    text-align: center;
}

/* commd - remove excess spacing */
#commd-view h2 {
    display: none;
}
#commd-view .jmp-section {
    padding: 0;
}
#commd-view #jmp-interface {
    padding-top: 0;
}
.commd-tabs {
    margin-top: 0;
}

/* AGGRESSIVE gap fix */
#commd-view {
    padding: 0 !important;
    margin: 0 auto !important;
}
#commd-view > * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
#jmp-interface {
    padding: 0 !important;
    margin: 0 !important;
}
.commd-tabs {
    margin: 0 0 0.5rem 0 !important;
    padding: 0.5rem !important;
}
#commd-dialer {
    padding-top: 0 !important;
}
.dialer-display {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* connection status badge */

/* NUKE THE GAP */
#commd-view, #commd-view * {
    margin-top: 0 !important;
}
#commd-view .jmp-section {
    padding: 0 !important;
    margin: 0 !important;
}
#commd-view .commd-tabs {
    margin: 0 !important;
    padding: 0.5rem !important;
}

/* hide header in commd view */
body.commd-active header {
    display: none !important;
}
body.commd-active main {
    padding-top: 0 !important;
}
body.commd-active .bottom-nav {
    display: none !important;
}
body.commd-active #commd-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.5rem !important;
    overflow-y: auto;
}
/* commd fullscreen UI */
body.commd-active header,
body.commd-active .bottom-nav {
    display: none !important;
}
body.commd-active #commd-view {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}
#jmp-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 !important;
    margin: 0 !important;
}
.commd-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    flex-shrink: 0;
}
.commd-tab {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.8rem;
}
#commd-dialer {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    overflow: hidden;
}
.dialer-display {
    margin-bottom: 0.5rem;
}
.dialer-display input {
    font-size: 1.5rem;
    width: 100%;
    max-width: 280px;
}
.dialer-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    max-width: 260px;
}
.dial-btn {
    width: 65px;
    height: 65px;
    font-size: 1.2rem;
}
.dialer-actions {
    margin-top: 0.5rem;
    gap: 1rem;
}
.dial-action {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
}
#commd-sms, #commd-recents {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sms-list, .call-list {
    flex: 1;
    overflow-y: auto;
}
.sms-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.sms-messages {
    flex: 1;
    overflow-y: auto;
}
.sms-compose {
    flex-shrink: 0;
    padding: 0.5rem;
}
/* REMOVE ALL PREVIOUS COMMD OVERRIDES AND START FRESH */
body.commd-active header {
    display: flex !important;
}
body.commd-active .bottom-nav {
    display: none !important;
}
body.commd-active #commd-view {
    position: static !important;
    height: auto !important;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 !important;
}
#commd-view {
    padding: 0 !important;
}
#commd-view > * {
    margin-top: 0 !important;
}
#jmp-interface {
    padding: 0 !important;
    margin: 0 !important;
}
#jmp-interface .commd-tabs {
    margin: 0 !important;
    padding: 0.5rem !important;
}
#commd-dialer {
    padding: 0 0.5rem !important;
}
.jmp-section {
    padding: 0 !important;
    margin: 0 !important;
}

/* FINAL TAB FIX */
#commd-dialer, #commd-sms, #commd-recents {
    display: none !important;
}
#commd-dialer.active, #commd-sms.active, #commd-recents.active {
    display: flex !important;
    flex-direction: column;
}

/* BIGGER DIALER */
#commd-dialer {
    align-items: center;
    justify-content: center;
    padding: 1rem;
    height: calc(100vh - 200px);
}
.dialer-display input {
    font-size: 2rem !important;
    max-width: 300px !important;
}
.dialer-pad {
    max-width: 300px !important;
    gap: 0.6rem !important;
}
.dial-btn {
    width: 80px !important;
    height: 80px !important;
    font-size: 1.5rem !important;
}
.dial-action {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.4rem !important;
}
.dialer-actions {
    gap: 1.5rem !important;
    margin-top: 1rem !important;
}

/* Call History Styles */
.call-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.call-record {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.call-record:hover {
    background: rgba(255,255,255,0.06);
}

.call-icon {
    font-size: 1.25rem;
    width: 2rem;
    text-align: center;
}

.call-info {
    flex: 1;
    min-width: 0;
}

.call-number {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.125rem;
}

.call-meta {
    font-size: 0.75rem;
    color: #666;
}

/* SMS Timestamps */

/* SMS Conversations - Clean */
.sms-conversation {
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border-radius: 8px;
}

.sms-conv-action {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: stretch;
    z-index: 0;
}

.sms-archive-btn {
    width: 100%;
    background: #3b82f6;
    color: white;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
}

.sms-conv-card {
    position: relative;
    background: var(--card-bg, #1a1a2e);
    padding: 0.75rem 1rem;
    z-index: 1;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.sms-conv-card .contact {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.sms-conv-card .preview {
    font-size: 0.85rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sms-conv-card .time {
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Delete Modal */
#delete-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.delete-modal-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
}

.delete-modal-box {
    position: relative;
    background: #1a1a2e;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    min-width: 250px;
}

.delete-modal-box p {
    margin: 0 0 1.25rem 0;
    font-size: 1rem;
}

.delete-modal-btns {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.delete-modal-btns button {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.delete-cancel {
    background: #333;
    color: #fff;
}

.delete-confirm {
    background: #ef4444;
    color: #fff;
}

/* SMS Messages */
.sms-msg-wrap {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    margin-bottom: 0.5rem;
}

.sms-msg-wrap.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.sms-msg-wrap.received {
    align-self: flex-start;
    align-items: flex-start;
}

.sms-msg-wrap .sms-msg {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.95rem;
}

.sms-msg-wrap.sent .sms-msg {
    background: var(--accent, #9d4edd);
    color: white;
    border-bottom-right-radius: 4px;
}

.sms-msg-wrap.received .sms-msg {
    background: var(--card-bg, #1a1a2e);
    border-bottom-left-radius: 4px;
}

.sms-msg-wrap .msg-time {
    font-size: 0.65rem;
    color: #888;
    margin-top: 0.25rem;
    padding: 0 0.25rem;
}

/* New SMS FAB button */
.sms-new-fab {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    background: #a78bfa;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.4);
    z-index: 10;
    transition: transform 0.2s, box-shadow 0.2s;
}
.sms-new-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(167, 139, 250, 0.5);
}
.sms-new-fab:active {
    transform: scale(0.95);
}

/* New conversation view */
.sms-new-conv {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color, #0f0f1a);
    display: flex;
    flex-direction: column;
    z-index: 20;
}
.sms-new-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color, #2a2a3e);
}
.sms-new-search {
    padding: 1rem;
}
.sms-new-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border-color, #2a2a3e);
    border-radius: 8px;
    color: inherit;
    font-size: 1rem;
}
.sms-contacts {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem;
}
.sms-contact-item {
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.sms-contact-item:hover {
    background: var(--card-bg, #1a1a2e);
}
.sms-contact-item.selected {
    background: rgba(167, 139, 250, 0.2);
}
.sms-contact-name {
    font-weight: 500;
}
.sms-contact-number {
    font-size: 0.85rem;
    opacity: 0.7;
}
.sms-new-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color, #2a2a3e);
}
.sms-new-actions .btn {
    flex: 1;
}

/* Android status bar spacing */
body { padding-top: 36px; }
