:root {
    --bg-color: #071425;
    --card-bg: rgba(15, 29, 54, 0.85);
    --glass-border: rgba(56, 189, 248, 0.2);
    --blue-light: #38bdf8;
    --primary: #0055ff;
    --primary-hover: #0044cc;
    --success: #38ef7d;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, #0f2b4c 0%, #071425 70%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#app {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px 0;
}

.main-logo {
    max-width: 140px;
    height: auto;
    margin-bottom: 10px;
}

header h1 {
    font-size: 1.6rem;
    letter-spacing: 1px;
    color: #ffffff;
    font-weight: 800;
}

#subtitulo {
    font-size: 0.75rem;
    color: var(--blue-light);
    letter-spacing: 2px;
    font-weight: 600;
    margin-top: 4px;
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* Inputs, Selects, Textareas */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    margin-top: 8px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--blue-light);
    background: rgba(255, 255, 255, 0.1);
}

select option {
    background-color: #0b1e36;
    color: #ffffff;
}

label {
    font-size: 0.85rem;
    color: var(--blue-light);
    font-weight: 600;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.btn-bravo {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 85, 255, 0.3);
}

.btn-bravo:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-escuro {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 10px;
    box-shadow: none;
}

.btn-voltar {
    width: 100%;
    padding: 11px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 10px;
    margin-top: 12px;
}

.btn-voltar:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Divisor */
.divisor {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.8rem;
    margin: 18px 0;
}

.divisor::before, .divisor::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.divisor::before { margin-right: .5em; }
.divisor::after { margin-left: .5em; }

/* Grid Botoes Admin */
.grid-botoes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 18px 0;
}

.btn-menu {
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}

.btn-menu:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--blue-light);
}

.btn-export {
    grid-column: span 2;
    border-color: #38ef7d;
    background: rgba(56, 239, 125, 0.08);
    color: #38ef7d;
}

/* Scroll Lista */
.scroll-lista {
    max-height: 380px;
    overflow-y: auto;
    margin-top: 14px;
    margin-bottom: 14px;
    padding-right: 4px;
}

.scroll-lista::-webkit-scrollbar {
    width: 6px;
}
.scroll-lista::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Item Card nas Listas */
.item-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.item-card h4 {
    color: #ffffff;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.item-card p {
    color: var(--text-sub);
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-urgente { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef4444; }
.badge-alto { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid #f59e0b; }
.badge-medio { background: rgba(234, 179, 8, 0.2); color: #eab308; border: 1px solid #eab308; }
.badge-baixo { background: rgba(56, 239, 125, 0.2); color: #38ef7d; border: 1px solid #38ef7d; }

.badge-pendente { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-execucao { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.badge-concluido { background: rgba(56, 239, 125, 0.2); color: #38ef7d; }

/* Grid Prioridades */
.grid-prioridades {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 10px 0 16px;
}

.btn-prioridade {
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
    color: white;
    text-align: center;
}

.btn-prioridade.urgente { background: #dc2626; }
.btn-prioridade.alto { background: #ea580c; }
.btn-prioridade.medio { background: #d97706; }
.btn-prioridade.baixa { background: #16a34a; }
.btn-prioridade.ativo { ring: 3px solid #ffffff; filter: brightness(1.25); border: 2px solid white; }

/* Flex rows */
.row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add {
    padding: 12px 18px;
    background: var(--primary);
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    border-radius: 8px;
    margin-top: 8px;
    margin-bottom: 12px;
}

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.85rem;
}

th, td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    color: var(--blue-light);
    font-weight: 700;
}

#total-container {
    text-align: right;
    font-size: 1.1rem;
    color: var(--success);
    margin: 10px 0;
}

/* Checklist & Execução */
.checklist-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin: 14px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checklist-box label {
    color: var(--text-main);
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Canvas & Fotos */
.canvas-container {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 6px;
}

canvas#canvas-assinatura {
    width: 100%;
    height: 150px;
    touch-action: none;
    display: block;
}

.preview-img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    object-fit: cover;
    margin-top: 8px;
    display: none;
}

/* Modal Overlay & Cards */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal-card {
    background: #0b1e36;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

.modal-card h3 {
    margin-bottom: 14px;
    color: #ffffff;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(7, 20, 37, 0.95);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--blue-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.subtexto {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 4px;
}

/* Botões de Filtro por Status em Checar O.S. */
.row-filtros-os {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.btn-filtro-os {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-sub);
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-filtro-os:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #ffffff;
    border-color: var(--blue-light);
}

.btn-filtro-os.active {
    background: var(--blue-light);
    color: #071425;
    border-color: var(--blue-light);
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.btn-filtro-os.active-aprovado {
    background: #38ef7d;
    color: #071425;
    border-color: #38ef7d;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(56, 239, 125, 0.3);
}

