/* ProTerm Admin — small layer of reusable component classes on top of Tailwind CDN.
   Tailwind utility classes do most of the work in templates; this file holds only
   the few patterns repeated across many pages. */

/* ===== Card ===== */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #4a5a8a;
    background: #4a5a8a;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    letter-spacing: 0.01em;
}
.card-header > span:first-child {
    font-size: 1.05rem;
}
.card-body { padding: 1rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-icon { padding: 0.4rem; }

.btn-primary { background: #6b7db3; color: #fff; }
.btn-primary:hover { background: #5a6ca2; }

.btn-accent { background: #7ec8a0; color: #fff; }
.btn-accent:hover { background: #6bb78f; }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-outline { background: #fff; color: #334155; border-color: #cbd5e1; }
.btn-outline:hover { background: #f1f5f9; }

/* ===== Forms ===== */
.form-group { margin-bottom: 0.85rem; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.25rem;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group select,
.form-group textarea,
.input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    background: #fff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.input:focus {
    border-color: #6b7db3;
    box-shadow: 0 0 0 3px rgba(107,125,179,0.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input[readonly] { background: #f1f5f9; color: #64748b; }

/* ===== Data table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table thead th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.data-table tbody td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

/* ===== Alerts ===== */
.alert {
    padding: 0.6rem 0.85rem;
    border-radius: 0.375rem;
    margin-bottom: 0.85rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
}
.alert-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

/* ===== Status dot ===== */
.status-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 9999px;
    background: #cbd5e1;
}
.status-0 { background: #dc2626; }
.status-1 { background: #f59e0b; }
.status-2 { background: #16a34a; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-overlay.is-open { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    min-width: 320px;
    max-width: 480px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1e293b;
    font-size: 1rem;
}
