:root {
  --bg: #0b1020;
  --panel: #11182d;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eaf0ff;
  --muted: #98a3c7;
  --accent: #6d8bff;
  --accent-2: #8b5cf6;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(109, 139, 255, 0.18), transparent 25%),
    radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.14), transparent 25%),
    linear-gradient(180deg, #090d18 0%, #11182d 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  background: #0d1325;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ffd2d2;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-small {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.w-full {
  width: 100%;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: rgba(17, 24, 45, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.login-hero,
.login-form {
  padding: 52px;
}

.login-hero {
  background: linear-gradient(145deg, rgba(109, 139, 255, 0.16), rgba(139, 92, 246, 0.08));
}

.brand-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.brand-badge.large {
  width: 74px;
  height: 74px;
  font-size: 24px;
}

.login-hero h1 {
  font-size: 40px;
  margin: 18px 0 10px;
}

.login-hero p {
  color: var(--muted);
  line-height: 1.65;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: rgba(10, 14, 25, 0.85);
  border-right: 1px solid var(--line);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  padding: 13px 15px;
  border-radius: 14px;
  color: var(--muted);
  transition: 0.2s ease;
}

.nav-link.active,
.nav-link:hover {
  background: linear-gradient(135deg, rgba(109, 139, 255, 0.16), rgba(139, 92, 246, 0.12));
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-mini {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.user-mini span {
  color: var(--muted);
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.content {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar-user {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card,
.hero-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}

.hero-card p,
.card p {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.stat-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: 34px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-form .full {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.alert.error {
  background: rgba(239, 68, 68, 0.12);
  color: #ffd5d5;
}

.alert.success {
  background: rgba(34, 197, 94, 0.12);
  color: #c9ffd9;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.open,
.badge.active,
.badge.in_progress {
  background: rgba(109, 139, 255, 0.18);
  color: #dbe5ff;
}

.badge.pending,
.badge.review,
.badge.medium {
  background: rgba(245, 158, 11, 0.18);
  color: #ffe6b8;
}

.badge.resolved,
.badge.completed {
  background: rgba(34, 197, 94, 0.18);
  color: #d7ffe3;
}

.badge.high,
.badge.inactive {
  background: rgba(239, 68, 68, 0.18);
  color: #ffd5d5;
}

.badge.low,
.badge.planning {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.progress {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* CHAT */
.chat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header h3 {
  margin: 0;
  font-size: 20px;
}

.chat-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.chat-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.chat-box {
  height: 360px;
  overflow-y: auto;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(7, 11, 20, 0.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message-row {
  display: flex;
  width: 100%;
}

.chat-message-row.mine {
  justify-content: flex-end;
}

.chat-message-row.theirs {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 72%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.chat-bubble.mine {
  background: linear-gradient(135deg, rgba(109, 139, 255, 0.22), rgba(139, 92, 246, 0.22));
  border-bottom-right-radius: 6px;
}

.chat-bubble.theirs {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 6px;
}

.chat-author {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #dbe5ff;
}

.chat-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.chat-time {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: center;
}

.chat-input {
  width: 100%;
  background: #0d1325;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
}

.chat-send-btn {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 600;
  padding: 14px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn:hover {
  opacity: 0.95;
}

.notif-wrap{
position:relative;
}

.notif-icon{
cursor:pointer;
background:#111;
padding:10px 14px;
border-radius:10px;
}

.notif-dropdown{
display:none;
position:absolute;
right:0;
top:40px;
background:#111;
border-radius:10px;
width:280px;
}

.notif-wrap:hover .notif-dropdown{
display:block;
}

.notif-item{
padding:12px;
border-bottom:1px solid #222;
}

.mobile-menu-btn{
  display:none;
  background:none;
  border:0;
  color:white;
  font-size:22px;
  cursor:pointer;
}

@media (max-width:900px){

  .mobile-menu-btn{
    display:block;
  }

  .sidebar{
    position:fixed;
    left:-280px;
    top:0;
    height:100vh;
    z-index:999;
    transition:.3s;
  }

  .sidebar.open{
    left:0;
  }

}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-bubble {
    max-width: 88%;
  }

  .chat-box {
    height: 300px;
  }
}

@media (max-width: 600px) {
  .content,
  .sidebar,
  .login-form,
  .login-hero {
    padding: 18px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================
   TOPO / AÇÕES
========================= */

.mobile-menu-btn{
  display:none !important;
}

.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  position:relative;
}

.topbar-title{
  min-width:0;
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:16px;
  margin-left:auto;
}

/* =========================
   NOTIFICAÇÕES - CORREÇÃO FINAL
========================= */

.mobile-menu-btn{
  display:none !important;
}

.notif-wrap{
  position:relative;
  display:flex;
  align-items:center;
}

.notif-btn{
  position:relative;
  width:48px;
  height:48px;
  border:none;
  outline:none;
  cursor:pointer;
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 24px rgba(0,0,0,0.18);
  border:1px solid rgba(255,255,255,0.10);
  transition:all .25s ease;
}

.notif-btn:hover{
  transform:translateY(-1px);
  background:linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.07));
}

.notif-btn-icon{
  font-size:20px;
  line-height:1;
}

.notif-badge{
  position:absolute;
  top:-5px;
  right:-5px;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 0 3px #0f172a;
}

/* ESCONDE MESMO AO CARREGAR */
.notif-dropdown,
#notifDropdown,
.notif-dropdown[hidden]{
  display:none !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

/* SÓ ABRE QUANDO TIVER ACTIVE E NÃO ESTIVER HIDDEN */
.notif-wrap.active .notif-dropdown:not([hidden]),
.notif-wrap.active #notifDropdown:not([hidden]){
  display:block !important;
  position:absolute;
  top:60px;
  right:0;
  width:360px;
  max-width:calc(100vw - 32px);
  background:rgba(15,23,42,0.97);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:20px;
  overflow:hidden;
  box-shadow:0 24px 60px rgba(0,0,0,0.40);
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:auto !important;
  z-index:9999;
}

.notif-dropdown-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border-bottom:1px solid rgba(255,255,255,0.08);
  background:linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.notif-dropdown-header strong{
  color:#fff;
  font-size:15px;
  font-weight:700;
}

.notif-dropdown-header span{
  color:#a5b4fc;
  font-size:12px;
  font-weight:700;
  background:rgba(99,102,241,0.16);
  padding:6px 10px;
  border-radius:999px;
}

.notif-dropdown-list{
  max-height:360px;
  overflow-y:auto;
}

.notif-item{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:16px 18px;
  border-bottom:1px solid rgba(255,255,255,0.06);
}

.notif-item:last-child{
  border-bottom:none;
}

.notif-item-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:transparent;
  margin-top:6px;
  flex-shrink:0;
}

.notif-item.unread .notif-item-dot{
  background:#8b5cf6;
  box-shadow:0 0 0 4px rgba(139,92,246,0.15);
}

.notif-item-content strong{
  display:block;
  color:#fff;
  font-size:14px;
  font-weight:700;
  margin-bottom:4px;
}

.notif-item-content p{
  margin:0;
  color:#cbd5e1;
  font-size:13px;
  line-height:1.55;
}

.notif-empty{
  padding:24px 18px;
  text-align:center;
  color:#cbd5e1;
  font-size:14px;
}



