* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: sans-serif; background: #f5f5f5; color: #333; }
header { background: #1a1a2e; color: #fff; padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; }
header .header-brand { display: flex; align-items: center; gap: 1rem; }
header .logo { height: 60px; width: auto; border-radius: 6px; }
header .company-name { font-size: 1.2rem; font-weight: 600; letter-spacing: 0.05em; color: #fff; }
header nav a { color: #fff; text-decoration: none; }
main { padding: 0; }

/* Dashboard layout */
.dashboard-layout { display: flex; min-height: calc(100vh - 78px); }
.sidebar { width: 220px; background: #1a1a2e; color: #fff; padding: 1.5rem 0; flex-shrink: 0; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav ul li a, .sidebar-module { display: block; padding: 0.65rem 1.25rem; color: #c5d0e0; text-decoration: none; font-size: 0.95rem; border-left: 3px solid transparent; transition: background 0.15s; }
.sidebar-module { cursor: default; }
.sidebar-nav ul li a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-nav ul li a.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: #4a9eff; }
.sidebar-submenu { display: none; list-style: none; }
.sidebar-submenu.open { display: block; }
.sidebar-submenu li a { padding: 0.5rem 1.25rem 0.5rem 3.25rem; font-size: 0.88rem; color: #a0b0c8; border-left: 3px solid transparent; }
.sidebar-submenu li a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-submenu li a.active { color: #fff; border-left-color: #4a9eff; background: rgba(255,255,255,0.08); }
.dashboard-content { flex: 1; padding: 2rem; background: #f5f5f5; }

.card { background: #fff; border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
.card h3 { color: #1a1a2e; margin-bottom: 1rem; }
.card p { margin-bottom: 0.4rem; }
.card-section { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #e8e8e8; }
.card-section strong { display: block; margin-bottom: 0.6rem; color: #1a1a2e; }
.user-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.user-table th { text-align: left; padding: 0.5rem 0.75rem; background: #f0f2f5; color: #555; font-weight: 600; }
.user-table td { padding: 0.5rem 0.75rem; border-top: 1px solid #eee; }
.user-table tr:hover td { background: #fafafa; }

.login-container { max-width: 400px; margin: 3rem auto; background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.login-container h2 { margin-bottom: 1.5rem; color: #1a1a2e; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.6rem 0.8rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #1a1a2e; }
.form-error { color: #c0392b; margin-bottom: 1rem; font-size: 0.9rem; }
button[type="submit"] { width: 100%; padding: 0.75rem; background: #1a1a2e; color: #fff; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; margin-top: 0.5rem; }
button[type="submit"]:hover { background: #2d2d5e; }

/* Header nav (usuário + logout) */
.header-nav { display: flex; align-items: center; gap: 1.25rem; }
.header-nav a { color: #c5d0e0; font-size: 0.9rem; }
.header-nav a:hover { color: #fff; }
.header-nav .header-user { color: #fff; font-size: 0.9rem; font-weight: 600; }
.logout-form { margin: 0; }
.header-nav .logout-form button { width: auto; margin: 0; padding: 0.4rem 0.9rem; background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff; border-radius: 4px; font-size: 0.85rem; cursor: pointer; }
.header-nav .logout-form button:hover { background: rgba(255,255,255,0.12); }

/* Login: logo no card */
.login-logo { display: block; height: 64px; width: auto; border-radius: 8px; margin: 0 auto 1rem; }
.login-container h2 { text-align: center; }

/* Landing pública */
.landing { max-width: 720px; margin: 4rem auto; text-align: center; padding: 0 1.5rem; }
.landing-logo { height: 96px; width: auto; border-radius: 10px; margin-bottom: 1.5rem; }
.landing h1 { color: #1a1a2e; font-size: 2rem; margin-bottom: 0.75rem; letter-spacing: 0.03em; }
.landing p { color: #555; font-size: 1.05rem; margin-bottom: 2rem; line-height: 1.5; }
.btn-primary { display: inline-block; padding: 0.75rem 2rem; background: #1a1a2e; color: #fff; text-decoration: none; border-radius: 6px; font-size: 1rem; transition: background 0.15s; }
.btn-primary:hover { background: #2d2d5e; }

/* Avisos */
.alert-warning { background: #fff8e1; border: 1px solid #ffe082; color: #8a6d3b; padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.25rem; font-size: 0.92rem; }
.alert-success { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.25rem; font-size: 0.92rem; }
.alert-error { background: #fdecea; border: 1px solid #f5c6cb; color: #c0392b; padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.25rem; font-size: 0.92rem; }

/* Botão "Testar Conexão" (secundário) */
.testar-form { margin-top: 1rem; }
.testar-form .btn-test { width: auto; margin: 0; padding: 0.6rem 1.2rem; background: #417690; color: #fff; border: none; border-radius: 4px; font-size: 0.95rem; cursor: pointer; }
.testar-form .btn-test:hover { background: #345d73; }

/* Modal de confirmação */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 8px; padding: 1.5rem; width: 420px; max-width: 95vw; box-shadow: 0 4px 24px rgba(0,0,0,0.25); }
.btn-cancel { padding: 0.5rem 1.1rem; background: #ccc; color: #333; border: none; border-radius: 4px; font-size: 0.9rem; cursor: pointer; }
.btn-cancel:hover { background: #bbb; }
.modal-box .btn-danger { width: auto; margin: 0; padding: 0.5rem 1.1rem; background: #c0392b; color: #fff; border: none; border-radius: 4px; font-size: 0.9rem; cursor: pointer; }
.modal-box .btn-danger:hover { background: #a93226; }

/* Menu do usuário (header) — dropdown com empresas */
.user-menu { position: relative; }
.user-menu-toggle { background: transparent; border: none; color: #fff; font-size: 0.9rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0; }
.user-menu-toggle .caret { font-size: 0.7rem; color: #c5d0e0; }
.user-menu-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 0.5rem); min-width: 230px; background: #fff; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,0.22); padding: 0.4rem 0; z-index: 1000; }
.user-menu-dropdown.open { display: block; }
.user-menu-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: #999; padding: 0.4rem 1rem 0.3rem; }
.user-menu-divider { height: 1px; background: #eee; margin: 0.4rem 0; }
.user-menu-dropdown .user-menu-item { display: block; width: 100%; text-align: left; background: transparent; border: none; border-radius: 0; margin: 0; padding: 0.5rem 1rem; font-size: 0.88rem; color: #333; cursor: pointer; }
.user-menu-dropdown .user-menu-item:hover { background: #f0f2f5; }
.user-menu-dropdown .user-menu-item.active { color: #1a1a2e; font-weight: 600; }