:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success-bg: #dcfce7;
    --success-line: #86efac;
    --danger-bg: #fee2e2;
    --danger-line: #fca5a5;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.theme-atimonan {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f1f5f9;
}

.theme-emerald {
    --primary: #059669;
    --primary-dark: #047857;
    --bg: #ecfdf5;
}

.theme-slate {
    --primary: #334155;
    --primary-dark: #1e293b;
    --bg: #f8fafc;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 30% -10%, #dbeafe 0%, transparent 60%),
        radial-gradient(900px 380px at 95% -10%, #e0e7ff 0%, transparent 60%),
        var(--bg);
}

.app-shell {
    min-height: 100vh;
    padding: 14px 14px 88px;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 10px;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.main-content {
    display: grid;
    gap: 14px;
}

.brand-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 8px 14px rgba(37, 99, 235, 0.25);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.brand-text {
    display: grid;
    gap: 1px;
}

.brand-text small {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.brand {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #0b1220;
}

.auth-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.theme-switch {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: #eef2ff;
}

.theme-chip {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

.theme-chip.active {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
}

.nav-pills {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: #eef2ff;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.pill i {
    margin-right: 6px;
    font-size: 12px;
}

.pill:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.7);
}

.pill.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

.pill.muted {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    pointer-events: none;
}

h1 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h2 {
    margin: 0 0 6px;
    font-size: 1.08rem;
    line-height: 1.25;
}

.subtext {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.card {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    padding: 14px;
    margin-bottom: 14px;
}

.hero {
    display: grid;
    gap: 14px;
}

.page-head {
    display: grid;
    gap: 8px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.metric-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}

.metric-grid.compact {
    grid-template-columns: 1fr 1fr;
}

.metric-card {
    border-radius: var(--radius-md);
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 88px;
}

.metric-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    background: #e0e7ff;
}

.metric-label {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.metric-card h3 {
    margin: 4px 0 0;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.flow-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.step-item {
    border: 1px solid #dbeafe;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5ff 100%);
    padding: 11px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-item i {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #2563eb;
    font-size: 11px;
}

.stacked-form {
    display: grid;
    gap: 12px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #334155;
    text-transform: uppercase;
}

input,
textarea,
select,
button,
.btn {
    width: 100%;
    font-size: 14px;
    border-radius: var(--radius-sm);
}

input,
textarea,
select {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    padding: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    color: #ffffff;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
    transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button i,
.btn i {
    margin-right: 8px;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.28);
}

button:active,
.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

.btn.ghost {
    color: var(--primary-dark);
    background: #ffffff;
    border: 1px solid #bfdbfe;
    box-shadow: none;
}

.actions {
    display: grid;
    gap: 10px;
}

.sticky-actions {
    position: sticky;
    bottom: 10px;
    z-index: 25;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 9px;
}

.gps-panel {
    display: grid;
    gap: 10px;
    align-items: center;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
    padding: 12px;
}

.gps-panel strong {
    color: #1e3a8a;
}

.gps-panel small {
    color: #475569;
}

.offline-panel {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.offline-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.alert {
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
}

.alert.success {
    background: var(--success-bg);
    border: 1px solid var(--success-line);
    color: #14532d;
}

.alert.error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
    color: #7f1d1d;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 10px 0 14px;
}

.project-list {
    display: grid;
    gap: 12px;
}

.project-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 12px;
}

.project-card .actions {
    margin-top: 4px;
}

.row-actions {
    display: grid;
    gap: 8px;
}

.inline-form {
    margin: 0;
}

.btn.danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.22);
}

.project-card h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: -0.01em;
    word-break: break-word;
}

.project-card p {
    margin: 6px 0;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.project-card small {
    color: var(--text-muted);
    font-weight: 600;
}

#entryMap,
#monitorMap {
    height: 285px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    overflow: hidden;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 11px;
    text-align: left;
    font-size: 13px;
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:last-child td {
    border-bottom: none;
}

img.thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
}

.auth-card {
    width: min(100%, 420px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    padding: 18px;
}

.auth-modal-static {
    width: min(100%, 460px);
    max-height: none;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.auth-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.24);
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.auth-hint {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.mobile-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 95;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 28px rgba(15, 23, 42, 0.12);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
}

.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    width: min(100%, 620px);
    max-height: min(92vh, 900px);
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #ffffff;
    box-shadow: 0 22px 38px rgba(15, 23, 42, 0.24);
    display: grid;
    grid-template-rows: auto 1fr;
}

.modal-card-wide {
    width: min(100%, 900px);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    box-shadow: none;
}

.modal-body {
    padding: 14px 16px 16px;
    overflow: auto;
}

.dock-item {
    min-height: 58px;
    display: grid;
    place-items: center;
    gap: 2px;
    text-decoration: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    border-right: 1px solid #eef2f7;
}

.dock-item:last-child {
    border-right: none;
}

.dock-item i {
    font-size: 14px;
}

.dock-item.active {
    color: #1d4ed8;
    background: #eff6ff;
}

.page-command_dashboard {
    background: radial-gradient(1300px 650px at 15% -10%, #1e293b 0%, #0b1220 45%, #050a15 100%);
    color: #e2e8f0;
}

.page-command_dashboard .topbar,
.page-command_dashboard .mobile-dock {
    display: none;
}

.page-command_dashboard .app-shell {
    padding: 14px;
}

.page-command_dashboard .container {
    max-width: 100%;
}

.command-shell {
    display: grid;
    gap: 12px;
}

.command-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.command-header h1 {
    color: #e2e8f0;
}

.command-header .subtext {
    color: #94a3b8;
}

.command-time {
    min-width: 220px;
    text-align: right;
    font-weight: 700;
    color: #38bdf8;
}

.command-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.command-kpi {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(2, 6, 23, 0.95) 100%);
}

.command-kpi p {
    margin: 0;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.command-kpi h2 {
    margin: 6px 0 0;
    color: #f8fafc;
    font-size: 1.4rem;
}

.command-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 10px;
}

.command-map-wrap,
.command-feed {
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    background: rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.command-map-toolbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    align-items: end;
    padding: 10px;
    overflow-x: auto;
}

.command-project-filter {
    display: grid;
    gap: 4px;
    min-width: 220px;
}

.command-project-filter span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 700;
}

.command-project-filter select {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
}

#commandMap {
    height: calc(100vh - 260px);
    min-height: 520px;
}

.command-feed {
    display: grid;
    grid-template-rows: auto 1fr;
}

.command-feed .section-head {
    padding: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.command-feed .section-head h2 {
    color: #f8fafc;
}

.command-feed-list {
    max-height: calc(100vh - 310px);
    overflow: auto;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.feed-item {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 10px;
    align-items: center;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.85);
}

.feed-item:hover {
    border-color: rgba(56, 189, 248, 0.7);
}

.feed-item h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #f8fafc;
}

.feed-item p {
    margin: 2px 0;
    color: #93c5fd;
    font-size: 0.82rem;
}

.feed-item small {
    color: #94a3b8;
    font-size: 0.75rem;
}

.feed-thumb {
    width: 78px;
    height: 62px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.feed-thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    background: rgba(30, 41, 59, 0.85);
}

@media (max-width: 1200px) {
    .command-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .command-grid {
        grid-template-columns: 1fr;
    }

    #commandMap {
        min-height: 420px;
        height: 58vh;
    }

    .command-feed-list {
        max-height: 380px;
    }

    .command-map-toolbar {
        grid-auto-flow: row;
        grid-auto-columns: 1fr;
    }

    .command-project-filter {
        min-width: 0;
    }
}

@media (min-width: 768px) {
    .app-shell {
        padding: 22px;
    }

    .topbar {
        top: 14px;
        padding: 14px;
    }

    .brand {
        font-size: 1.05rem;
    }

    h1 {
        font-size: 1.85rem;
    }

    .card {
        padding: 18px;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .actions {
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        justify-content: start;
    }

    .gps-panel {
        grid-template-columns: 1fr auto;
    }

    .flow-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .metric-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-row {
        grid-template-columns: 1fr auto;
        align-items: end;
    }

    #entryMap,
    #monitorMap {
        height: 350px;
    }

    .mobile-dock {
        display: none;
    }

    .modal-overlay {
        padding: 22px;
    }
}

@media (max-width: 767px) {
    .nav-pills {
        display: none;
    }

    .auth-actions .pill {
        display: none;
    }

    .theme-switch {
        display: none;
    }

    .user-chip {
        min-height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .app-shell {
        padding: 10px 10px 84px;
    }

    .topbar {
        top: 8px;
        padding: 10px;
        gap: 8px;
    }

    .brand-wrap {
        min-width: 0;
        width: 100%;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .brand {
        font-size: 0.86rem;
    }

    .brand-text small {
        font-size: 9px;
    }

    .auth-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .user-chip {
        display: none;
    }

    h1 {
        font-size: 1.2rem;
    }

    h2 {
        font-size: 1rem;
    }

    .card {
        padding: 12px;
        border-radius: 14px;
    }

    .metric-grid.compact {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 78px;
        padding: 10px;
    }

    .metric-card h3 {
        font-size: 1rem;
    }

    .step-item {
        padding: 10px;
        font-size: 0.85rem;
    }

    .tag-badge {
        font-size: 10px;
        min-height: 26px;
        padding: 0 8px;
    }

    input,
    textarea,
    select {
        padding: 10px;
        font-size: 13px;
    }

    .actions {
        gap: 8px;
    }

    button,
    .btn {
        min-height: 42px;
        font-size: 13px;
    }

    #entryMap,
    #monitorMap {
        height: 220px;
    }

    .modal-overlay {
        padding: 8px;
    }

    .modal-card,
    .modal-card-wide,
    .auth-modal-static {
        width: 100%;
        max-height: 95vh;
        border-radius: 14px;
    }

    .modal-head {
        padding: 10px 12px;
    }

    .modal-head h2 {
        font-size: 1rem;
    }

    .modal-body {
        padding: 10px 12px 12px;
    }

    .table-wrap {
        border-radius: 12px;
    }

    th,
    td {
        padding: 8px;
        font-size: 12px;
    }

    table.points-table {
        min-width: 0;
        border-collapse: collapse;
    }

    table.points-table thead {
        display: none;
    }

    table.points-table tbody,
    table.points-table tr,
    table.points-table td {
        display: block;
        width: 100%;
    }

    table.points-table tr {
        border-bottom: 1px solid #e2e8f0;
        padding: 8px 0;
    }

    table.points-table tr:last-child {
        border-bottom: none;
    }

    table.points-table td {
        border-bottom: none;
        text-align: left;
        padding: 5px 2px;
    }

    table.points-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        font-weight: 700;
        color: #64748b;
        margin-bottom: 2px;
    }

    table.points-table .row-actions {
        grid-template-columns: 1fr;
    }

    .page-geotag .mobile-dock,
    .page-monitoring .mobile-dock {
        display: grid;
    }

    .page-geotag .app-shell,
    .page-monitoring .app-shell {
        padding-bottom: 92px;
    }

    .dock-item {
        min-height: 54px;
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .page-monitoring .metric-grid.compact,
    .page-geotag .metric-grid.compact {
        grid-template-columns: 1fr;
    }

    .page-monitoring .actions,
    .page-geotag .actions {
        grid-template-columns: 1fr;
        grid-auto-flow: row;
    }

    .page-monitoring #monitorMap,
    .page-geotag #entryMap {
        height: 210px;
    }

    .page-monitoring .card,
    .page-geotag .card {
        padding: 10px;
    }

    .page-monitoring .app-shell,
    .page-geotag .app-shell {
        padding-bottom: 96px;
    }

    .page-monitoring .table-wrap,
    .page-geotag .table-wrap {
        overflow-x: hidden;
    }

    .page-monitoring table.points-table,
    .page-geotag table.points-table {
        min-width: 0;
        border-collapse: collapse;
    }

    .page-monitoring table.points-table thead,
    .page-geotag table.points-table thead {
        display: none;
    }

    .page-monitoring table.points-table tbody,
    .page-monitoring table.points-table tr,
    .page-monitoring table.points-table td,
    .page-geotag table.points-table tbody,
    .page-geotag table.points-table tr,
    .page-geotag table.points-table td {
        display: block;
        width: 100%;
    }

    .page-monitoring table.points-table tr,
    .page-geotag table.points-table tr {
        border-bottom: 1px solid #e2e8f0;
        padding: 8px 0;
    }

    .page-monitoring table.points-table tr:last-child,
    .page-geotag table.points-table tr:last-child {
        border-bottom: none;
    }

    .page-monitoring table.points-table td,
    .page-geotag table.points-table td {
        border-bottom: none;
        text-align: left;
        padding: 5px 2px;
    }

    .page-monitoring table.points-table td::before,
    .page-geotag table.points-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        font-weight: 700;
        color: #64748b;
        margin-bottom: 2px;
    }
}

@media (max-width: 430px) and (min-height: 800px) and (orientation: portrait) {
    .app-shell {
        padding: 10px 10px 12px;
    }

    .topbar {
        position: static;
        margin-bottom: 10px;
    }

    .main-content {
        gap: 10px;
    }

    .card {
        padding: 10px;
        margin-bottom: 10px;
    }

    .page-geotag #entryMap,
    .page-monitoring #monitorMap {
        height: 200px;
    }

    .page-geotag .metric-grid.compact,
    .page-monitoring .metric-grid.compact {
        grid-template-columns: 1fr;
    }

    .page-geotag .section-head,
    .page-monitoring .section-head {
        margin-bottom: 6px;
    }

    .modal-card,
    .modal-card-wide {
        max-height: 92vh;
    }

    .modal-body {
        padding: 10px;
    }

    .page-geotag .sticky-actions {
        position: static;
        padding: 6px;
    }

    .page-geotag .gps-panel {
        padding: 10px;
    }
}

@media (max-width: 340px) {
    .brand {
        font-size: 0.8rem;
    }

    .subtext {
        font-size: 0.84rem;
    }

    .metric-icon {
        width: 34px;
        height: 34px;
    }

    .step-item {
        font-size: 0.8rem;
    }

    button,
    .btn {
        font-size: 12px;
    }
}
