/**
 * YOU+ Smart Walking Stick - Main Stylesheet
 * Design System: SF Pro Display, Grey Goose borders
 */

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    min-height: 100dvh;
    background: #F5F5F5;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========== MOBILE FIRST (No Frame) ========== */
.desktop-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
}

.mobile-frame {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

.mobile-notch {
    display: none;
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    background: #F5F5F5;
}

/* ========== DESKTOP FRAME (600px+) ========== */
@media (min-width: 600px) {
    html, body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
        overflow: auto;
    }
    
    .desktop-wrapper {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 30px 20px;
        min-height: 100vh;
    }
    
    .mobile-frame {
        width: 390px;
        height: 844px;
        max-height: calc(100vh - 60px);
        min-height: auto;
        border-radius: 44px;
        box-shadow: 
            0 0 0 11px #1a1a1a,
            0 0 0 13px #333,
            0 25px 50px rgba(0, 0, 0, 0.5);
        overflow: hidden;
        position: relative;
        background: #F5F5F5;
    }
    
    .mobile-notch {
        display: block;
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 126px;
        height: 28px;
        background: #1a1a1a;
        border-radius: 0 0 18px 18px;
        z-index: 10000;
    }
    
    .mobile-notch::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 52px;
        height: 5px;
        background: #333;
        border-radius: 3px;
    }
    
    #app {
        height: 100%;
        min-height: auto;
        overflow: hidden;
    }
    
    .screen {
        padding-top: 35px !important;
    }
    
    .bottom-nav {
        border-radius: 0 0 33px 33px;
    }
}

/* Large desktop branding */
@media (min-width: 1200px) {
    .desktop-wrapper::before {
        content: 'YOU+ Smart Walking Stick';
        position: fixed;
        top: 30px;
        left: 50px;
        color: rgba(255, 255, 255, 0.3);
        font-size: 14px;
        font-weight: 500;
        letter-spacing: 1px;
    }
}

/* ========== CSS VARIABLES ========== */
:root {
    /* Main Colors */
    --color-primary: #19774A;
    --color-primary-light: #1e8f59;
    --color-primary-dark: #145f3b;
    --color-secondary: #3DB3E6;
    --color-accent: #F36A3A;
    
    /* Greys */
    --color-dark: #333333;
    --color-medium-grey: #808080;
    --color-grey: #949494;
    --color-grey-goose: #CDCDCD;
    --color-harp: #EEEEEE;
    --color-white: #FFFFFF;
    --color-bg: #F5F5F5;
    
    /* Semantic Colors */
    --color-success: #19774A;
    --color-warning: #E89230;
    --color-danger: #C91E0E;
    --color-info: #3DB3E6;
    
    /* Battery Colors */
    --color-battery-full: #19774A;
    --color-battery-medium: #E89230;
    --color-battery-low: #C91E0E;
    
    /* Typography */
    --font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    
    /* Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-dark);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    height: 100%;
    max-width: 430px;
    margin: 0 auto;
    background-color: var(--color-bg);
    position: relative;
    overflow: hidden;
}

/* ========== SCREENS ========== */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-bg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.screen.active {
    display: flex;
}

.screen-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-md);
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--spacing-md));
    -webkit-overflow-scrolling: touch;
}

.screen-content.with-nav {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px) + 10px);
}

/* ========== SPLASH SCREEN ========== */
#splash-screen {
    background: linear-gradient(135deg, var(--color-white) 0%, var(--color-harp) 100%);
    justify-content: center;
    align-items: center;
}

.splash-content {
    text-align: center;
}

.logo-large {
    margin-bottom: var(--spacing-md);
}

.logo-text {
    font-size: 48px;
    font-weight: 700;
    color: var(--color-dark);
    letter-spacing: -1px;
}

.logo-text .plus {
    color: var(--color-grey);
    font-weight: 400;
}

.tagline {
    font-size: 18px;
    color: var(--color-medium-grey);
    font-weight: 500;
}

/* ========== LOGIN SCREEN ========== */
.login-content {
    position: relative;
}

.decorative-shapes {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
}

.shape-1 {
    width: 150px;
    height: 150px;
    background: var(--color-secondary);
    top: -50px;
    right: -30px;
}

.shape-2 {
    width: 100px;
    height: 100px;
    background: var(--color-accent);
    top: 60px;
    right: 80px;
    opacity: 0.2;
}

.logo-small {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.logo-text-small {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-dark);
}

.login-header {
    margin-bottom: var(--spacing-xl);
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.login-header p {
    font-size: 18px;
    color: var(--color-medium-grey);
    line-height: 1.4;
}

.login-form {
    margin-top: var(--spacing-lg);
}

/* ========== FORM ELEMENTS ========== */
.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: var(--spacing-sm);
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: var(--font-family);
    color: var(--color-dark);
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(25, 119, 74, 0.1);
}

.input-field::placeholder {
    color: var(--color-grey);
}

.phone-input-group {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.country-select {
    width: 100px;
    padding: 14px 10px;
    font-size: 14px;
    font-family: var(--font-family);
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
}

.phone-input {
    flex: 1;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.btn-primary:not(:disabled):hover {
    background-color: #e55a2a;
}

.btn-primary:not(:disabled):active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: var(--color-dark);
    color: var(--color-white);
}

.btn-secondary:not(:disabled):hover {
    background-color: #444;
}

.btn-success {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-success:not(:disabled):hover {
    background-color: var(--color-primary-light);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-grey-goose);
    color: var(--color-dark);
}

.btn-outline:not(:disabled):hover {
    background-color: var(--color-harp);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-dark);
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: var(--color-harp);
}

/* ========== OTP SCREEN ========== */
.otp-header {
    margin-bottom: var(--spacing-xl);
}

.otp-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.otp-header p {
    font-size: 16px;
    color: var(--color-medium-grey);
}

#masked-phone {
    font-weight: 600;
    color: var(--color-dark);
}

.otp-inputs {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.otp-box {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    font-family: var(--font-family);
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s;
}

.otp-box:focus {
    border-color: var(--color-primary);
}

.otp-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.otp-actions .btn {
    flex: 1;
}

.demo-hint {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    background-color: var(--color-harp);
    border-radius: var(--radius-md);
    text-align: center;
}

.demo-hint p {
    font-size: 13px;
    color: var(--color-medium-grey);
}

/* ========== ACCOUNT SELECTION ========== */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-md);
}

.header-bar h2 {
    font-size: 18px;
    font-weight: 600;
}

.select-subtitle {
    font-size: 15px;
    color: var(--color-medium-grey);
    margin-bottom: var(--spacing-md);
}

.accounts-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.account-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.account-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.account-card.selected {
    border-color: var(--color-primary);
    background-color: rgba(25, 119, 74, 0.05);
}

.account-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background-color: var(--color-harp);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-medium-grey);
    overflow: hidden;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-info {
    flex: 1;
}

.account-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-dark);
}

.account-label {
    font-size: 13px;
    color: var(--color-medium-grey);
}

.account-badge {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-super-user {
    background-color: rgba(25, 119, 74, 0.1);
    color: var(--color-primary);
}

.badge-family-member {
    background-color: rgba(61, 179, 230, 0.1);
    color: var(--color-secondary);
}

.badge-stick-user {
    background-color: rgba(243, 106, 58, 0.1);
    color: var(--color-accent);
}

/* ========== APP HEADER ========== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-md);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-dark);
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    background-color: var(--color-white);
    border-top: 1px solid var(--color-grey-goose);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 1000;
}

/* Desktop: center the nav inside frame */
@media (min-width: 600px) {
    .bottom-nav {
        position: absolute;
        max-width: 390px;
        left: 0;
        right: 0;
    }
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 0;
    background: none;
    border: none;
    color: var(--color-grey);
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 0 0 3px 3px;
}

/* ========== TAB CONTENT ========== */
.tab-content {
    display: none;
    padding-bottom: var(--spacing-md);
}

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

/* ========== CARDS ========== */
.card {
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-dark);
}

/* ========== STATUS WIDGETS ========== */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.status-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.status-label {
    font-size: 13px;
    color: var(--color-medium-grey);
    margin-bottom: var(--spacing-sm);
}

.status-value {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-white);
}

.status-bluetooth.connected {
    background-color: var(--color-secondary);
}

.status-bluetooth.disconnected {
    background-color: var(--color-grey);
}

.status-battery {
    background-color: var(--color-battery-full);
}

.status-battery.medium {
    background-color: var(--color-battery-medium);
}

.status-battery.low {
    background-color: var(--color-battery-low);
}

/* ========== ACTION BUTTONS ========== */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.action-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.action-label {
    font-size: 13px;
    color: var(--color-medium-grey);
    margin-bottom: var(--spacing-sm);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-white);
    border: none;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: opacity 0.2s;
}

.action-btn:hover {
    opacity: 0.9;
}

.action-btn.sos {
    background-color: var(--color-accent);
}

.action-btn.message {
    background-color: var(--color-dark);
}

.action-btn.call {
    background-color: var(--color-primary);
}

/* ========== CONTACT LIST ========== */
.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.contact-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background-color: var(--color-harp);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-medium-grey);
    overflow: hidden;
}

.contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-dark);
}

.contact-phone {
    font-size: 13px;
    color: var(--color-medium-grey);
}

.contact-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.contact-action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.contact-action-btn:hover {
    opacity: 0.8;
}

.contact-action-btn.call {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.contact-action-btn.whatsapp {
    background-color: #25D366;
    color: var(--color-white);
}

.contact-action-btn.sms {
    background-color: var(--color-dark);
    color: var(--color-white);
}

.contact-action-btn:disabled {
    background-color: var(--color-grey);
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== MODALS ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-grey-goose);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: var(--spacing-lg);
}

.qr-code-display {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.qr-hint {
    text-align: center;
    font-size: 14px;
    color: var(--color-medium-grey);
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-harp);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: var(--spacing-md);
    font-size: 14px;
    color: var(--color-medium-grey);
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s;
    z-index: 3000;
    max-width: 90%;
    text-align: center;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background-color: var(--color-success);
}

.toast.error {
    background-color: var(--color-danger);
}

.toast.warning {
    background-color: var(--color-warning);
}

/* ========== TABS (Segmented Control) ========== */
.tabs {
    display: flex;
    background-color: var(--color-harp);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: var(--spacing-md);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-family);
    color: var(--color-medium-grey);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ========== LOG ENTRIES ========== */
.log-item {
    padding: var(--spacing-md);
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.log-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.log-icon {
    width: 24px;
    height: 24px;
}

.log-time {
    font-size: 13px;
    color: var(--color-medium-grey);
}

.log-message {
    font-size: 15px;
    font-weight: 500;
}

.log-message.critical {
    color: var(--color-danger);
}

.log-message.warning {
    color: var(--color-warning);
}

.log-message.info {
    color: var(--color-primary);
}

/* ========== FORM SECTIONS ========== */
.form-section {
    margin-bottom: var(--spacing-lg);
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-medium-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-md);
}

.form-row {
    margin-bottom: var(--spacing-md);
}

.form-row-inline {
    display: flex;
    gap: var(--spacing-md);
}

.form-row-inline > * {
    flex: 1;
}

/* ========== TOGGLE SWITCH ========== */
.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
}

.toggle-label {
    font-size: 15px;
    font-weight: 500;
}

.toggle {
    position: relative;
    width: 46px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-grey);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--color-white);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    font-size: 14px;
    color: var(--color-medium-grey);
}

/* ========== SWIPE ACTIONS ========== */
.swipe-container {
    position: relative;
    overflow: hidden;
}

.swipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.swipe-action {
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
}

.swipe-action.delete {
    background-color: var(--color-danger);
}

/* ========== SUPPORT GRID ========== */
.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.support-card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.support-label {
    display: block;
    font-size: 14px;
    color: var(--color-grey);
    margin-bottom: 12px;
}

.support-btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: transform 0.1s;
}

.support-btn:active {
    transform: scale(0.97);
}

.support-btn.blue { background-color: var(--color-secondary); }
.support-btn.green { background-color: var(--color-primary); }
.support-btn.orange { background-color: var(--color-accent); }
.support-btn.dark { background-color: var(--color-dark); }
.support-btn.green-dark { background-color: #2E7D32; }
.support-btn.blue-light { background-color: #29B6F6; }
.support-btn.orange-light { background-color: #FF7043; }

/* ========== FAQ LIST ========== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-dark);
}

.faq-arrow {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 16px 16px;
    font-size: 14px;
    color: var(--color-grey);
    line-height: 1.5;
    border-top: 1px solid var(--color-harp);
    padding-top: 12px;
    margin-top: -4px;
}

/* ========== RATING STARS ========== */
.rating-stars {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.star-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.1s;
}

.star-btn:active {
    transform: scale(1.2);
}

/* ========== BLUETOOTH BANNER ========== */
.bluetooth-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.bluetooth-banner.connected {
    background-color: rgba(61, 179, 230, 0.1);
    color: var(--color-secondary);
}

.bluetooth-banner.disconnected {
    background-color: rgba(148, 148, 148, 0.1);
    color: var(--color-grey);
}

/* ========== MAP ACTION BUTTONS ========== */
.map-action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.map-action-btn {
    flex: 1;
    height: 56px;
    border-radius: var(--radius-lg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}

.map-action-btn:active {
    transform: scale(0.97);
}

.map-action-btn.message {
    background-color: var(--color-dark);
    color: white;
    flex: 0.8;
}

.map-action-btn.sos {
    background-color: var(--color-accent);
    color: white;
    flex: 1;
}

.map-action-btn.call {
    background-color: var(--color-primary);
    color: white;
    flex: 0.8;
}

.map-action-btn.disabled {
    background-color: var(--color-grey-goose);
    color: var(--color-grey);
    cursor: not-allowed;
}

/* ========== MAP CONTAINER ========== */
.map-container {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--color-harp);
    position: relative;
    margin-bottom: 16px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
}

.map-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.marker-label {
    background-color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-top: 4px;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--color-grey);
}

.map-placeholder p {
    font-size: 14px;
}

/* ========== DIRECTION CARD ========== */
.direction-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.direction-info {
    flex: 1;
}

.direction-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 4px;
}

.direction-address {
    font-size: 13px;
    color: var(--color-grey);
    line-height: 1.4;
}

.direction-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background-color: var(--color-secondary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: 12px;
}

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

.direction-btn.disabled {
    background-color: var(--color-grey-goose);
    color: var(--color-grey);
    cursor: not-allowed;
}

/* ========== SECTION TITLES ========== */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 4px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--color-grey);
    margin-bottom: 16px;
}

/* ========== USER CONTACT ITEM ========== */
.user-contact-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-contact-item.temp-contact {
    border-left: 3px solid var(--color-warning);
}

.user-contact-item .contact-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background-color: var(--color-harp);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-medium-grey);
    overflow: hidden;
    flex-shrink: 0;
}

.user-contact-item .contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-contact-item .contact-info {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.user-contact-item .contact-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-contact-item .contact-phone {
    font-size: 14px;
    color: var(--color-grey);
    margin-top: 2px;
}

.temp-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    background-color: var(--color-warning);
    color: white;
    border-radius: 4px;
}

.user-contact-item .contact-actions {
    display: flex;
    gap: 8px;
}

.user-contact-item .contact-action-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.user-contact-item .contact-action-btn:active {
    transform: scale(0.95);
}

.user-contact-item .contact-action-btn.call {
    background-color: var(--color-secondary);
    color: white;
}

.user-contact-item .contact-action-btn.whatsapp {
    background-color: #25D366;
    color: white;
}

.user-contact-item .contact-action-btn.sms {
    background-color: var(--color-dark);
    color: white;
}

.user-contact-item .contact-action-btn.disabled {
    background-color: var(--color-grey-goose);
    color: var(--color-grey);
    cursor: not-allowed;
}

/* ========== STEPS CHART ========== */
.steps-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: var(--spacing-md) 0;
    gap: 8px;
}

.steps-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.steps-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 4px;
}

.steps-bar {
    width: 100%;
    max-width: 40px;
    min-height: 20px;
    background-color: var(--color-secondary);
    border-radius: 4px 4px 0 0;
}

.steps-day {
    font-size: 12px;
    color: var(--color-grey);
    margin-top: 8px;
}

/* ========== EMERGENCY CONTACT ITEM ========== */
.emergency-contact-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-harp);
}

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

.emergency-contact-item .contact-info {
    flex: 1;
    margin-left: 12px;
}

.emergency-contact-item .contact-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-grey);
    margin-top: 2px;
}

.contact-call-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

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

/* ========== FORM HEADER ========== */
.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-harp);
}

/* ========== RADIO CARDS ========== */
.radio-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-goose);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.radio-card input {
    display: none;
}

.radio-card span {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-medium-grey);
}

.radio-card.selected {
    border-color: var(--color-primary);
    background-color: rgba(25, 119, 74, 0.05);
}

.radio-card.selected span {
    color: var(--color-primary);
}

/* ========== TEXTAREA ========== */
textarea.input-field {
    resize: vertical;
    min-height: 60px;
}

/* ========== GREETING CARD ========== */
.greeting-card {
    background: linear-gradient(135deg, var(--color-white) 0%, var(--color-harp) 100%);
}

.greeting-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.greeting-text {
    font-size: 16px;
    color: var(--color-dark);
    margin-bottom: 4px;
}

.greeting-date {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-dark);
}

.weather-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.weather-icon {
    font-size: 28px;
}

.weather-temp {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-dark);
}

/* ========== PROFILE HEADER ========== */
.profile-header {
    text-align: center;
    padding: var(--spacing-md) 0;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background-color: var(--color-harp);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--color-medium-grey);
    margin: 0 auto var(--spacing-md);
    overflow: hidden;
}

.profile-avatar.large {
    width: 80px;
    height: 80px;
    font-size: 32px;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 4px;
}

.profile-subtitle {
    font-size: 14px;
    color: var(--color-medium-grey);
}

/* ========== INFO ROWS ========== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-harp);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: var(--color-medium-grey);
    flex-shrink: 0;
    margin-right: var(--spacing-md);
}

.info-value {
    font-size: 14px;
    color: var(--color-dark);
    text-align: right;
    word-break: break-word;
}

/* ========== LOCATION INFO ========== */
.location-info {
    padding: var(--spacing-sm) 0;
}

.location-text {
    font-size: 15px;
    color: var(--color-dark);
    margin-bottom: 4px;
}

.location-time {
    font-size: 13px;
    color: var(--color-grey);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 360px) {
    .otp-box {
        width: 44px;
        height: 50px;
        font-size: 20px;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
}

/* =====================================================
   SUPER USER HOME - FIGMA MATCHING STYLES
   ===================================================== */

.page-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.back-btn-small {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-grey-goose);
    border-radius: 10px;
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.page-title-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-dark);
}

.bt-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--color-white);
    border-radius: 12px;
    margin-bottom: 12px;
}

.bt-status-bar svg { fill: var(--color-blue); }
.bt-status-bar span { font-size: 14px; font-weight: 500; }

.map-container-large {
    width: calc(100% + 40px);
    height: calc(100vh - 500px);
    min-height: 300px;
    margin: 0 -20px;
    overflow: hidden;
    background: var(--color-harp);
    position: relative;
}

.map-container-large iframe { width: 100%; height: 100%; border: 0; }

.map-marker-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.marker-label {
    background: var(--color-white);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    margin-top: -5px;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.map-placeholder p { font-size: 14px; color: var(--color-grey); }

.call-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-white);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.call-card-content { display: flex; align-items: center; gap: 12px; }
.call-card-name { font-size: 16px; font-weight: 600; }
.call-card-actions { display: flex; gap: 10px; }

.contact-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.contact-action-btn.call { background: var(--color-blue); }
.contact-action-btn.whatsapp { background: #25D366; }
.contact-action-btn.sms { background: var(--color-dark); }
.contact-action-btn.disabled { background: var(--color-grey-goose); cursor: not-allowed; }

.contact-tabs { display: flex; gap: 8px; margin-bottom: 20px; }

.contact-tab-btn {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--color-grey-goose);
    border-radius: 12px;
    background: var(--color-white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.contact-tab-btn.active {
    background: var(--color-green);
    color: var(--color-white);
    border-color: var(--color-green);
}

.section-header { margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.section-subtitle { font-size: 13px; color: var(--color-grey); }

.contact-card-swipeable {
    position: relative;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
}

.contact-card-delete {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: var(--color-danger);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-card-delete svg { width: 24px; height: 24px; fill: white; }

.contact-card-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-white);
    padding: 12px 16px;
    position: relative;
    transition: transform 0.2s;
}

.contact-card-inner.swiped { transform: translateX(-80px); }

.info-box-warning {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #FFEBEE;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid var(--color-grey-goose);
}

.info-box-warning svg { width: 20px; height: 20px; fill: var(--color-danger); flex-shrink: 0; }
.info-box-warning p { font-size: 13px; }

.fixed-add-btn {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    max-width: 440px;
    margin: 0 auto;
    z-index: 10;
}

.btn-add-disabled { background: var(--color-grey) !important; cursor: not-allowed; }

