/* ============================================================
   Toda Vida Express — Estilos Globais
   ============================================================ */

:root {
    --bg:          #F0F4FA;
    --bg-card:     #FFFFFF;
    --bg-card2:    #EAF0FA;
    --border:      #D6E2F5;
    --border-dark: #A8C0E8;
    --ink:         #0D1B3E;
    --ink-2:       #3A5080;
    --ink-3:       #7B96C2;
    --accent:      #1A5CDB;
    --accent-2:    #4A82F0;
    --accent-bg:   #E8EFFD;
    --accent-glow: rgba(26, 92, 219, 0.18);
    --success:     #3B82F6;
    --success-bg:  #DBEAFE;
    --danger:      #C0392B;
    --danger-bg:   #FDECEA;
    --amber:       #B87D0A;
    --amber-bg:    #FDF4DC;
    --shadow-sm:   0 1px 4px rgba(13,27,62,0.07), 0 1px 2px rgba(13,27,62,0.04);
    --shadow-md:   0 4px 18px rgba(13,27,62,0.10), 0 2px 6px rgba(13,27,62,0.05);
    --shadow-lg:   0 12px 40px rgba(13,27,62,0.14), 0 4px 12px rgba(13,27,62,0.07);
    --shadow-blue: 0 4px 18px rgba(26,92,219,0.22);
    --radius-sm:   12px;
    --radius-md:   18px;
    --radius-lg:   26px;
    --footer-height: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: 'Nunito Sans', 'Nunito', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    overscroll-behavior-y: auto;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(26,92,219,0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 90%, rgba(74,130,240,0.05) 0%, transparent 50%);
    pointer-events: none; z-index: 0;
}

#app {
    position: relative; z-index: 1;
    max-width: 480px; margin: 0 auto;
}

/* ======= SPLASH ======= */
#splash {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: linear-gradient(160deg, #0D1B3E 0%, #1A3A7A 50%, #1A5CDB 100%);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-bg-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.splash-orb-1 {
    width: 320px; height: 320px; top: -80px; right: -80px;
    background: radial-gradient(circle, rgba(74,130,240,0.25) 0%, transparent 70%);
    animation: orb-float 6s ease-in-out infinite;
}
.splash-orb-2 {
    width: 240px; height: 240px; bottom: -60px; left: -60px;
    background: radial-gradient(circle, rgba(26,92,219,0.2) 0%, transparent 70%);
    animation: orb-float 8s ease-in-out infinite reverse;
}
@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(12px, -18px) scale(1.08); }
}
.splash-content {
    display: flex; flex-direction: column; align-items: center;
    gap: 28px; z-index: 1;
    opacity: 0; transform: translateY(30px);
    animation: splash-rise 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}
@keyframes splash-rise { to { opacity: 1; transform: translateY(0); } }
.splash-icon-wrap {
    width: 96px; height: 96px;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 28px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 8px rgba(255,255,255,0.05);
    animation: icon-pulse 2.5s ease-in-out 1s infinite;
}
@keyframes icon-pulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 8px rgba(255,255,255,0.05); }
    50%       { box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 16px rgba(255,255,255,0.08); }
}
.splash-icon-wrap svg { width: 52px; height: 52px; stroke: white; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.splash-texts { text-align: center; }
.splash-brand { font-family: 'Poppins', sans-serif; font-size: 32px; font-weight: 800; color: white; letter-spacing: -0.5px; line-height: 1.1; }
.splash-brand span { color: rgba(255,255,255,0.55); font-weight: 400; }
.splash-tagline { font-family: 'Nunito Sans', sans-serif; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.55); letter-spacing: 2px; text-transform: uppercase; margin-top: 8px; }
.splash-loader { display: flex; gap: 8px; margin-top: 8px; }
.splash-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.4); animation: dot-bounce 1.2s ease-in-out infinite; }
.splash-dot:nth-child(2) { animation-delay: 0.2s; }
.splash-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0.8); background: rgba(255,255,255,0.3); }
    40%            { transform: scale(1.2); background: rgba(255,255,255,0.9); }
}

/* ======= LAYOUT ======= */
.app-body {
    padding-top: calc(var(--header-height, 74px));
    padding-bottom: calc(var(--footer-height) + 44px);
}
.main-content {
    padding: 22px 20px;
    animation: fadeUp 0.35s ease-out both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ======= HEADER ======= */
.app-header {
    position: fixed; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: var(--bg-card);
    border-bottom: 1.5px solid var(--border);
    padding: 16px 22px 14px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    box-sizing: border-box;
}
.header-inner { display: flex; align-items: center; gap: 14px; width: 100%; overflow: hidden; }
.logo {
    width: 44px; height: 44px; flex-shrink: 0;
    background: linear-gradient(135deg, #1A5CDB 0%, #4A82F0 100%);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-blue);
}
.logo svg { width: 22px; height: 22px; stroke: white; fill: none; }
.header-text { flex: 1; min-width: 0; overflow: hidden; }
.header-title { font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -0.2px; line-height: 1.2; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name { color: var(--accent); }
.header-subtitle { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-btn {
    width: 38px; height: 38px; flex-shrink: 0;
    background: var(--bg-card2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease;
}
.header-btn:hover { border-color: var(--accent); background: var(--accent-bg); }
.header-btn.back:hover { transform: translateX(-3px); }
.header-btn.gear:hover svg { animation: spin-slow 2s linear infinite; }
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.header-btn svg { width: 16px; height: 16px; stroke: var(--ink-2); fill: none; stroke-width: 2; }

/* ======= FORMS ======= */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-family: 'Poppins', sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-3); margin-bottom: 9px; }
.input-row { display: flex; gap: 10px; }
input[type="text"], input[type="password"], textarea {
    flex: 1; width: 100%;
    background: var(--bg-card); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); padding: 13px 16px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14.5px; color: var(--ink);
    transition: all 0.2s ease; outline: none;
    box-shadow: var(--shadow-sm); font-weight: 500;
}
input[type="text"].mono { font-family: 'Courier New', monospace; letter-spacing: 0.5px; font-size: 14px; }
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 0.7; }
input[readonly] { background: var(--bg-card2); color: var(--ink-2); }

.scan-btn {
    flex-shrink: 0; width: 50px; height: 50px;
    background: linear-gradient(135deg, #1A5CDB 0%, #4A82F0 100%);
    border: none; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease;
    box-shadow: var(--shadow-blue);
}
.scan-btn:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 6px 22px rgba(26,92,219,0.35); }
.scan-btn svg { width: 20px; height: 20px; stroke: white; fill: none; stroke-width: 2; }

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #1A5CDB 0%, #3A7AF0 100%);
    border: none; border-radius: var(--radius-sm); padding: 15px;
    color: white; font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    box-shadow: var(--shadow-blue);
}
.submit-btn:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 26px rgba(26,92,219,0.38); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ======= PILLS / BADGES ======= */
.packet-badge { padding: 4px 11px; border-radius: 100px; font-size: 11px; font-weight: 700; }
.status-waiting   { background: var(--amber-bg);   color: var(--amber); }
.status-delivered { background: var(--success-bg); color: var(--success); }
.status-cancelled { background: var(--danger-bg);  color: var(--danger); }

/* ======= LOADING ======= */
.track-loading { text-align: center; padding: 40px 20px; }
.loading-spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    animation: spin 0.75s linear infinite;
    margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.list-empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.list-empty-icon { font-size: 38px; margin-bottom: 12px; }

/* ======= MODAL BASE ======= */
.modal-base {
    position: fixed; inset: 0;
    background: rgba(13,27,62,0.42);
    backdrop-filter: blur(7px);
    z-index: 900;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px calc(var(--footer-height) + 16px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-base.active { opacity: 1; pointer-events: auto; }
.modal-sheet {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 420px;
    max-height: 100%;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.96) translateY(12px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-base.active .modal-sheet { transform: scale(1) translateY(0); }
.modal-header-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1.5px solid var(--border);
}
.modal-header-title { font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 700; color: var(--ink); }
.modal-header-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; font-weight: 500; }
.close-x {
    width: 32px; height: 32px;
    background: var(--bg-card2); border: 1.5px solid var(--border);
    border-radius: 9px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.close-x:hover { border-color: var(--accent); background: var(--accent-bg); transform: rotate(90deg); }
.close-x svg { width: 14px; height: 14px; stroke: var(--ink-2); fill: none; stroke-width: 2.5; }
.modal-close-x {
    background: var(--bg-card2); border: 1.5px solid var(--border);
    border-radius: 9px; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px; color: var(--ink-2);
    transition: all 0.2s; flex-shrink: 0;
}
.modal-close-x:hover { border-color: var(--accent); color: var(--accent); }

/* ======= SCANNER ======= */
.scanner-fullscreen {
    position: fixed; inset: 0;
    background: rgba(13,27,62,0.97);
    z-index: 1000;
    display: flex; flex-direction: column;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.scanner-fullscreen.active { opacity: 1; pointer-events: all; }
.scanner-header { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.1); }
.scanner-title { font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 600; color: #F0F4FA; }
.scanner-close {
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.scanner-close:hover { background: rgba(255,255,255,0.15); transform: rotate(90deg); }
.scanner-close svg { width: 16px; height: 16px; stroke: white; fill: none; }
.scanner-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
#reader { width: 100%; max-width: 340px; border-radius: var(--radius-md); overflow: hidden; }
.scanner-hint { margin-top: 20px; text-align: center; color: rgba(240,244,250,0.6); font-size: 13px; line-height: 1.6; font-weight: 500; }

/* ======= LOGIN ======= */
.login-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #1A5CDB 0%, #4A82F0 100%);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    box-shadow: var(--shadow-blue);
}
.login-logo svg { width: 26px; height: 26px; stroke: white; fill: none; }
.login-title { font-family: 'Poppins', sans-serif; font-size: 21px; font-weight: 700; text-align: center; color: var(--ink); margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--ink-3); font-size: 13px; margin-bottom: 26px; font-weight: 500; }
.login-field { margin-bottom: 16px; }
.login-label { display: block; font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.login-input {
    width: 100%; padding: 13px 15px;
    background: var(--bg-card2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--ink);
    font-size: 14px; font-family: 'Nunito Sans', sans-serif; font-weight: 500;
    transition: all 0.2s; outline: none;
}
.login-input:focus { border-color: var(--accent); background: white; box-shadow: 0 0 0 3px var(--accent-glow); }
.login-input::placeholder { color: var(--ink-3); }
.login-submit {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, #1A5CDB 0%, #3A7AF0 100%);
    color: white; border: none; border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    box-shadow: var(--shadow-blue);
}
.login-submit:hover { opacity: 0.9; transform: translateY(-2px); }
.login-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ======= MODAL ENTREGA ======= */
.entrega-form { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.entrega-field-label { display: block; font-family: 'Poppins', sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-3); margin-bottom: 9px; }
.entrega-input {
    width: 100%; background: var(--bg-card); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 15px;
    font-family: 'Nunito Sans', sans-serif; font-size: 14px; color: var(--ink);
    transition: all 0.2s; outline: none; font-weight: 500;
}
.entrega-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.entrega-input.mono { font-family: 'Courier New', monospace; font-size: 13px; font-weight: 700; }
.tipo-recebedor-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tipo-btn {
    padding: 10px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-card2);
    font-family: 'Poppins', sans-serif; font-size: 12.5px; font-weight: 600;
    color: var(--ink-2); cursor: pointer; transition: all 0.18s; text-align: center;
}
.tipo-btn.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.afinidade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.afinidade-btn {
    padding: 8px 6px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-card2);
    font-family: 'Poppins', sans-serif; font-size: 11.5px; font-weight: 600;
    color: var(--ink-2); cursor: pointer; transition: all 0.18s; text-align: center;
}
.afinidade-btn.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.entrega-actions { display: flex; gap: 10px; padding: 0 20px 20px; }
.entrega-cancel-btn {
    flex: 1; padding: 13px; background: var(--bg-card2);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600;
    color: var(--ink-2); cursor: pointer; transition: all 0.2s;
}
.entrega-cancel-btn:hover { border-color: var(--border-dark); }
.entrega-confirm-btn {
    flex: 2; padding: 13px;
    background: linear-gradient(135deg, #3B82F6, #60A5FA);
    border: none; border-radius: var(--radius-sm);
    color: white; font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(59,130,246,0.3);
}
.entrega-confirm-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.entrega-confirm-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ======= FOTO UPLOAD ======= */
.foto-upload-area {
    border: 2px dashed var(--border-dark); border-radius: var(--radius-sm);
    padding: 22px 16px; text-align: center; cursor: pointer;
    background: var(--bg-card2); transition: border-color .2s, background .2s;
    position: relative;
}
.foto-upload-area:hover { border-color: var(--accent); background: var(--accent-bg); }
.foto-upload-area input[type=file] { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.foto-upload-icon svg { width:32px; height:32px; stroke: var(--ink-3); fill:none; stroke-width:1.5; }
.foto-upload-label { font-size:13.5px; font-weight:600; color:var(--ink-2); margin-top:8px; }
.foto-upload-hint { font-size:11.5px; color:var(--ink-3); margin-top:3px; }
.foto-preview-img { width:100%; max-height:160px; object-fit:cover; border-radius:var(--radius-sm); border:1.5px solid var(--border); margin-top:8px; }
.foto-placeholder { display:flex; flex-direction:column; align-items:center; }
.foto-placeholder svg { width:36px; height:36px; stroke: var(--ink-3); fill:none; stroke-width:1.5; }
.foto-placeholder span { font-size:13.5px; font-weight:600; color:var(--ink-2); margin-top:8px; }
.foto-remove-btn {
    position:absolute; top:8px; right:8px;
    background:rgba(0,0,0,.5); border:none; border-radius:50%;
    width:26px; height:26px; color:white; cursor:pointer;
    display:flex; align-items:center; justify-content:center; font-size:13px;
}

/* ======= DETALHE ENTREGA ======= */
.detalhe-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detalhe-field-label { font-family: 'Poppins', sans-serif; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--ink-3); margin-bottom: 4px; }
.detalhe-field-value { font-size: 14px; font-weight: 600; color: var(--ink); }
.ver-foto-btn {
    display: inline-flex; align-items: center; gap: 10px;
    width: 100%; padding: 13px 17px;
    background: var(--bg-card2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--ink-2);
    font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.ver-foto-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); transform: translateY(-1px); }
.ver-foto-btn svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; fill: none; }

/* ======= LIGHTBOX ======= */
.lightbox-overlay {
    position: fixed; inset: 0;
    background: rgba(13,27,62,0.95); z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.lightbox-overlay.active { opacity: 1; pointer-events: auto; }
.lightbox-overlay img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); object-fit: contain; }
.lightbox-close {
    position: absolute; top: 20px; right: 20px;
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.12); border: none; border-radius: 50%;
    color: white; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* ======= TOAST ======= */
.toast {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%) translateY(-130px);
    padding: 12px 22px; border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 14px; font-weight: 500;
    z-index: 2000; transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 90%; white-space: nowrap;
    box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); color: white; }
.toast.error   { background: var(--danger);  color: white; }

/* ======= FOOTER ======= */
.fixed-footer {
    position: fixed; bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: var(--bg-card); border-top: 1.5px solid var(--border);
    z-index: 400; padding: 10px 22px 12px;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    box-shadow: 0 -4px 20px rgba(13,27,62,0.07);
}
.fixed-copyright { font-family: 'Nunito Sans', sans-serif; font-size: 10.5px; color: var(--ink-3); font-weight: 500; }

/* ======= SECTION LABEL ======= */
.section-label {
    font-family: 'Poppins', sans-serif;
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.4px;
    color: var(--ink-3); margin-bottom: 14px;
}
.divider { height: 1.5px; background: var(--border); margin: 20px 0; border: none; }

/* ======= RELATÓRIO ======= */
.rel-btn {
    display: flex; align-items: center; gap: 14px;
    width: 100%; padding: 16px 18px;
    border: 1.5px solid; border-radius: var(--radius-md);
    cursor: pointer; transition: all 0.2s;
    font-family: 'Poppins', sans-serif; font-size: 13.5px;
    text-align: left;
}
.rel-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.rel-btn:hover { transform: translateY(-2px); }
.rel-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.rel-btn-blue  { background: var(--accent-bg); border-color: rgba(26,92,219,0.25); color: var(--accent); }
.rel-btn-blue svg { stroke: var(--accent); }
.rel-btn-blue:hover { background: #dce8fd; box-shadow: 0 4px 14px rgba(26,92,219,0.18); }
.rel-btn-green { background: #f0fdf4; border-color: rgba(22,163,74,0.25); color: #16a34a; }
.rel-btn-green svg { stroke: #16a34a; }
.rel-btn-green:hover { background: #dcfce7; box-shadow: 0 4px 14px rgba(22,163,74,0.18); }
.rel-btn-gray  { background: var(--bg-card2); border-color: var(--border); color: var(--ink-2); }
.rel-btn-gray svg { stroke: var(--ink-2); }
.rel-btn-gray:hover { background: var(--bg-card); box-shadow: var(--shadow-md); }

/* ======= MODAL RASTREAMENTO JORNADA ======= */
.track-modal-header {
    position: relative; padding: 24px 48px 18px 22px;
    border-bottom: 1.5px solid var(--border);
    background: linear-gradient(135deg, #1A5CDB 0%, #3A7AF0 100%);
}
.track-modal-code { font-family: 'Courier New', monospace; font-size: 13.5px; font-weight: 700; color: rgba(255,255,255,0.85); letter-spacing: 0.5px; margin-bottom: 5px; }
.track-modal-name { font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 700; color: white; line-height: 1.2; }
.track-modal-header .close-x { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.25); }
.track-modal-header .close-x svg { stroke: white; }
.track-modal-journey { display: flex; align-items: center; padding: 18px 20px; background: var(--bg-card2); border-bottom: 1.5px solid var(--border); gap: 0; }
.tmj-step { display: flex; align-items: center; gap: 10px; flex: 1; }
.tmj-icon { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); background: var(--bg-card); transition: all 0.3s; }
.tmj-icon svg { width: 14px; height: 14px; }
.tmj-done .tmj-icon { background: linear-gradient(135deg, #1A5CDB, #4A82F0); border-color: var(--accent); box-shadow: 0 3px 10px rgba(26,92,219,0.3); }
.tmj-done .tmj-icon svg { stroke: white; }
.tmj-pending .tmj-icon { background: var(--bg-card2); border-color: var(--border); }
.tmj-pending .tmj-icon svg { stroke: var(--ink-3); }
.tmj-label { font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.tmj-pending .tmj-label { color: var(--ink-3); }
.tmj-date { font-size: 10.5px; color: var(--ink-3); font-weight: 500; margin-top: 2px; line-height: 1.3; }
.tmj-done .tmj-date { color: var(--accent); }
.tmj-line { flex: 1; height: 2px; background: var(--border); margin: 0 10px; border-radius: 2px; transition: background 0.3s; }
.tmj-line-done { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.track-divider-label { font-family: 'Poppins', sans-serif; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--ink-3); padding: 4px 0 10px; border-top: 1.5px solid var(--border); margin-top: 4px; }
.track-body { padding: 20px; }
.track-field { margin-bottom: 16px; }
.track-field-label { font-family: 'Poppins', sans-serif; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--ink-3); margin-bottom: 4px; }
.track-field-value { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.track-field-value.small { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.track-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.track-action-btn {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, #3B82F6, #60A5FA);
    border: none; border-radius: var(--radius-sm);
    color: white; font-family: 'Poppins', sans-serif;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(59,130,246,0.3);
    margin-top: 4px;
}
.track-action-btn:hover { opacity: 0.92; transform: translateY(-1px); }
.track-close-btn {
    width: 100%; padding: 12px;
    background: var(--bg-card2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--ink-2);
    font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}

/* ======= SIDEBAR DESKTOP ======= */
/* Sidebar oculta no mobile — só aparece a partir de 860px */
.dt-sidebar { display: none; }

@media (min-width: 860px) {
    .dt-sidebar {
        position: fixed; top: 0; left: 0;
        width: 256px; height: 100vh;
        background: var(--bg-card);
        border-right: 1.5px solid var(--border);
        display: flex; flex-direction: column;
        z-index: 200;
        box-shadow: var(--shadow-md);
    }
    .dt-sidebar-brand {
        display: flex; align-items: center; gap: 12px;
        padding: 20px 18px 16px;
        border-bottom: 1.5px solid var(--border);
    }
    .dt-sidebar-logo {
        width: 38px; height: 38px; flex-shrink: 0;
        background: linear-gradient(135deg, #1A5CDB 0%, #4A82F0 100%);
        border-radius: 10px;
        display: flex; align-items: center; justify-content: center;
        box-shadow: var(--shadow-blue);
    }
    .dt-sidebar-logo svg { width: 20px; height: 20px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .dt-sidebar-title { font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.2; }
    .dt-sidebar-title span { color: var(--accent); }
    .dt-sidebar-sub { font-size: 10.5px; color: var(--ink-3); font-weight: 500; margin-top: 1px; }
    .dt-sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
    .dt-nav-label { font-family: 'Poppins', sans-serif; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--ink-3); padding: 8px 8px 4px; }
    .dt-nav-item {
        display: flex; align-items: center; gap: 10px;
        padding: 10px 12px; border-radius: var(--radius-sm);
        font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 500;
        color: var(--ink-2); cursor: pointer;
        transition: all 0.15s ease;
        border: 1.5px solid transparent;
    }
    .dt-nav-item:hover { background: var(--bg-card2); color: var(--ink); border-color: var(--border); }
    .dt-nav-item.dt-active { background: var(--accent-bg); color: var(--accent); border-color: rgba(26,92,219,0.18); font-weight: 600; }
    .dt-nav-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
    .dt-sidebar-footer { padding: 14px 16px; border-top: 1.5px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
    .dt-user-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-card2); border-radius: var(--radius-sm); border: 1.5px solid var(--border); }
    .dt-user-avatar { width: 32px; height: 32px; background: linear-gradient(135deg, #1A5CDB, #4A82F0); border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 700; color: white; }
    .dt-user-name { font-family: 'Poppins', sans-serif; font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
    .dt-user-role { font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
    .dt-btn-logout { display: flex; align-items: center; gap: 8px; padding: 9px 13px; background: var(--danger-bg); border: 1.5px solid rgba(192,57,43,0.18); border-radius: var(--radius-sm); color: var(--danger); font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
    .dt-btn-logout:hover { opacity: 0.85; }
    .dt-btn-logout svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .dt-btn-login { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 13px; background: linear-gradient(135deg, #1A5CDB, #3A7AF0); border: none; border-radius: var(--radius-sm); color: white; font-family: 'Poppins', sans-serif; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-blue); }
    .dt-btn-login:hover { opacity: 0.9; transform: translateY(-1px); }
    .dt-btn-login svg { width: 15px; height: 15px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

    #app { max-width: none; margin-left: 256px; min-height: 100vh; display: flex; flex-direction: column; }
    .app-header { left: 256px !important; width: calc(100% - 256px) !important; max-width: none !important; transform: none !important; padding: 14px 32px 12px; }
    .app-header .logo, .app-header .header-btn.login { display: none !important; }
    .fixed-footer { display: none !important; }
    .dt-footer { display: flex !important; align-items: center; justify-content: space-between; padding: 18px 32px; border-top: 1.5px solid var(--border); background: var(--bg-card); margin-top: auto; }
    .app-body { flex: 1; display: flex; flex-direction: column; padding-bottom: 0; }
    .main-content { padding: 28px 32px; max-width: 1280px; margin: 0 auto; width: 100%; flex: 1; }
    .cards-grid { grid-template-columns: repeat(4, 1fr); }
    .stats-row { gap: 20px; }
    .stat-number { font-size: 40px; }
    .features-grid { grid-template-columns: repeat(4, 1fr) !important; }
    .welcome-card { padding: 32px 30px; }
    .dt-packet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .dt-packet-grid .packet-item { margin-bottom: 0; }
    .dt-agend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .dt-agend-grid .agend-item { margin-bottom: 0; }
    .modal-sheet { max-width: 540px; }
}
@media (min-width: 1280px) {
    .dt-sidebar { width: 272px; }
    #app { margin-left: 272px; }
    .app-header { left: 272px !important; width: calc(100% - 272px) !important; }
    .main-content { padding: 25px 25px; }
}
@media (max-width: 400px) {
    .app-header { padding: 14px 16px; }
    .main-content { padding: 16px 15px; }
}