:root {
    color-scheme: dark;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 1.25rem;
    background: linear-gradient(150deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.7) 100%);
    border: 1px solid rgba(71, 85, 105, 0.4);
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08), 0 16px 40px rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(12px);
}

.stat-label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.9);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 600;
    color: #f8fafc;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: rgba(203, 213, 225, 0.9);
}

.filter-input {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(71, 85, 105, 0.6);
    background: rgba(15, 23, 42, 0.8);
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    color: #e2e8f0;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.filter-input:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.6);
    background: rgba(2, 6, 23, 0.9);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.9);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border-radius: 0.85rem;
    border: 1px solid rgba(45, 212, 191, 0.25);
    background: rgba(15, 118, 110, 0.08);
    padding: 0.7rem 0.9rem;
    color: #f8fafc;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.75);
    background: rgba(15, 118, 110, 0.22);
}

.tool-card {
    border-radius: 1.25rem;
    border: 1px solid rgba(71, 85, 105, 0.45);
    background: linear-gradient(140deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.7));
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.55);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.badge-available {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(15, 118, 110, 0.18);
}

.badge-checked_out {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(30, 64, 175, 0.18);
}

.badge-maintenance {
    color: #fcd34d;
    border-color: rgba(252, 211, 77, 0.35);
    background: rgba(120, 53, 15, 0.18);
}

.badge-retired {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.35);
}

.badge-alert {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(120, 53, 15, 0.25);
}

.badge-overdue {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(127, 29, 29, 0.3);
}

.badge-due-soon {
    color: #fcd34d;
    border-color: rgba(250, 204, 21, 0.45);
    background: rgba(124, 45, 18, 0.25);
}

.tool-meta {
    display: grid;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.9);
}

.tool-meta strong {
    color: #e2e8f0;
    font-weight: 600;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tool-actions button,
.tool-actions select {
    font-size: 0.8rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(71, 85, 105, 0.6);
    background: rgba(15, 23, 42, 0.7);
    padding: 0.35rem 0.75rem;
    color: #e2e8f0;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.tool-card.is-maintenance-due {
    border-color: rgba(251, 191, 36, 0.55);
}

.tool-card.is-overdue {
    border-color: rgba(248, 113, 113, 0.65);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.2);
}

.tool-card .meta-note {
    font-size: 0.75rem;
    color: rgba(252, 211, 77, 0.75);
}

.tool-actions button:hover,
.tool-actions select:focus {
    border-color: rgba(16, 185, 129, 0.55);
    outline: none;
}

.toast {
    min-width: 240px;
    margin-top: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background: rgba(15, 23, 42, 0.95);
    padding: 0.75rem 1rem;
    color: #f8fafc;
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.55);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(6, 78, 59, 0.9);
}

.toast-error {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.9);
}

.toast-warning {
    border-color: rgba(250, 204, 21, 0.45);
    background: rgba(113, 63, 18, 0.9);
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(30, 64, 175, 0.9);
}

@media (max-width: 640px) {
    .tool-card {
        padding: 1.1rem;
    }

    .tool-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tool-actions button,
    .tool-actions select {
        width: 100%;
        text-align: left;
    }
}
