:root {
  --bg: #f7f9fc;
  --white: #ffffff;
  --blue: #0078d4;
  --blue-dark: #005a9e;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e1e5ea;
  --pos: #1fa34a;
  --neg: #d93025;
  --neu: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f5f7fb 0%, #ffffff 40%);
}

.app {
  min-height: 100vh;
}

.ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ribbon-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-title {
  font-weight: 600;
  font-size: 18px;
}

.ribbon-tabs {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.tab {
  padding: 4px 8px;
  border-radius: 4px;
  background: #eef3fb;
}

.ribbon-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  background: #eef3fb;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.link {
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
}

.logout-form {
  margin: 0;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.btn-light {
  background: #eef3fb;
  color: var(--blue-dark);
  border: 1px solid #d7e3f6;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.body {
  display: grid;
  grid-template-columns: 220px 1fr 180px;
  gap: 16px;
  padding: 16px;
}

.sidebar,
.margin {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  height: fit-content;
}

.sidebar-title,
.margin-title {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 8px;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  font-size: 12px;
  color: var(--muted);
}

.sidebar-list li {
  padding: 4px 0;
}

.tools li {
  padding: 2px 0;
}

.tool-btn {
  width: 100%;
  text-align: left;
  background: #f3f4f6;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}

.tool-btn-active {
  background: #e6f2ff;
  color: var(--blue-dark);
  border-color: #cfe4ff;
}

.tool-btn:hover:not(:disabled) {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.tool-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.tool-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.panel-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.results th,
.results td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.results.compact th,
.results.compact td {
  padding: 6px;
  font-size: 11px;
}

.section-title {
  margin-top: 14px;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  text-transform: capitalize;
  display: inline-block;
}

.badge-positivo {
  background: rgba(31, 163, 74, 0.15);
  color: var(--pos);
}

.badge-neutral {
  background: rgba(107, 114, 128, 0.15);
  color: var(--neu);
}

.badge-negativo {
  background: rgba(217, 48, 37, 0.15);
  color: var(--neg);
}

.tag {
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  caret-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}

.tag:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.tag:active {
  transform: translateY(0);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.tag-pos {
  background: rgba(31, 163, 74, 0.12);
  color: var(--pos);
}

.tag-neu {
  background: rgba(107, 114, 128, 0.12);
  color: var(--neu);
}

.tag-neg {
  background: rgba(217, 48, 37, 0.12);
  color: var(--neg);
}

.alert {
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.alert-error {
  background: rgba(217, 48, 37, 0.12);
  color: var(--neg);
}

.alert-success {
  background: rgba(31, 163, 74, 0.12);
  color: var(--pos);
}

.filters-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-clear {
  margin-top: 8px;
  width: 100%;
  text-align: center;
  background: #f3f4f6;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

.login-body {
  min-height: 100vh;
  background: #edf3fa;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.login-intro {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(36px, 6vw, 80px);
  color: #fff;
  background:
    radial-gradient(circle at 78% 20%, rgba(82, 174, 255, 0.38), transparent 32%),
    linear-gradient(145deg, #063a67 0%, #075a96 56%, #0879bd 100%);
}

.login-intro::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -190px;
  bottom: -210px;
  border: 80px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.brand-bar {
  width: 5px;
  border-radius: 4px;
  background: #fff;
}

.brand-bar-a { height: 10px; opacity: 0.7; }
.brand-bar-b { height: 17px; opacity: 0.85; }
.brand-bar-c { height: 23px; }

.login-message {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: 70px 0;
}

.login-eyebrow,
.login-kicker {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-message h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(40px, 5vw, 70px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.login-message > p:last-child {
  max-width: 560px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.65;
}

.login-benefits {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-benefits span {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 44px;
  background: #f7f9fc;
}

.login-card {
  width: min(100%, 440px);
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid #dce5ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(24, 56, 86, 0.12);
}

.login-kicker {
  color: var(--blue);
}

.login-card h2 {
  margin: 0;
  color: #12263a;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.login-subtitle {
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.login-card form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label {
  color: #334155;
  font-weight: 600;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #cbd7e4;
  border-radius: 10px;
  background: #fff;
  color: #12263a;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.13);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 78px !important;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
  border-radius: 10px;
  font-weight: 650;
  box-shadow: 0 10px 24px rgba(0, 120, 212, 0.22);
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.login-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 24px;
  color: #64748b;
  font-size: 11px;
}

.login-security span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8f5ee;
  color: #147a3d;
  font-weight: 700;
}

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

  .login-intro {
    min-height: 330px;
    padding: 30px;
  }

  .login-message {
    margin: 52px 0 30px;
  }

  .login-message h1 {
    font-size: clamp(34px, 9vw, 52px);
  }

  .login-panel {
    padding: 28px 18px 44px;
  }

  .body {
    grid-template-columns: 1fr;
  }
  .sidebar,
  .margin {
    order: 2;
  }
}
