/* Login container for release mode */
.agh-tool-login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.agh-tool-login-container h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: #1e293b;
}

.agh-tool-login-container p {
    margin: 0 0 1.5rem;
    color: #64748b;
}

.agh-tool-login-container form {
    text-align: left;
}

.agh-tool-login-container label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: #374151;
}

.agh-tool-login-container input[type="text"],
.agh-tool-login-container input[type="password"] {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: #f9fafb;
    box-sizing: border-box;
}

.agh-tool-login-container input[type="text"]:focus,
.agh-tool-login-container input[type="password"]:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
}

.agh-tool-login-container .login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.agh-tool-login-container .login-submit {
    text-align: center;
}

.agh-tool-login-container input[type="submit"] {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.agh-tool-login-container input[type="submit"]:hover {
    background: #1d4ed8;
}

/* Permission message */
.agh-tool-permission-message {
    max-width: 500px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    text-align: center;
}

.agh-tool-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.agh-tool-category-list label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #dbe4f3;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.agh-tool-category-list label:hover {
  transform: translateY(-1px);
}

.agh-tool-category-list label.is-active {
  background: #2563eb;
  border-color: #1e3a8a;
  color: #ffffff;
  /* box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25); */
}

.agh-tool-category-list label.is-active span::before {
  background: rgba(255, 255, 255, 0.85);
}

.agh-tool-category-list input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.agh-tool-category-list label span {
  position: relative;
  line-height: 1.2;
  padding-left: 0.6rem;
}

.agh-tool-category-list label span::before {
  content: '';
  position: absolute;
  left: -0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #cbd5f5;
  transition: background 0.2s ease, transform 0.2s ease;
}

.agh-tool-category-list input:checked + span::before {
  background: rgba(233, 237, 244, 0.75);
  transform: translateY(-50%) scale(1.2);
}

.agh-tool-category-list input:checked + span {
  color: #ffffff;
  font-weight: 700;
}

/* .agh-tool-category-list input:checked + span::after {
  content: '';
  position: absolute;
  inset: -0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  z-index: -1;
} */

.agh-tool-wrapper {
    font-family: inherit;
    color: #1d1d1b;
    margin: 2rem 0;
}

.agh-tool-app {
    display: grid;
    gap: 2rem;
}

.agh-tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1rem;
    padding: 2rem 0;
}

@media (max-width: 1024px) {
    .agh-tool-layout {
        grid-template-columns: 1fr;
    }
}

.agh-tool-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.agh-tool-search {
    flex: 1 1 260px;
    padding: 0.6rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.agh-tool-search:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}





.agh-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

@media (min-width: 1440px) {
    .agh-tool-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.agh-tool-card {
    position: relative;
    border-radius: 10px;
    padding: 0.8rem 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 122px;
    border: 2px solid transparent;
}

.agh-tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.agh-tool-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.agh-tool-card.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.agh-tool-card.is-green {
    background: #eafaf1;
    color: #065f46;
}

.agh-tool-card.is-red {
    background: #fef2f2;
    color: #991b1b;
}

.agh-tool-card.is-yellow {
    background: #fefce8;
    color: #854d0e;
}

/* Status filter colors */
.agh-tool-status-filters label.is-green span::before {
    background: #22c55e;
}

.agh-tool-status-filters label.is-red span::before {
    background: #ef4444;
}

.agh-tool-status-filters label.is-yellow span::before {
    background: #eab308;
}

.agh-tool-status-filters label.is-active.is-green {
    background: #22c55e;
    border-color: #16a34a;
}

.agh-tool-status-filters label.is-active.is-red {
    background: #ef4444;
    border-color: #dc2626;
}

.agh-tool-status-filters label.is-active.is-yellow {
    background: #eab308;
    border-color: #ca8a04;
    color: #1e293b;
}

/* Card status icons */
.agh-tool-card-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agh-tool-card.is-green .agh-tool-card-icon {
    background: #22c55e;
    color: #ffffff;
}

.agh-tool-card.is-red .agh-tool-card-icon {
    background: #ef4444;
    color: #ffffff;
}

.agh-tool-card.is-yellow .agh-tool-card-icon {
    background: #eab308;
    color: #ffffff;
}

.agh-tool-card-icon svg {
    width: 14px;
    height: 14px;
}

.agh-tool-card .agh-tool-card-id {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.agh-tool-card .agh-tool-card-flag {
    position: absolute;
    bottom: 8px;
    left: 10px;
    font-size: 0.75rem;
    font-weight: 300;
    color: #ad5f00;
    text-transform: initial;
}

.agh-tool-card-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.agh-tool-card-metrics div {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.agh-tool-card-metrics strong {
    font-size: 1.35rem;
    line-height: 1;
}

.agh-tool-card-meta {
    font-size: 0.9rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agh-tool-empty {
    text-align: center;
    padding: 3rem 1rem;
    border: 2px dashed #e5e7eb;
    border-radius: 16px;
    color: #6b7280;
}

.agh-tool-cart {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1.5rem;
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.agh-tool-cart h2 {
    margin: 0;
    font-size: 1.25rem;
}

.agh-tool-mode-badge {
    display: inline-flex;
    align-items: center;
    color: #3730a3;
    font-weight: 600;
    font-size: 0.9rem;
    max-width: max-content;
}

.agh-tool-action-toggle {
    display: flex;
    gap: 0.75rem;
}

.agh-tool-action-toggle label {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agh-tool-action-toggle input {
    display: none;
}
.agh-tool-action-toggle span {
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  display: block;
}

.agh-tool-action-toggle input:checked + span {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.agh-tool-cart-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.agh-tool-cart-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.85rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px;
    gap: 0.85rem;
    align-items: center;
}

.agh-tool-cart-item-title {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.95rem;
}

.agh-tool-cart-item-title span {
    font-size: 0.8rem;
    color: #6b7280;
}

.agh-tool-cart-item input[type="number"], #agh-tool-bulk-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    font-size: 0.95rem;
}

.agh-tool-bulk-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.agh-tool-bulk-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.agh-tool-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.agh-tool-cart-actions button {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.agh-tool-cart-actions button:hover {
    background: #e0e7ff;
    color: #1d4ed8;
}

.agh-tool-confirm {
    width: 100%;
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.agh-tool-confirm--now {
    background: #6d28d9; /* purple accent for immediate release */
}

.agh-tool-confirm--now:not(:disabled):hover {
    background: #5b21b6;
}

.agh-tool-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.agh-tool-confirm:not(:disabled):hover {
    background: #1d4ed8;
}

/* Notification area inside cart */
.agh-tool-notification-area {
    min-height: 0;
}

.agh-tool-toast-container {
    position: relative;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agh-tool-toast {
    background: #eafaf1;
    color: #065f46;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #a7f3d0;
    opacity: 0;
    transform: translateY(-5px);
    animation: aghFadeInInline 0.3s forwards ease;
}

.agh-tool-toast--error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

@keyframes aghFadeInInline {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agh-tool-permission-message {
    padding: 2rem;
    border: 1px solid #fca5a5;
    background: #fef2f2;
    border-radius: 12px;
    color: #b91c1c;
    text-align: center;
}

.agh-tool-cart-empty {
    text-align: center;
    font-size: 0.95rem;
    color: #6b7280;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.agh-tool-floating-cart {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.25rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
    cursor: pointer;
    z-index: 9998;
}

.agh-tool-floating-cart:hover {
    background: #1d4ed8;
}

@media (max-width: 1024px) {
    .agh-tool-wrapper {
        padding-bottom: 5rem;
    }
}

@media (min-width: 1025px) {
    .agh-tool-floating-cart {
        display: none !important;
    }
}


