/* InspectSync Mobile - Global Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Safe area insets for notched phones */
body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Form input base styles */
input, select, textarea, button {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px; /* Prevents iOS zoom on focus */
}

/* Touch-friendly tap targets */
a, button, input[type="checkbox"], input[type="radio"] {
    min-height: 44px;
}

/* Disable tap highlight on mobile */
a, button {
    -webkit-tap-highlight-color: transparent;
}

/* Form overrides — match App project green focus */
.form-select,
.form-control {
    border: 1px solid #e1e8ef;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    transition: all 0.2s ease;
}

.form-select:focus,
.form-control:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Invalid field styling */
.is-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.field-error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
}

/* ========== App Body (Authenticated Pages) ========== */

body.app-body {
    background-color: #f1f5f9;
    min-height: 100vh;
    padding-top: 56px; /* navbar height */
}

/* ========== App Shell (centered frame) ========== */
/* Primarily a phone app. On tablets/desktop the content is capped at a
   phone/tablet-portrait width and centered, so the single-column layout
   stays as designed instead of stretching across a wide viewport. Phones
   sit below the cap and render full-width, unchanged. */
.app-shell {
    max-width: 768px;
    margin: 0 auto;
}

/* Bottom sheets are position:fixed; left:0; right:0 per page. Cap + center
   them to the frame so they don't span a wide viewport. The page rules don't
   set max-width/margin, so these properties apply without a load-order fight. */
.status-sheet {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== Top Navbar ========== */

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #059669;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 768px; /* align navbar contents with the .app-shell column */
    margin: 0 auto;
    padding: 0 12px 0 8px;
}

.navbar-logo img {
    height: 45px;
    width: auto;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    text-decoration: none;
    transition: background 0.2s;
    background: rgba(255, 255, 255, 0.15);
}

.navbar-btn:hover,
.navbar-btn:focus {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.navbar-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Navbar Dropdown */
.top-navbar .dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    min-width: 200px;
}

.top-navbar .dropdown-item {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    transition: all 0.15s;
}

.top-navbar .dropdown-item:hover {
    background: #059669;
    color: #ffffff;
}

.top-navbar .dropdown-item i {
    width: 20px;
    text-align: center;
}

.top-navbar .dropdown-divider {
    margin: 4px 0;
}

/* Notification Dot */
.navbar-btn {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #059669;
}

.navbar-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #059669;
    line-height: 1;
}

