/* =========================================================
BASE GLOBAL (RESET + TIPOGRAFIA)
========================================================= */

* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #1f2937;
}


/* =========================================================
HEADER GLOBAL
========================================================= */

header {
    background: #0f766e;
    color: #ffffff;
    padding: 16px 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

.logo img {
    height: 42px;
}

.topbar a {
    color: #ffffff;
    text-decoration: none;
}

.topbar a:hover {
    text-decoration: underline;
}


/* =========================================================
LAYOUT GERAL
========================================================= */

.container {
    max-width: 1050px;
    margin: 24px auto;
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}
/* =========================================================
INDEX PRINCIPAL (CARDS)
========================================================= */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card h2 {
    margin-top: 0;
    font-size: 20px;
}

.card p {
    color: #475569;
    margin-bottom: 12px;
}

/* =========================================================
TÍTULOS
========================================================= */

h1 {
    margin-top: 0;
}

.lead {
    margin-top: 0;
    color: #475569;
}


/* =========================================================
MENSAGENS
========================================================= */

.msg-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.msg-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
}

.note {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}


/* =========================================================
FORMULÁRIOS
========================================================= */

.field {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

label {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 14px;
}

input,
select,
textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 2px rgba(15,118,110,0.12);
}


/* =========================================================
BOTÕES
========================================================= */

.btn {
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: #0f766e;
    color: #ffffff;
}

.btn-primary:hover {
    background: #0d5f59;
}

.btn-secondary {
    background: #e2e8f0;
    color: #1f2937;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

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

.btn-warning {
    background: #fff7ed;
    color: #b45309;
    border: 1px solid #fed7aa;
}

.btn-warning:hover {
    background: #ffedd5;
}


/* =========================================================
AÇÕES
========================================================= */

.actions {
    margin-top: 24px;
    display: flex;
    gap: 10px;
}


/* =========================================================
TABELAS
========================================================= */

.table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

thead th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #64748b;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 12px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

tbody tr:nth-child(even) {
    background: #f8fafc;
}

tbody tr:hover {
    background: #f1f5f9;
}

.table-actions,
.inline-actions {
    display: flex;
    gap: 6px;
}

.inline-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.table-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.muted {
    color: #94a3b8;
    font-size: 13px;
}

.empty {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
}


/* =========================================================
BREADCRUMB
========================================================= */

.breadcrumb {
    margin-bottom: 16px;
    font-size: 14px;
    color: #64748b;
}

.breadcrumb a {
    color: #0f766e;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 6px;
}


/* =========================================================
GRID FORMULÁRIOS
========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 15px;
}

.field.full {
    grid-column: 1 / -1;
}



/* =========================================================
LOGIN - LAYOUT
Página de autenticação isolada e centrada
========================================================= */

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.10);
    padding: 32px;
}

.login-card h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.login-sub {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 14px;
}

.login-card input[type="email"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 14px;
}

.login-card button {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
}

.login-footer {
    margin-top: 18px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}
.login-card button {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 8px;
    background: #374151; /* cinza */
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
}

.login-card button:hover {
    background: #1f2937;
}
.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    max-height: 60px;
}
.imagem-atual-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.imagem-atual-box img {
    width: 180px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
/* =========================================================
EQUIPAMENTO SHOW (ALINHADO COM HTML ATUAL)
========================================================= */

.equipamento-hero {
    display: flex;
    gap: 24px;
    margin-top: 20px;
    align-items: flex-start;
}

/* ---------- IMAGEM ---------- */

.equipamento-img-col img,
.no-img {
    width: 220px;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

/* ---------- COLUNA PRINCIPAL ---------- */

.equipamento-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.equipamento-content h1 {
    margin: 0 0 6px 0;
}

/* ---------- META ---------- */

.meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #475569;
    margin-bottom: 16px;
}

.meta strong {
    color: #0f172a;
    font-weight: 600;
}

/* ---------- BADGES ---------- */

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.estado-ativo {
    background: #dcfce7;
    color: #166534;
}

.estado-inativo {
    background: #e5e7eb;
    color: #374151;
}

.estado-avariado {
    background: #fee2e2;
    color: #991b1b;
}

.estado-abatido {
    background: #fef3c7;
    color: #92400e;
}

/* ---------- GRID ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 26px;
    margin-top: 8px;
}

/* 🔥 chave: alinhar estilo com meta (sem “cards”) */

.grid div {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
}

/* label estilo ficha técnica */

.grid label {
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 2px;
}

/* valor */

.grid span {
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
}

/* ---------- LINHAS TÉCNICAS ---------- */

.linha {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 0;
    font-size: 14px;
}

/* ---------- SECÇÕES ---------- */

.section {
    margin-top: 28px;
}

/* =========================================================
RESPONSIVE
========================================================= */

@media (max-width: 800px) {

    .equipamento-hero {
        flex-direction: column;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

.meta.destaque-equipamento h1 {
    font-size: 32px;
    margin: 0;
    font-weight: 700;
}

.meta {
    display: flex;
    gap: 10px;
    align-items: baseline;
    flex-wrap: wrap;
}
/* =========================================================
MODAL DE ELIMINAÇÃO CRÍTICA
Usado no módulo de utilizadores para confirmar eliminações,
especialmente eliminações de utilizadores com perfil ADMIN.
========================================================= */

.delete-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.delete-modal-overlay.is-visible {
    display: flex;
}

.delete-modal {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 1px solid #fecaca;
}

.delete-modal-header {
    background: #991b1b;
    color: #ffffff;
    padding: 18px 22px;
}

.delete-modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.delete-modal-body {
    padding: 22px;
    color: #1f2937;
    line-height: 1.5;
}

.delete-modal-main {
    color: #991b1b;
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 16px;
}

.delete-modal-user {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px;
    margin: 14px 0;
    font-size: 14px;
}

.delete-modal-warning {
    color: #7f1d1d;
    font-weight: 600;
    margin-top: 12px;
}

.delete-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.delete-modal-actions .btn {
    min-width: 120px;
    text-align: center;
}

/* Formulários inline dentro de ações de tabela.
Evita desalinhamento entre botões <a> e <button>. */
.inline-form {
    display: inline;
    margin: 0;
}
.modal-overlay {
    display:none;
    position:fixed;
    top:0; left:0;
    width:100%; height:100%;
    background:rgba(0,0,0,0.4);
    align-items:center;
    justify-content:center;
}

.modal-overlay.is-visible {
    display:flex;
}

.modal {
    background:#fff;
    padding:20px;
    width:300px;
    border-radius:8px;
}
.help {
    font-size: 12px;
    color: #a94442;   /* vermelho profissional suave */
    margin-top: 4px;
}