/* RegistaR — Folha de estilos */
/* Fundação Cultursintra FP */

/* --- Reset e base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue-50:  #E6F1FB; --blue-100: #B5D4F4; --blue-400: #378ADD;
    --blue-600: #185FA5; --blue-800: #0C447C; --blue-900: #042C53;
    --red-50:   #FCEBEB; --red-100:  #F7C1C1; --red-400:  #E24B4A;
    --red-600:  #A32D2D; --red-800:  #791F1F;
    --amber-50: #FAEEDA; --amber-100:#FAC775; --amber-600:#854F0B;
    --green-50: #EAF3DE; --green-100:#C0DD97; --green-600:#3B6D11;
    --purple-50:#EEEDFE; --purple-100:#CECBF6; --purple-600:#3C3489;
    --gray-50:  #F1EFE8; --gray-100: #D3D1C7; --gray-600: #5F5E5A;
    --radius-md: 8px; --radius-lg: 12px;
    --sidebar-w: 220px;
}

html, body { height: 100%; font-family: system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.5; color: #1a1a1a; background: #f5f4f0; }

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout principal --- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--blue-900); display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto;
    z-index: 100;
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1; display: flex; flex-direction: column; min-width: 0;
    padding-bottom: 0;
}

/* --- Sidebar --- */
.sidebar-brand { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand-title { font-size: 16px; font-weight: 600; color: white; }
.sidebar-brand-sub { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 2px; }

.sidebar-user { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: white; flex-shrink: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: white; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.6); }

.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-section { font-size: 10px; color: rgba(255,255,255,0.4); padding: 12px 16px 4px; letter-spacing: 0.06em; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 13px; color: rgba(255,255,255,0.7); cursor: pointer; text-decoration: none; transition: background 0.15s; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,0.14); color: white; }
.nav-item i { font-size: 18px; flex-shrink: 0; }

.sidebar-footer { padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.1); }

/* --- Topbar --- */
.topbar { background: white; padding: 12px 24px; border-bottom: 1px solid #e5e5e5; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-title { font-size: 18px; font-weight: 500; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Conteúdo --- */
.content { padding: 20px 24px; flex: 1; }

/* --- Cards e painéis --- */
.card { background: white; border: 1px solid #e5e5e5; border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 16px; }
.card-title { font-size: 13px; color: #888; letter-spacing: 0.04em; margin-bottom: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #f5f4f0; border-radius: var(--radius-md); padding: 14px 16px; }
.stat-num { font-size: 28px; font-weight: 500; }
.stat-lbl { font-size: 12px; color: #888; margin-top: 4px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* --- Tabelas --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { background: #f5f4f0; padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 500; color: #666; border-bottom: 1px solid #e5e5e5; }
tbody td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }

/* --- Formulários --- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-label .req { color: var(--red-600); }
.form-control { width: 100%; border: 1px solid #ddd; border-radius: var(--radius-md); padding: 9px 12px; font-size: 14px; font-family: inherit; background: white; transition: border-color 0.15s; }
.form-control:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-50); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.level-select { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.level-btn { border: 2px solid #ddd; border-radius: var(--radius-md); padding: 12px; text-align: center; cursor: pointer; font-size: 14px; font-weight: 500; background: white; transition: all 0.15s; }
.level-btn.warn:hover, .level-btn.warn.selected { border-color: var(--amber-600); background: var(--amber-50); color: var(--amber-600); }
.level-btn.danger:hover, .level-btn.danger.selected { border-color: var(--red-600); background: var(--red-50); color: var(--red-600); }

/* --- Botões --- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; font-size: 14px; font-weight: 500; border-radius: var(--radius-md); border: 1px solid; cursor: pointer; text-decoration: none; font-family: inherit; transition: all 0.15s; }
.btn:hover { text-decoration: none; filter: brightness(0.95); }
.btn-primary   { background: var(--blue-600);   color: white;              border-color: var(--blue-600); }
.btn-danger    { background: var(--red-50);      color: var(--red-600);     border-color: var(--red-100); }
.btn-warn      { background: var(--amber-50);    color: var(--amber-600);   border-color: var(--amber-100); }
.btn-purple    { background: var(--purple-50);   color: var(--purple-600);  border-color: var(--purple-100); }
.btn-ok        { background: var(--green-50);    color: var(--green-600);   border-color: var(--green-100); }
.btn-outline   { background: white;              color: #444;               border-color: #ddd; }
.btn-sm        { padding: 5px 12px; font-size: 12px; }
.btn-full      { width: 100%; justify-content: center; }

/* --- Badges --- */
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 20px; }
.badge-warn    { background: var(--amber-50);  color: var(--amber-600); }
.badge-danger  { background: var(--red-50);    color: var(--red-600); }
.badge-prov    { background: var(--blue-50);   color: var(--blue-600); }
.badge-ok      { background: var(--green-50);  color: var(--green-600); }
.badge-purple  { background: var(--purple-50); color: var(--purple-600); }
.badge-neutral { background: var(--gray-50);   color: var(--gray-600); }

/* --- Alertas --- */
.alert { border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.alert i { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.alert-info    { background: var(--blue-50);   color: var(--blue-800); }
.alert-danger  { background: var(--red-50);    color: var(--red-800); }
.alert-warn    { background: var(--amber-50);  color: var(--amber-600); }
.alert-ok      { background: var(--green-50);  color: var(--green-600); }

/* --- Timeline --- */
.timeline { padding: 4px 0; }
.tl-item { display: flex; gap: 12px; margin-bottom: 14px; }
.tl-marker { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; }
.tl-dot-red    { background: var(--red-400); }
.tl-dot-warn   { background: #EF9F27; }
.tl-dot-ok     { background: #639922; }
.tl-dot-purple { background: #7F77DD; }
.tl-line { flex: 1; width: 1px; background: #e5e5e5; margin-top: 4px; }
.tl-date { font-size: 12px; color: #888; }
.tl-desc { font-size: 14px; color: #1a1a1a; margin-top: 2px; }

/* --- Interdição pendente --- */
.pending-item { border-left: 3px solid var(--red-400); padding: 10px 14px; background: #fafafa; margin-bottom: 8px; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.pending-item:last-child { margin-bottom: 0; }
.lift-item { border-left: 3px solid var(--red-600); padding: 10px 14px; background: var(--red-50); margin-bottom: 8px; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.lift-item:last-child { margin-bottom: 0; }
.item-name { font-size: 14px; font-weight: 500; color: #1a1a1a; }
.item-sub  { font-size: 12px; color: #888; margin: 2px 0 8px; }
.item-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Guia row --- */
.guia-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; cursor: pointer; text-decoration: none; color: inherit; }
.guia-row:last-child { border-bottom: none; }
.guia-row:hover { background: #fafafa; text-decoration: none; color: inherit; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.avatar-red    { background: var(--red-50);    color: var(--red-600); }
.avatar-blue   { background: var(--blue-50);   color: var(--blue-600); }
.avatar-gray   { background: var(--gray-50);   color: var(--gray-600); }
.guia-name { font-size: 14px; font-weight: 500; }
.guia-sub  { font-size: 12px; color: #888; margin-top: 2px; }
.guia-meta { font-size: 11px; color: #aaa; margin-top: 1px; }

/* --- Modal --- */
.modal-backdrop { background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; padding: 20px; min-height: 100vh; }
.modal { background: white; border-radius: var(--radius-lg); border: 1px solid #e5e5e5; padding: 24px; max-width: 480px; width: 100%; }
.modal-title { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: #888; margin-bottom: 16px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* --- Login --- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--blue-900); padding: 20px; }
.login-card { background: white; border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo-title { font-size: 24px; font-weight: 700; color: var(--blue-600); }
.login-logo-sub { font-size: 13px; color: #888; margin-top: 4px; }

/* --- Flash messages --- */
.flash { border-radius: var(--radius-md); padding: 12px 16px; font-size: 14px; margin-bottom: 16px; }
.flash-ok      { background: var(--green-50);  color: var(--green-600);  border: 1px solid var(--green-100); }
.flash-erro    { background: var(--red-50);    color: var(--red-600);    border: 1px solid var(--red-100); }
.flash-aviso   { background: var(--amber-50);  color: var(--amber-600);  border: 1px solid var(--amber-100); }

/* --- Mobile nav --- */
.mobile-nav { display: none; }

/* --- Responsivo mobile --- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding-bottom: 70px; }
    .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid #e5e5e5; z-index: 100; }
    .mobile-nav-item { flex: 1; padding: 10px 4px 8px; text-align: center; font-size: 10px; color: #888; text-decoration: none; display: flex; flex-direction: column; align-items: center; }
    .mobile-nav-item i { font-size: 22px; display: block; margin-bottom: 2px; }
    .mobile-nav-item.active { color: var(--blue-600); }
    .two-col { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 14px 16px; }
    .topbar { padding: 12px 16px; }
    .modal { margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .level-select { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .topbar-actions .btn span { display: none; }
}
