*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

.splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #00342C;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: splashPulse 1.8s ease-in-out infinite;
}
.splash-logo {
    width: 220px;
    height: auto;
    filter: drop-shadow(0 4px 24px rgba(0,0,0,0.3));
}
@keyframes splashPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.04); opacity: 0.9; }
}

:root {
    --bg: #0c0e14;
    --surface: #161924;
    --surface-2: #1e2231;
    --border: rgba(255,255,255,0.06);
    --text: #f0f2f5;
    --text-dim: #8b90a0;
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --green: #22c55e;
    --orange: #f59e0b;
    --red: #ef4444;
    --purple: #a855f7;
    --radius: 16px;
    --font: 'Plus Jakarta Sans', sans-serif;

    --app-bg: #f5f7fa;
    --app-surface: #ffffff;
    --app-text: #1a1d26;
    --app-text-dim: #6b7280;
    --app-primary: #2563eb;
    --app-primary-light: #dbeafe;
    --app-green: #16a34a;
    --app-green-light: #dcfce7;
    --app-orange: #ea580c;
    --app-orange-light: #fff7ed;
    --app-red: #dc2626;
    --app-red-light: #fef2f2;
    --app-purple: #7c3aed;
    --app-purple-light: #f3e8ff;
    --app-radius: 14px;
    --app-radius-sm: 10px;

    --phone-w: 375px;
    --phone-h: 812px;
    --tablet-w: 768px;
    --tablet-h: 1024px;
}

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga';
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    overflow: hidden;
    max-width: 24px;
    max-height: 24px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

.tb-left, .tb-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    color: var(--primary-light);
}
.logo-placeholder .material-symbols-rounded { font-size: 22px; }

.tb-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

.tb-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
}

.role-switcher {
    display: flex;
    gap: 4px;
    background: var(--surface-2);
    border-radius: 12px;
    padding: 4px;
}

.role-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}
.role-btn .material-symbols-rounded { font-size: 18px; }
.role-btn:hover { color: var(--text); }
.role-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 12px rgba(59,130,246,0.35);
}

.device-switcher {
    display: flex;
    gap: 2px;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 3px;
}

.dev-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.25s;
}
.dev-btn .material-symbols-rounded { font-size: 20px; }
.dev-btn:hover { color: var(--text); }
.dev-btn.active {
    background: var(--surface);
    color: var(--text);
}

.rotate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.25s;
}
.rotate-btn:hover { color: var(--text); border-color: var(--primary); }
.rotate-btn .material-symbols-rounded { font-size: 20px; }

.stage {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 60px);
    padding: 20px;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 50%, rgba(59,130,246,0.06) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(124,58,237,0.04) 0%, transparent 50%);
}

.device {
    position: relative;
    border-radius: 48px;
    background: #1a1a1a;
    box-shadow:
        0 0 0 2px #333,
        0 0 0 4px #1a1a1a,
        0 20px 60px rgba(0,0,0,0.6),
        inset 0 0 0 2px rgba(255,255,255,0.05);
    transition: all 0.4s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    flex-shrink: 0;
    transform-origin: center center;
}

.device.phone.portrait {
    width: var(--phone-w);
    height: var(--phone-h);
}
.device.phone.landscape {
    width: var(--phone-h);
    height: var(--phone-w);
}
.device.tablet.portrait {
    width: var(--tablet-w);
    height: var(--tablet-h);
}
.device.tablet.landscape {
    width: var(--tablet-h);
    height: var(--tablet-w);
}

.device-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 28px;
    background: #1a1a1a;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.device-screen {
    width: 100%;
    height: 100%;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--app-surface);
}
.sb-time { color: var(--app-text); }
.sb-icons {
    display: flex;
    gap: 4px;
}
.sb-icons .material-symbols-rounded {
    font-size: 15px;
    color: var(--app-text);
}

.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
.app-content::-webkit-scrollbar { width: 0; }

.bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 6px 8px 20px;
    background: var(--app-surface);
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border: none;
    border-radius: 0;
    background: none;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.nav-item .material-symbols-rounded {
    font-size: 22px;
    color: var(--app-text-dim);
    transition: color 0.2s;
}
.nav-item span:last-child {
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--app-text-dim);
    transition: color 0.2s;
}
.nav-item.active .material-symbols-rounded { color: var(--app-primary); }
.nav-item.active span:last-child { color: var(--app-primary); }

.nav-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 16px;
    height: 16px;
    border-radius: 100px;
    background: var(--app-red);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100%;
    background: var(--app-bg);
}

.screen-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px 12px;
    background: var(--app-surface);
}
.screen-header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--app-text);
    letter-spacing: -0.02em;
}
.sh-sub {
    font-size: 0.72rem;
    color: var(--app-text-dim);
    font-weight: 500;
    margin-top: 2px;
}
.screen-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.screen-header-icon .material-symbols-rounded {
    font-size: 22px;
    color: var(--app-text-dim);
}

.screen-body { padding: 16px 20px 24px; }

.app-card {
    background: var(--app-surface);
    border-radius: var(--app-radius);
    padding: 16px;
    margin-bottom: 12px;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--app-surface);
    border-radius: var(--app-radius);
    padding: 14px;
    cursor: pointer;
    transition: transform 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.stat-card:active { transform: scale(0.97); }
.sc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.sc-icon .material-symbols-rounded { font-size: 20px; color: #fff; }
.sc-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--app-text);
}
.sc-label {
    font-size: 0.68rem;
    color: var(--app-text-dim);
    font-weight: 600;
    margin-top: 4px;
}

.sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 10px;
}
.sec-head h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--app-text);
}
.sec-head a {
    font-size: 0.72rem;
    color: var(--app-primary);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
    transition: background 0.15s;
}
.list-item:active { background: rgba(0,0,0,0.02); }
.li-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.li-body { flex: 1; min-width: 0; }
.li-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--app-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.li-sub {
    font-size: 0.68rem;
    color: var(--app-text-dim);
    margin-top: 2px;
}
.li-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 100px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tag-green { background: var(--app-green-light); color: var(--app-green); }
.tag-orange { background: var(--app-orange-light); color: var(--app-orange); }
.tag-blue { background: var(--app-primary-light); color: var(--app-primary); }
.tag-red { background: var(--app-red-light); color: var(--app-red); }
.tag-purple { background: var(--app-purple-light); color: var(--app-purple); }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.qa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.qa-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
.qa-icon:active { transform: scale(0.9); }
.qa-icon .material-symbols-rounded { font-size: 22px; color: #fff; }
.qa-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--app-text-dim);
    text-align: center;
    line-height: 1.2;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
}
.tl-time {
    width: 44px;
    text-align: center;
    flex-shrink: 0;
    padding-top: 2px;
}
.tl-time strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--app-text);
    display: block;
}
.tl-time small {
    font-size: 0.6rem;
    color: var(--app-text-dim);
}
.tl-line {
    width: 3px;
    background: var(--app-primary-light);
    border-radius: 100px;
    flex-shrink: 0;
    position: relative;
}
.tl-line::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--app-primary);
}
.tl-body { flex: 1; }
.tl-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--app-text);
    margin-bottom: 2px;
}
.tl-client {
    font-size: 0.7rem;
    color: var(--app-text-dim);
}
.tl-address {
    font-size: 0.68rem;
    color: var(--app-text-dim);
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
}
.tl-address .material-symbols-rounded { font-size: 13px; }
.tl-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--app-surface);
    border-radius: var(--app-radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1px solid rgba(0,0,0,0.06);
}
.search-bar .material-symbols-rounded {
    font-size: 20px;
    color: var(--app-text-dim);
}
.search-bar input {
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 0.8rem;
    color: var(--app-text);
    width: 100%;
    background: transparent;
}
.search-bar input::placeholder { color: var(--app-text-dim); }

.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-bar::-webkit-scrollbar { height: 0; }
.tab-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 100px;
    background: var(--app-surface);
    color: var(--app-text-dim);
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.tab-btn:hover { color: var(--app-text); }
.tab-btn.active {
    background: var(--app-primary);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.fab {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--app-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,99,235,0.4);
    cursor: pointer;
    transition: transform 0.15s;
    z-index: 10;
}
.fab:active { transform: scale(0.9); }
.fab .material-symbols-rounded { font-size: 26px; color: #fff; }

.map-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    border-radius: var(--app-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.map-placeholder .material-symbols-rounded {
    font-size: 32px;
    color: var(--app-primary);
}
.map-placeholder span:last-child {
    font-size: 0.7rem;
    color: var(--app-primary);
    font-weight: 600;
}
.map-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg, transparent, transparent 30px, rgba(37,99,235,0.04) 30px, rgba(37,99,235,0.04) 31px
    ),
    repeating-linear-gradient(
        90deg, transparent, transparent 30px, rgba(37,99,235,0.04) 30px, rgba(37,99,235,0.04) 31px
    );
    pointer-events: none;
    position: relative;
}

.map-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    z-index: 2;
}
.map-dot.pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(2); opacity: 0; }
}

.detail-header {
    background: var(--app-primary);
    padding: 16px 20px 20px;
    color: #fff;
}
.detail-header h1 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 4px;
}
.dh-back {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.85;
    cursor: pointer;
    margin-bottom: 8px;
}
.dh-back .material-symbols-rounded { font-size: 18px; }
.dh-meta {
    display: flex;
    gap: 16px;
    font-size: 0.72rem;
    opacity: 0.85;
    margin-top: 4px;
}
.dh-meta span { display: flex; align-items: center; gap: 4px; }
.dh-meta .material-symbols-rounded { font-size: 15px; }

.detail-section {
    padding: 16px 20px;
}
.detail-section h4 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--app-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.info-row .material-symbols-rounded {
    font-size: 18px;
    color: var(--app-text-dim);
}
.ir-label {
    font-size: 0.72rem;
    color: var(--app-text-dim);
    width: 80px;
    flex-shrink: 0;
}
.ir-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--app-text);
    margin-left: auto;
}

.action-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--app-radius-sm);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
    justify-content: center;
}
.action-btn:active { transform: scale(0.97); }
.action-btn .material-symbols-rounded { font-size: 18px; }
.action-btn-primary {
    background: var(--app-primary);
    color: #fff;
}
.action-btn-green {
    background: var(--app-green);
    color: #fff;
}
.action-btn-outline {
    background: var(--app-surface);
    color: var(--app-text);
    border: 1px solid rgba(0,0,0,0.1);
}
.action-btn-red {
    background: var(--app-red-light);
    color: var(--app-red);
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
}
.check-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}
.check-item.checked .check-box {
    background: var(--app-green);
    border-color: var(--app-green);
}
.check-item.checked .check-box::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}
.ci-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--app-text);
}

.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.photo-slot {
    aspect-ratio: 4/3;
    background: var(--app-surface);
    border: 2px dashed #d1d5db;
    border-radius: var(--app-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.photo-slot:hover { border-color: var(--app-primary); }
.photo-slot .material-symbols-rounded {
    font-size: 28px;
    color: #d1d5db;
}
.photo-slot span:last-child {
    font-size: 0.68rem;
    color: var(--app-text-dim);
    font-weight: 600;
}

.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--app-text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--app-radius-sm);
    font-family: var(--font);
    font-size: 0.82rem;
    color: var(--app-text);
    background: var(--app-surface);
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    font-size: 32px;
}

.signature-pad {
    width: 100%;
    height: 120px;
    background: var(--app-surface);
    border: 2px dashed #d1d5db;
    border-radius: var(--app-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
    cursor: pointer;
}
.signature-pad .material-symbols-rounded {
    font-size: 28px;
    color: #d1d5db;
}
.signature-pad span:last-child {
    font-size: 0.68rem;
    color: var(--app-text-dim);
    font-weight: 600;
}

.toast {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: var(--app-text);
    color: #fff;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    z-index: 100;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2s forwards;
    white-space: nowrap;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.tb-logo {
    height: 28px;
    width: auto;
}

.guide-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    margin-left: 6px;
    border: none;
    border-radius: 10px;
    background: #00342C;
    color: #4ade80;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}
.guide-btn .material-symbols-rounded { font-size: 18px; }
.guide-btn:hover { background: #005244; }

.guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
    transition: opacity 0.3s, visibility 0.3s;
}
.guide-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.guide-panel {
    background: #fff;
    border-radius: 20px;
    max-width: 680px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.guide-header {
    background: #00342C;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.guide-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.guide-close:hover { background: rgba(255,255,255,0.2); }
.guide-body {
    padding: 28px 24px;
    color: #1a1d26;
}
.guide-body h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #00342C;
}
.guide-body h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 24px 0 12px;
    color: #00342C;
    padding-bottom: 6px;
    border-bottom: 2px solid #e5e7eb;
}
.guide-intro {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.7;
}
.guide-body p {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.7;
}
.guide-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.gf {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.82rem;
    color: #374151;
    line-height: 1.5;
}
.gf-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.gf strong { color: #111827; }
.guide-offline {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 16px;
}
.guide-offline p { color: #78350f; }
.guide-offline strong { color: #451a03; }
.guide-sync {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.gs-step {
    flex: 1;
    min-width: 140px;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    font-size: 0.75rem;
    color: #78350f;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.gs-step strong { display: block; color: #451a03; font-size: 0.8rem; }
.gs-arrow { color: #d97706; font-weight: 700; font-size: 1.2rem; }
.guide-roles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gr {
    padding: 12px 14px;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 0.82rem;
    color: #374151;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .guide-overlay { padding: 16px 8px; }
    .guide-body { padding: 20px 16px; }
    .guide-body h1 { font-size: 1.2rem; }
    .guide-sync { flex-direction: column; }
    .gs-arrow { transform: rotate(90deg); }
    .guide-btn span:last-child { display: none; }
}

.device.tablet .app-content { font-size: 1.05em; }
.device.tablet .stat-row { grid-template-columns: repeat(4, 1fr); }
.device.tablet .quick-actions { grid-template-columns: repeat(4, 1fr); }
.device.tablet.landscape .stat-row { grid-template-columns: repeat(4, 1fr); }
.device.tablet.landscape .quick-actions { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .toolbar { padding: 0 12px; height: 54px; }
    .role-btn { padding: 6px 10px; font-size: 0.72rem; }
    .role-btn .material-symbols-rounded { font-size: 16px; }
    .tb-label { display: none; }
    .tb-divider { display: none; }
}

@media (max-width: 768px) {
    html, body { overflow: auto; }
    .toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 8px;
    }
    .tb-left { order: 1; }
    .tb-right { order: 2; margin-left: auto; }
    .tb-center { order: 3; width: 100%; }
    .tb-label { display: none; }
    .tb-divider { display: none; }
    .role-switcher { width: 100%; justify-content: center; }
    .role-btn { flex: 1; justify-content: center; padding: 7px 4px; font-size: 0.68rem; gap: 4px; }
    .role-btn .material-symbols-rounded { font-size: 15px; }
    .stage {
        height: auto;
        min-height: calc(100vh - 120px);
        padding: 16px 8px 24px;
    }
    .dev-btn { width: 32px; height: 32px; }
    .rotate-btn { width: 34px; height: 34px; }
    .tb-logo { height: 22px; }
}

@media (max-width: 400px) {
    .toolbar { padding: 6px 8px; }
    .role-btn { font-size: 0.62rem; padding: 6px 2px; }
    .device-switcher { display: none; }
    .rotate-btn { display: none; }
    .stage { padding: 8px 4px 16px; }
}
