* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }
body { background: #f1f5f9; color: #0f172a; }
.hidden { display: none !important; }

/* Login */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 32px; width: 100%; max-width: 420px; box-shadow: 0 10px 25px rgba(15,23,42,.08); }
.login-logos { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-logos img { max-height: 40px; max-width: 48%; width: auto; height: auto; object-fit: contain; }
.login-card h1 { font-size: 1.25rem; color: #0f172a; text-align: center; }
.subtitle { font-size: .85rem; color: #0369a1; text-align: center; margin: 4px 0 20px; }

/* Inputs & Buttons */
label { display: flex; flex-direction: column; font-size: .82rem; font-weight: 600; color: #334155; gap: 4px; margin-bottom: 10px; }
input, select, textarea { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .9rem; background: #fff; color: #0f172a; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #0369a1; box-shadow: 0 0 0 2px rgba(3,105,161,.15); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: #f8fafc; color: #475569; }

.btn { padding: 8px 14px; border: none; border-radius: 6px; font-size: .85rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: .15s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: .8rem; }
.btn-xs { padding: 4px 8px; font-size: .75rem; }
.btn-primary { background: #0369a1; color: #fff; } .btn-primary:hover:not(:disabled) { background: #0284c7; }
.btn-ok { background: #15803d; color: #fff; } .btn-ok:hover:not(:disabled) { background: #16a34a; }
.btn-warn { background: #b45309; color: #fff; } .btn-warn:hover:not(:disabled) { background: #d97706; }
.btn-danger { background: #dc2626; color: #fff; } .btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-dark { background: #1e293b; color: #fff; } .btn-dark:hover:not(:disabled) { background: #334155; }
.btn-secondary { background: #e2e8f0; color: #0f172a; } .btn-secondary:hover:not(:disabled) { background: #cbd5e1; }

/* Topbar */
.topbar { background: #fff; border-bottom: 3px solid #38bdf8; padding: 10px 18px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-top { max-height: 40px; }
.topbar-title { font-weight: 800; font-size: 1.1rem; color: #0f172a; }
.topbar-sub { font-size: .8rem; color: #0369a1; }
.user-badge { background: #e2e8f0; padding: 5px 10px; border-radius: 20px; font-size: .8rem; font-weight: 600; }

/* Workspace */
.workspace { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 66px); }
@media (max-width: 900px) { .workspace { grid-template-columns: 1fr; } }

.sidebar { background: #fff; border-right: 1px solid #cbd5e1; display: flex; flex-direction: column; }
.sidebar-header { background: #1e293b; color: #fff; font-weight: 700; font-size: .85rem; padding: 10px 12px; text-align: center; }
.sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
.sidebar-search { padding: 0 8px 8px; }
.rdo-list { flex: 1; overflow-y: auto; max-height: calc(100vh - 230px); padding: 0 8px; display: flex; flex-direction: column; gap: 4px; }
.rdo-item { padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 6px; cursor: pointer; font-size: .82rem; display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
.rdo-item:hover { border-color: #0369a1; }
.rdo-item.active { background: #0369a1; color: #fff; border-color: #0369a1; font-weight: 600; }
.sidebar-footer { padding: 8px; border-top: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 6px; }

.content { padding: 14px 18px; overflow-x: auto; }
.action-bar { background: #e2e8f0; padding: 10px 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.action-left, .action-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sync-badge { font-size: .8rem; font-weight: 700; color: #15803d; padding: 4px 8px; }
.sync-badge.dirty { color: #dc2626; }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi-card { background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 12px; }
.kpi-label { font-size: .7rem; font-weight: 700; color: #64748b; }
.kpi-val { font-size: 1rem; font-weight: 800; color: #0f172a; margin-top: 2px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #cbd5e1; margin-bottom: 12px; flex-wrap: wrap; }
.tab-btn { padding: 9px 14px; border: none; background: #e2e8f0; color: #334155; font-weight: 700; font-size: .83rem; border-radius: 6px 6px 0 0; cursor: pointer; }
.tab-btn.active { background: #fff; color: #0369a1; border: 1px solid #cbd5e1; border-bottom: 2px solid #fff; margin-bottom: -2px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Cards & Grids */
.card { background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.card h3 { font-size: .95rem; color: #0369a1; margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.card-head h3 { margin-bottom: 0; }
.form-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.data-table th { background: #1e293b; color: #fff; padding: 7px 8px; text-align: left; font-weight: 600; }
.data-table td { border-bottom: 1px solid #e2e8f0; padding: 5px 6px; }
.data-table tr.presente td { background: #f0fdf4; }
.data-table input, .data-table select { padding: 4px 6px; font-size: .82rem; }
.table-foot { margin-top: 8px; font-size: .8rem; font-weight: 600; color: #475569; }
.toolbar-inline { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* Assinaturas & Fotos */
.ass-box { background: #f8fafc; font-size: .85rem; line-height: 1.6; }
.ass-ok { color: #15803d; font-weight: 700; }
.ass-wait { color: #b45309; font-weight: 600; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.foto-card { background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.foto-card img { width: 100%; height: 190px; object-fit: cover; border-radius: 6px; background: #e2e8f0; }

/* Users Panel */
.users-panel { padding: 18px; max-width: 1100px; margin: 0 auto; }

/* Modal & Toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-box { background: #fff; border-radius: 10px; padding: 20px; width: 100%; max-width: 440px; }
.modal-box h3 { margin-bottom: 12px; color: #0f172a; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.alert-error { background: #fee2e2; color: #b91c1c; padding: 8px 10px; border-radius: 6px; font-size: .83rem; margin-bottom: 10px; }
.toast { position: fixed; bottom: 18px; right: 18px; background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: .85rem; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
