/*
 * SnagApp — Accu Air brand
 * Primary:      #C8102E  (Accu Air red)
 * Primary dark: #9B0B22
 * Primary light:#FCE4E8
 * Dark:         #111111  (near-black header/nav)
 */

/* ===== APP SHELL ===== */
.app-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #111111;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 12px 0 4px;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
    border-bottom: 3px solid #C8102E;
}

/* Three-slot topbar: left/center/right with equal flex = true centering */
.topbar-left {
    flex: 1 0 0;
    display: flex; align-items: center; justify-content: flex-start;
}
.topbar-center {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    max-width: 55vw;
}
.topbar-right {
    flex: 1 0 0;
    display: flex; align-items: center; justify-content: flex-end;
}

.topbar-brand {
    display: flex; align-items: center;
}

.topbar-icon {
    width: 32px; height: 32px;
    object-fit: contain;
    border-radius: 6px;
    margin-right: 8px;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 17px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-align: center;
    letter-spacing: .2px;
}

.topbar-home {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
    border: none; cursor: pointer; border-radius: 8px;
    background: none;
}
.topbar-home:active { background: rgba(255,255,255,.12); }

/* kept for any remaining legacy back-button usage */
.topbar-back {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
    border-radius: 50%;
    background: none; border: none; cursor: pointer;
}
.topbar-back:active { background: rgba(255,255,255,.12); }

.topbar-spacer { width: 44px; flex-shrink: 0; }

.app-main {
    padding-top: 56px;
    min-height: 100vh;
    background: #f4f4f4;
}

/* ===== LOADING ===== */
.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #757575;
    font-size: 15px;
}

.loading-spinner::before {
    content: '';
    display: block;
    width: 32px; height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #C8102E;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 12px;
}

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

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-flex;
    align-items: center; justify-content: center;
    padding: 14px 24px;
    background: #C8102E;
    color: #fff;
    border-radius: 8px;
    font-size: 16px; font-weight: 700;
    transition: background .15s;
    border: none; cursor: pointer;
    letter-spacing: .2px;
}

.btn-primary:active { background: #9B0B22; }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }

.btn-secondary {
    display: inline-flex;
    align-items: center; justify-content: center;
    padding: 12px 20px;
    background: #fff;
    color: #C8102E;
    border: 1.5px solid #C8102E;
    border-radius: 8px;
    font-size: 15px; font-weight: 600;
    cursor: pointer; transition: background .15s;
}

.btn-secondary:active { background: #FCE4E8; }

.btn-full { width: 100%; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px; font-weight: 700;
    color: #555; margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .4px;
}

.form-input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color .15s;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #C8102E;
    box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; }

.num-stepper { display: flex; align-items: stretch; }
.num-stepper .stepper-btn {
    width: 48px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #333;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.num-stepper .stepper-btn:first-child { border-radius: 8px 0 0 8px; border-right: none; }
.num-stepper .stepper-btn:last-child  { border-radius: 0 8px 8px 0; border-left: none; }
.num-stepper .stepper-btn:active { background: #e0e0e0; }
.num-stepper .stepper-input {
    border-radius: 0 !important;
    text-align: center;
    flex: 1;
    -moz-appearance: textfield;
}
.num-stepper .stepper-input::-webkit-outer-spin-button,
.num-stepper .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.form-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin: 0 16px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

.form-section-title {
    font-size: 12px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .7px;
    color: #C8102E; margin-bottom: 16px;
}

.form-actions { padding: 0 16px 32px; }

.form-error {
    background: #FFF0F2;
    border: 1px solid #F5A0A8;
    color: #9B0B22;
    border-radius: 8px;
    padding: 12px 14px; font-size: 14px;
    margin: 0 0 16px;
}

/* ===== MULTI-SELECT ===== */
.multi-select-wrap { border: 1.5px solid #ddd; border-radius: 8px; overflow: hidden; }

.multi-select-item {
    display: flex; align-items: center;
    padding: 12px 14px; cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

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

.multi-select-item input[type=checkbox] {
    width: 18px; height: 18px; margin-right: 12px;
    accent-color: #C8102E;
}

.multi-select-item span { font-size: 15px; }

/* ===== MODAL ===== */
.modal {
    position: fixed; inset: 0;
    background: #fff;
    z-index: 2000;
    display: flex; flex-direction: column;
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px; height: 56px;
    background: #111111; color: #fff;
    flex-shrink: 0;
    border-bottom: 3px solid #C8102E;
}

.modal-close, .modal-done {
    padding: 8px 14px;
    font-size: 15px; font-weight: 600;
    color: #fff; background: none; border: none;
    cursor: pointer; border-radius: 6px;
}

.modal-close:active, .modal-done:active { background: rgba(255,255,255,.12); }
.modal-done { color: #ff8a95; }

.modal-title { font-size: 16px; font-weight: 700; }

.modal-body { padding: 20px 16px; }

.remote-link-wrap { display: flex; gap: 8px; margin: 12px 0 4px; }
.remote-link-wrap .form-input { flex: 1; font-size: 13px; }

.remote-share-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.share-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 14px; border-radius: 10px;
    font-size: 14px; font-weight: 600; text-decoration: none;
    flex: 1; justify-content: center; min-width: 90px;
}
.share-btn--whatsapp { background: #25D366; color: #fff; }
.share-btn--email    { background: #1a73e8; color: #fff; }
.share-btn--sms      { background: #555;    color: #fff; }
.share-btn--download { background: #111111; color: #fff; }
.share-btn:active    { opacity: .82; }
button.share-btn     { border: none; cursor: pointer; }
.share-report-btn    { padding: 12px; min-width: 0; flex: 1; }

.job-share-section   { margin: 10px 0 8px; padding: 0 16px; }
.job-share-title     { font-size: 12px; font-weight: 700; color: #9e9e9e; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.job-share-row       { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center; padding: 48px 24px;
    color: #757575; font-size: 15px;
}

.success-state {
    text-align: center; padding: 40px 24px;
}

.success-icon {
    width: 64px; height: 64px;
    background: #FCE4E8; color: #C8102E;
    border-radius: 50%;
    font-size: 28px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}

.success-state h3 { font-size: 20px; margin-bottom: 8px; }
.success-state p  { color: #555; }

/* ===== NOTES ===== */
.note { font-size: 13px; color: #757575; margin-top: 8px; }

/* ===== LOGIN SCREEN ===== */
.snagapp-login-screen {
    min-height: 100vh;
    background: #111111;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Red diagonal accent — echoes the Accu Air "A" striping */
.snagapp-login-screen::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 280px; height: 280px;
    background: #C8102E;
    opacity: .06;
    transform: rotate(45deg);
    pointer-events: none;
}

.snagapp-login-screen::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 200px; height: 200px;
    background: #C8102E;
    opacity: .04;
    transform: rotate(45deg);
    pointer-events: none;
}

.login-container {
    width: 100%; max-width: 380px;
    background: #fff; border-radius: 20px;
    padding: 36px 28px 32px;
    box-shadow: 0 16px 56px rgba(0,0,0,.6);
    position: relative;
    z-index: 1;
}

/* Top red accent bar */
.login-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #C8102E;
    border-radius: 20px 20px 0 0;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

/* The actual icon image */
.login-logo-mark {
    margin: 0 auto 32px;
    width: 100%;
    border: 1px solid #972427;
    height: auto;
    border-radius: 11px;
    padding-bottom: 10px;
    background: radial-gradient(#c8102e, #6b0818, #000);
}

.login-logo-img {
    width: 120px; height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Fallback: text-based logo if image not yet placed */
.login-logo-fallback {
    flex-direction: column;
    align-items: center;
    width: 120px; margin: 0 auto;
}

.login-logo-snag {
    display: block;
    font-size: 28px; font-weight: 900;
    color: #C8102E;
    letter-spacing: 3px;
    line-height: 1;
    text-shadow: 2px 2px 0 #111;
}

.login-logo-app {
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 900;
    color: #111; letter-spacing: 2px;
    line-height: 1; margin-top: 2px;
}

.login-logo-a-mark { display: inline-flex; align-items: flex-end; margin-right: -2px; }

/* "By Accu Air" sub-branding */
.login-by-wrap {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; margin-top: 10px;
}

.login-by-text {
    font-size: 12px; color: #aaa; font-style: italic;
}

.login-by-brand {
    display: inline-flex; align-items: center;
    background: #111;
    color: #fff;
    font-size: 11px; font-weight: 800;
    letter-spacing: .8px;
    padding: 3px 10px 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.login-title {
    font-size: 20px; font-weight: 800; margin-bottom: 2px;
    letter-spacing: .3px; display: none; /* hidden — logo image replaces this */
}

.login-subtitle { font-size: 14px; color: #888; margin-top: 4px; }

.password-wrap { position: relative; }
.password-wrap .form-input { padding-right: 48px; }

.toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: #aaa; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
}

.login-error {
    background: #FFF0F2; border: 1px solid #F5A0A8;
    color: #9B0B22; border-radius: 8px;
    padding: 10px 14px; font-size: 14px;
    margin-bottom: 16px;
}

.login-footer { text-align: center; font-size: 12px; color: #ccc; margin-top: 24px; }

.forgot-link-wrap { text-align: center; margin-top: 14px; }
.forgot-link {
    background: none; border: none; padding: 0;
    font-size: 13px; color: #C8102E; cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
}
.forgot-link:hover { color: #9b0b22; }

.reset-panel { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.reset-back {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none; padding: 0;
    font-size: 13px; color: #888; cursor: pointer; margin-bottom: 18px;
}
.reset-back:hover { color: #333; }

.reset-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.reset-subtitle { font-size: 14px; color: #888; margin-bottom: 20px; }

.reset-success {
    background: #F0FAF4; border: 1px solid #86C9A0;
    color: #1a6b3a; border-radius: 8px;
    padding: 12px 14px; font-size: 14px;
    margin-bottom: 16px;
}

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 99px;
    font-size: 12px; font-weight: 700;
    letter-spacing: .3px;
}

.badge-active           { background: #FCE4E8; color: #C8102E; }
.badge-completed        { background: #E8F5E9; color: #2E7D32; }
.badge-pending          { background: #FFF8E1; color: #E65100; }
.badge-pending_invoice  { background: #FFF8E1; color: #F57F17; }

/* ===== NOTIFICATIONS ===== */
.notif-wrap { position: relative; display: flex; align-items: center; }

.notif-bell-btn {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; background: transparent; border: none;
    cursor: pointer; color: #ffffff; padding: 0; flex-shrink: 0;
}
.notif-bell-btn svg { pointer-events: none; }

.notif-badge {
    position: absolute; top: 4px; right: 4px;
    min-width: 16px; height: 16px; padding: 0 3px;
    background: #C8102E; color: #fff;
    border-radius: 99px; font-size: 10px; font-weight: 700;
    display: none; align-items: center; justify-content: center;
    border: 1.5px solid #111111; line-height: 1; pointer-events: none;
}

.notif-panel {
    display: none; position: absolute; top: calc(100% + 6px); right: 0;
    width: 300px; max-height: 380px;
    background: #fff; border: 1px solid #ddd; border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    z-index: 2000; overflow: hidden; flex-direction: column;
}
.notif-panel.notif-panel-open { display: flex; }

.notif-panel-hdr {
    padding: 10px 14px; font-size: 13px; font-weight: 700;
    color: #1a1a1a; border-bottom: 1px solid #eee; background: #f9f9f9;
    flex-shrink: 0;
}

.notif-panel-list {
    list-style: none; margin: 0; padding: 0;
    overflow-y: auto; flex: 1;
}

.notif-empty {
    padding: 20px 14px; font-size: 13px; color: #888; text-align: center;
}

.notif-item {
    display: flex; flex-direction: column; padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0; transition: background .15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-unread { background: #FEF3F4; }
.notif-read   { background: #fff; }

.notif-msg {
    font-size: 12.5px; color: #1a1a1a; text-decoration: none;
    line-height: 1.4; display: block;
}
.notif-msg:hover { color: #C8102E; }

.notif-time {
    font-size: 11px; color: #aaa; margin-top: 3px;
}
