/* ============================================================
   AISTS EcoImpact Portal CSS
   Complete redesign with brand system and layout components
   ============================================================ */

:root {
  --aists-green: #00A651;
  --aists-yellow: #FCB131;
  --aists-blue: #0081C8;
  --aists-red: #EE334E;
  --aists-navy: #1E2761;
  --aists-dark: #0F172A;
  --aists-gray: #64748B;
  --aists-light: #F1F5F9;
  --aists-border: #CBD5E1;
  --aists-white: #FFFFFF;
}

/* ============================================================
   Reset & Base Styles
   ============================================================ */

.aists-portal {
  font-family: 'Aktiv Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--aists-light);
  color: var(--aists-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.aists-portal * {
  box-sizing: border-box;
}

/* ============================================================
   Navigation Bar
   ============================================================ */

.aists-portal-nav {
  background-color: var(--aists-navy);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.aists-portal-nav__logo {
  flex-shrink: 0;
  width: 150px;
  height: 40px;
  background-color: var(--aists-white);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--aists-navy);
}

.aists-portal-nav__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.aists-portal-nav__links {
  flex: 1;
  display: flex;
  gap: 24px;
  align-items: center;
}

.aists-portal-nav__links a {
  color: var(--aists-white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.aists-portal-nav__links a:hover,
.aists-portal-nav__links a.active {
  color: var(--aists-yellow);
  border-bottom-color: var(--aists-yellow);
}

.aists-portal-nav__user {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--aists-white);
  font-size: 14px;
}

.aists-portal-nav__user a {
  color: var(--aists-white);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease;
}

.aists-portal-nav__user a:hover {
  color: var(--aists-yellow);
}

/* ============================================================
   Breadcrumb
   ============================================================ */

.aists-portal-breadcrumb {
  padding: 12px 24px;
  font-size: 12px;
  color: var(--aists-gray);
  background-color: var(--aists-white);
  border-bottom: 1px solid var(--aists-border);
}

.aists-portal-breadcrumb a {
  color: var(--aists-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

.aists-portal-breadcrumb a:hover {
  color: var(--aists-navy);
}

.aists-portal-breadcrumb span {
  margin: 0 4px;
}

/* ============================================================
   Page Header
   ============================================================ */

.aists-portal-header {
  padding: 24px;
  background-color: var(--aists-white);
  border-bottom: 1px solid var(--aists-border);
}

.aists-portal-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: var(--aists-dark);
  margin-bottom: 8px;
}

.aists-portal-header .metadata {
  font-size: 13px;
  color: var(--aists-gray);
}

/* ============================================================
   Tabs
   ============================================================ */

.aists-portal-tabs {
  display: flex;
  gap: 24px;
  padding: 0 24px;
  background-color: var(--aists-white);
  border-bottom: 1px solid var(--aists-border);
  overflow-x: auto;
}

.aists-portal-tabs a {
  padding: 12px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--aists-gray);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.aists-portal-tabs a:hover {
  color: var(--aists-dark);
}

.aists-portal-tabs a.active {
  color: var(--aists-green);
  border-bottom-color: var(--aists-green);
}

/* ============================================================
   Content Area
   ============================================================ */

.aists-portal-content {
  flex: 1;
  padding: 24px;
  position: relative;
}

/* ============================================================
   Study Filters
   ============================================================ */

.aists-study-filters {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background-color: var(--aists-white);
  border-radius: 6px;
  border: 1px solid var(--aists-border);
  flex-wrap: wrap;
}

.aists-study-filters__toggle {
  display: flex;
  gap: 8px;
}

.aists-study-filters__toggle button {
  padding: 6px 12px;
  border: 1px solid var(--aists-border);
  background-color: var(--aists-white);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--aists-gray);
  cursor: pointer;
  transition: all 0.2s ease;
}

.aists-study-filters__toggle button.active {
  background-color: var(--aists-green);
  color: var(--aists-white);
  border-color: var(--aists-green);
}

.aists-study-filters__toggle button:hover {
  border-color: var(--aists-gray);
}

.aists-study-filters__search {
  flex: 1;
  min-width: 200px;
}

.aists-study-filters__search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--aists-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.aists-study-filters__search input:focus {
  outline: none;
  border-color: var(--aists-blue);
  box-shadow: 0 0 0 3px rgba(0, 129, 200, 0.1);
}

.aists-study-filters__customer {
  flex-shrink: 0;
}

.aists-study-filters__customer select {
  padding: 8px 12px;
  border: 1px solid var(--aists-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background-color: var(--aists-white);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.aists-study-filters__customer select:focus {
  outline: none;
  border-color: var(--aists-blue);
  box-shadow: 0 0 0 3px rgba(0, 129, 200, 0.1);
}

/* ============================================================
   Study Cards
   ============================================================ */

.aists-study-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.aists-study-card {
  background-color: var(--aists-white);
  border-radius: 8px;
  border-left: 4px solid var(--aists-blue);
  border: 1px solid var(--aists-border);
  border-left: 4px solid var(--aists-blue);
  padding: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.aists-study-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.aists-study-card--validation {
  border-left-color: var(--aists-green);
}

.aists-study-card--collection {
  border-left-color: var(--aists-yellow);
}

.aists-study-card--report {
  border-left-color: var(--aists-red);
}

.aists-study-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--aists-dark);
}

.aists-study-card .client {
  font-size: 12px;
  color: var(--aists-gray);
  margin-bottom: 12px;
}

.aists-study-card .progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.aists-study-card .progress-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--aists-dark);
}

.aists-study-card .progress-percent {
  font-size: 12px;
  color: var(--aists-gray);
}

.aists-study-card .progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--aists-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.aists-study-card .progress-bar-fill {
  height: 100%;
  background-color: var(--aists-green);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.aists-study-card .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--aists-border);
}

.aists-study-card .footer-date {
  font-size: 12px;
  color: var(--aists-gray);
}

/* ============================================================
   Study Dashboard
   ============================================================ */

.aists-completion-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.aists-completion-card {
  background-color: var(--aists-white);
  border-radius: 8px;
  border: 1px solid var(--aists-border);
  padding: 16px;
  text-align: center;
  transition: box-shadow 0.2s ease;
}

.aists-completion-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.aists-completion-card .title {
  font-size: 12px;
  font-weight: 500;
  color: var(--aists-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.aists-completion-card .number {
  font-size: 32px;
  font-weight: 700;
  color: var(--aists-green);
  line-height: 1;
  margin-bottom: 8px;
}

.aists-completion-card .subtitle {
  font-size: 11px;
  color: var(--aists-gray);
}

.aists-progress-card {
  background-color: var(--aists-white);
  border-radius: 8px;
  border: 1px solid var(--aists-border);
  padding: 20px;
  margin-bottom: 24px;
}

.aists-progress-card h3 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--aists-dark);
}

.aists-progress-card .progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.aists-progress-card .progress-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--aists-dark);
}

.aists-progress-card .progress-percent {
  font-size: 13px;
  color: var(--aists-gray);
}

.aists-progress-card .progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--aists-light);
  border-radius: 4px;
  overflow: hidden;
}

.aists-progress-card .progress-bar-fill {
  height: 100%;
  background-color: var(--aists-blue);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.aists-setup-card {
  background-color: var(--aists-white);
  border-radius: 8px;
  border: 1px solid var(--aists-border);
  padding: 20px;
  margin-bottom: 24px;
}

.aists-setup-card h3 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--aists-dark);
}

.aists-setup-card .checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aists-setup-card .checklist li {
  padding: 10px 0;
  font-size: 13px;
  color: var(--aists-dark);
  border-bottom: 1px solid var(--aists-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.aists-setup-card .checklist li:last-child {
  border-bottom: none;
}

.aists-setup-card .checklist li input[type="checkbox"] {
  cursor: pointer;
}

.aists-setup-card .checklist li.checked {
  color: var(--aists-gray);
  text-decoration: line-through;
}

/* ============================================================
   Financial Data Tables
   ============================================================ */

.aists-financial-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.aists-financial-toolbar button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.aists-financial-toolbar .aists-btn--primary {
  background-color: var(--aists-green);
  color: var(--aists-white);
}

.aists-financial-toolbar .aists-btn--primary:hover {
  background-color: #008a42;
  box-shadow: 0 2px 6px rgba(0, 166, 81, 0.2);
}

.aists-financial-toolbar .aists-btn--secondary {
  background-color: var(--aists-white);
  color: var(--aists-dark);
  border: 1px solid var(--aists-border);
}

.aists-financial-toolbar .aists-btn--secondary:hover {
  border-color: var(--aists-gray);
  background-color: var(--aists-light);
}

.aists-zone-hint {
  padding: 12px 16px;
  margin-bottom: 16px;
  background-color: rgba(0, 129, 200, 0.08);
  border-left: 4px solid var(--aists-blue);
  border-radius: 4px;
  font-size: 12px;
  color: var(--aists-dark);
  line-height: 1.4;
}

.aists-financial-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--aists-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.aists-financial-table thead {
  background-color: var(--aists-light);
  border-bottom: 1px solid var(--aists-border);
}

.aists-financial-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--aists-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aists-financial-table tbody tr {
  border-bottom: 1px solid var(--aists-border);
  transition: background-color 0.2s ease;
}

.aists-financial-table tbody tr:nth-child(even) {
  background-color: var(--aists-light);
}

.aists-financial-table tbody tr:hover {
  background-color: rgba(0, 166, 81, 0.04);
}

.aists-financial-table tbody tr.edit-mode {
  background-color: rgba(0, 129, 200, 0.1);
}

.aists-financial-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--aists-dark);
}

.aists-financial-table .zone-cell {
  font-weight: 500;
}

.aists-financial-table .action-cell {
  text-align: right;
  padding-right: 12px;
}

.aists-financial-table .action-btn {
  padding: 4px 8px;
  margin-left: 4px;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: transparent;
  color: var(--aists-blue);
}

.aists-financial-table .action-btn:hover {
  background-color: var(--aists-light);
  color: var(--aists-navy);
}

.aists-financial-table .action-btn.delete {
  color: var(--aists-red);
}

.aists-financial-table .action-btn.delete:hover {
  background-color: rgba(238, 51, 78, 0.1);
}

.aists-financial-table input[type="text"],
.aists-financial-table input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--aists-blue);
  border-radius: 3px;
  font-size: 13px;
  font-family: inherit;
}

.aists-financial-table input[type="text"]:focus,
.aists-financial-table input[type="number"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 129, 200, 0.2);
}

/* ============================================================
   Badges
   ============================================================ */

.aists-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.aists-badge--green {
  background-color: rgba(0, 166, 81, 0.15);
  color: #008a42;
}

.aists-badge--amber {
  background-color: rgba(252, 177, 49, 0.15);
  color: #b8860b;
}

.aists-badge--blue {
  background-color: rgba(0, 129, 200, 0.15);
  color: #0066a1;
}

.aists-badge--red {
  background-color: rgba(238, 51, 78, 0.15);
  color: #c71c2a;
}

.aists-badge--gray {
  background-color: rgba(100, 116, 139, 0.15);
  color: #475569;
}

/* ============================================================
   Buttons
   ============================================================ */

.aists-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.aists-btn--primary {
  background-color: var(--aists-green);
  color: var(--aists-white);
}

.aists-btn--primary:hover:not(:disabled) {
  background-color: #008a42;
  box-shadow: 0 2px 6px rgba(0, 166, 81, 0.2);
}

.aists-btn--primary:active:not(:disabled) {
  background-color: #006633;
}

.aists-btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.aists-btn--secondary {
  background-color: var(--aists-white);
  color: var(--aists-dark);
  border: 1px solid var(--aists-border);
}

.aists-btn--secondary:hover:not(:disabled) {
  border-color: var(--aists-gray);
  background-color: var(--aists-light);
}

.aists-btn--secondary:active:not(:disabled) {
  background-color: var(--aists-border);
}

.aists-btn--secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.aists-btn--small {
  padding: 6px 12px;
  font-size: 12px;
}

.aists-btn--large {
  padding: 10px 20px;
  font-size: 14px;
}

/* ============================================================
   Cards
   ============================================================ */

.aists-card {
  background-color: var(--aists-white);
  border-radius: 8px;
  border: 1px solid var(--aists-border);
  padding: 20px;
}

.aists-card--elevated {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.aists-card h2,
.aists-card h3 {
  margin: 0 0 12px 0;
  color: var(--aists-dark);
}

.aists-card p {
  margin: 0 0 12px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--aists-dark);
}

.aists-card p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   AI Chat Widget
   ============================================================ */

.aists-chat-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background-color: var(--aists-navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  border: none;
  color: var(--aists-white);
  font-size: 24px;
  font-weight: 600;
}

.aists-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.aists-chat-bubble:active {
  transform: scale(0.96);
}

.aists-chat-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 500px;
  background-color: var(--aists-white);
  border-radius: 12px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s ease;
}

.aists-chat-panel--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.aists-chat-panel__header {
  background-color: var(--aists-navy);
  color: var(--aists-white);
  padding: 16px 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--aists-border);
}

.aists-chat-panel__header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.aists-chat-panel__header button {
  background: none;
  border: none;
  color: var(--aists-white);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.aists-chat-panel__header button:hover {
  opacity: 0.8;
}

.aists-chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aists-chat-panel__msg {
  display: flex;
  max-width: 85%;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.aists-chat-panel__msg--user {
  align-self: flex-end;
  margin-left: auto;
}

.aists-chat-panel__msg--user .content {
  background-color: #e3f2fd;
  color: var(--aists-dark);
  border-radius: 12px 12px 0 12px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
}

.aists-chat-panel__msg--ai {
  align-self: flex-start;
  margin-right: auto;
}

.aists-chat-panel__msg--ai .content {
  background-color: #f1f5f9;
  color: var(--aists-dark);
  border-radius: 12px 12px 12px 0;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
}

.aists-chat-panel__msg--typing .content {
  display: flex;
  gap: 3px;
  padding: 10px 14px;
}

.aists-chat-panel__msg--typing .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--aists-gray);
  animation: typing 1.4s infinite;
}

.aists-chat-panel__msg--typing .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.aists-chat-panel__msg--typing .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.5;
  }
  30% {
    opacity: 1;
  }
}

.aists-chat-panel__input {
  border-top: 1px solid var(--aists-border);
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.aists-chat-panel__input input {
  flex: 1;
  border: 1px solid var(--aists-border);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  max-height: 80px;
}

.aists-chat-panel__input input:focus {
  outline: none;
  border-color: var(--aists-blue);
  box-shadow: 0 0 0 2px rgba(0, 129, 200, 0.15);
}

.aists-chat-panel__input button {
  background-color: var(--aists-green);
  color: var(--aists-white);
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.aists-chat-panel__input button:hover:not(:disabled) {
  background-color: #008a42;
}

.aists-chat-panel__input button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   Footer
   ============================================================ */

.aists-portal-footer {
  padding: 16px 24px;
  font-size: 12px;
  color: var(--aists-gray);
  font-style: italic;
  border-top: 1px solid var(--aists-border);
  background-color: var(--aists-white);
}

/* ============================================================
   Responsive Design
   ============================================================ */

@media (max-width: 1024px) {
  .aists-completion-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .aists-study-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .aists-portal-nav {
    padding: 0 16px;
    gap: 16px;
  }

  .aists-portal-nav__links {
    gap: 16px;
  }

  .aists-portal-content {
    padding: 16px;
  }

  .aists-chat-panel {
    width: 320px;
    height: 450px;
  }
}

@media (max-width: 768px) {
  .aists-completion-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .aists-study-cards {
    grid-template-columns: 1fr;
  }

  .aists-study-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .aists-study-filters__search {
    min-width: auto;
  }

  .aists-study-filters__customer {
    width: 100%;
  }

  .aists-study-filters__customer select {
    width: 100%;
  }

  .aists-portal-nav__links {
    display: none;
  }

  .aists-chat-panel {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
    max-height: 70vh;
  }

  .aists-chat-bubble {
    bottom: 16px;
    right: 16px;
  }

  .aists-financial-table {
    font-size: 12px;
  }

  .aists-financial-table th,
  .aists-financial-table td {
    padding: 8px 12px;
  }

  .aists-portal-breadcrumb {
    padding: 8px 16px;
    font-size: 11px;
  }

  .aists-portal-header {
    padding: 16px;
  }

  .aists-portal-header h1 {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .aists-completion-grid {
    grid-template-columns: 1fr;
  }

  .aists-portal-nav {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .aists-portal-nav__logo {
    width: 120px;
    height: 32px;
    font-size: 10px;
  }

  .aists-portal-nav__user {
    font-size: 12px;
  }

  .aists-portal-content {
    padding: 12px;
  }

  .aists-study-card {
    padding: 16px;
  }

  .aists-financial-toolbar {
    gap: 8px;
  }

  .aists-financial-toolbar button {
    padding: 6px 12px;
    font-size: 12px;
  }

  .aists-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .aists-chat-panel__messages {
    padding: 12px 16px;
  }

  .aists-chat-panel__msg {
    max-width: 90%;
  }

  .aists-completion-card .number {
    font-size: 24px;
  }

  .aists-progress-card,
  .aists-setup-card {
    padding: 16px;
  }
}

/* ============================================================
   Portal Table (alias for financial-table used in table templates)
   ============================================================ */

.aists-portal-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--aists-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.aists-portal-table thead {
  background-color: var(--aists-light);
  border-bottom: 1px solid var(--aists-border);
}

.aists-portal-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--aists-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aists-portal-table tbody tr {
  border-bottom: 1px solid var(--aists-border);
  transition: background-color 0.2s ease;
}

.aists-portal-table tbody tr:nth-child(even) {
  background-color: var(--aists-light);
}

.aists-portal-table tbody tr:hover {
  background-color: rgba(0, 166, 81, 0.04);
}

.aists-portal-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--aists-dark);
}

.aists-portal-table .aists-portal-col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.aists-portal-table .aists-portal-col-actions {
  text-align: right;
  white-space: nowrap;
}

.aists-portal-table tfoot tr {
  background-color: var(--aists-light);
  border-top: 2px solid var(--aists-border);
}

/* ============================================================
   Portal Empty State
   ============================================================ */

.aists-portal-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--aists-gray);
  font-size: 14px;
}

/* ============================================================
   Portal Form Grid (used inside form modals)
   ============================================================ */

.aists-portal-form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aists-portal-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aists-portal-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--aists-dark);
}

.aists-portal-form-group input[type="text"],
.aists-portal-form-group input[type="number"],
.aists-portal-form-group select,
.aists-portal-form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--aists-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  color: var(--aists-dark);
  background-color: var(--aists-white);
  transition: border-color 0.2s ease;
}

.aists-portal-form-group input:focus,
.aists-portal-form-group select:focus,
.aists-portal-form-group textarea:focus {
  outline: none;
  border-color: var(--aists-blue);
  box-shadow: 0 0 0 3px rgba(0, 129, 200, 0.1);
}

.aists-portal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .aists-portal-form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Portal Action Buttons (Edit/Delete in table rows)
   ============================================================ */

.aists-portal-btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.aists-portal-btn-icon {
  background: none;
  border: 1px solid var(--aists-border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--aists-gray);
  transition: all 0.2s ease;
  line-height: 1;
}

.aists-portal-edit-btn:hover {
  color: var(--aists-blue);
  border-color: var(--aists-blue);
  background-color: rgba(0, 129, 200, 0.06);
}

.aists-portal-delete-btn:hover {
  color: var(--aists-red);
  border-color: var(--aists-red);
  background-color: rgba(238, 51, 78, 0.06);
}

/* ============================================================
   Portal Validated Count (inline badge)
   ============================================================ */

.aists-portal-validated-count {
  font-size: 11px;
  color: var(--aists-green);
  font-weight: 500;
}

/* ============================================================
   Locked Tab Label
   ============================================================ */

.aists-portal-tab-locked {
  position: relative;
}

.aists-portal-tab-locked::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 10px;
  margin-left: 4px;
  background: var(--aists-gray);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 20'%3E%3Cpath d='M8 0C5.2 0 3 2.2 3 5v3H2a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2v-8a2 2 0 00-2-2h-1V5c0-2.8-2.2-5-5-5zm3 8H5V5c0-1.7 1.3-3 3-3s3 1.3 3 3v3z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 20'%3E%3Cpath d='M8 0C5.2 0 3 2.2 3 5v3H2a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2v-8a2 2 0 00-2-2h-1V5c0-2.8-2.2-5-5-5zm3 8H5V5c0-1.7 1.3-3 3-3s3 1.3 3 3v3z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  vertical-align: middle;
}

/* ============================================================
   Hide GeneratePress theme footer credit
   ============================================================ */
.site-info,
.footer-info,
.site-footer .copyright-bar,
a[href*="generatepress.com"] {
  display: none !important;
}
