/* ============================================================
   Gestione Permessi Aziendali – Stylesheet
   ============================================================ */

:root {
    --gp-primary:    #2563eb;
    --gp-primary-h:  #1d4ed8;
    --gp-danger:     #dc2626;
    --gp-danger-h:   #b91c1c;
    --gp-success-bg: #dcfce7;
    --gp-success-c:  #166534;
    --gp-warn-bg:    #fef9c3;
    --gp-warn-c:     #854d0e;
    --gp-error-bg:   #fee2e2;
    --gp-error-c:    #991b1b;
    --gp-pending-bg: #fef3c7;
    --gp-pending-c:  #92400e;
    --gp-approved-bg:#dcfce7;
    --gp-approved-c: #166534;
    --gp-rejected-bg:#fee2e2;
    --gp-rejected-c: #991b1b;
    --gp-radius:     8px;
    --gp-shadow:     0 2px 12px rgba(0,0,0,.07);
}

/* ---- Base ---- */
.gp-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow);
    padding: 28px 32px;
    margin-bottom: 24px;
}
.gp-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}
.gp-mt { margin-top: 28px; }
.gp-muted { color: #64748b; font-size: .88rem; margin: 0; }
.gp-empty { color: #94a3b8; font-style: italic; }
.gp-admin-note { color: #64748b; display: block; margin-top: 4px; }

/* ---- Auth ---- */
.gp-auth-card { max-width: 440px; margin: 40px auto; }
.gp-auth-link { text-align: center; margin-top: 16px; font-size: .9rem; }
.gp-auth-link a { color: var(--gp-primary); text-decoration: none; font-weight: 600; }

/* ---- Forms ---- */
.gp-form { display: flex; flex-direction: column; gap: 16px; }
.gp-field { display: flex; flex-direction: column; gap: 6px; }
.gp-field label { font-size: .875rem; font-weight: 600; color: #374151; }
.gp-field input,
.gp-field select,
.gp-field textarea {
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: .9rem;
    transition: border-color .15s;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}
.gp-field input:focus,
.gp-field select:focus,
.gp-field textarea:focus {
    outline: none;
    border-color: var(--gp-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.gp-input-readonly { background: #f8fafc !important; color: #64748b; cursor: default; }
.gp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gp-field-inline { flex-direction: row; align-items: center; gap: 8px; }
.gp-field-space-between { flex-direction: row; align-items: center; justify-content: space-between; }
.gp-inline-label { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: .875rem; }
.gp-link-small { font-size: .82rem; color: var(--gp-primary); text-decoration: none; white-space: nowrap; }
.gp-link-small:hover { text-decoration: underline; }

/* ---- Buttons ---- */
.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .15s, border-color .15s, opacity .15s;
    text-decoration: none;
}
.gp-btn-primary { background: var(--gp-primary); color: #fff; }
.gp-btn-primary:hover { background: var(--gp-primary-h); }
.gp-btn-outline { background: transparent; border-color: var(--gp-primary); color: var(--gp-primary); }
.gp-btn-outline:hover { background: var(--gp-primary); color: #fff; }
.gp-btn-danger { background: var(--gp-danger); color: #fff; }
.gp-btn-danger:hover { background: var(--gp-danger-h); }
.gp-btn-full { width: 100%; }
.gp-btn-sm { padding: 5px 12px; font-size: .82rem; }
.gp-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Messages ---- */
.gp-messages { display: none; margin-bottom: 12px; }
.gp-messages.visible { display: block; }
.gp-msg {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: .88rem;
    margin-bottom: 6px;
}
.gp-msg-success { background: var(--gp-success-bg); color: var(--gp-success-c); }
.gp-msg-error   { background: var(--gp-error-bg);   color: var(--gp-error-c); }

/* ---- Dashboard header ---- */
.gp-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.gp-dashboard-header h2 { margin: 0 0 4px; font-size: 1.4rem; }

/* ---- Tabs ---- */
.gp-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.gp-tab {
    padding: 10px 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    font-size: .88rem;
    transition: all .15s;
}
.gp-tab.active,
.gp-tab:hover { border-color: var(--gp-primary); color: var(--gp-primary); background: #eff6ff; }

/* ---- Status badges ---- */
.gp-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.gp-status-pending  { background: var(--gp-pending-bg);  color: var(--gp-pending-c); }
.gp-status-approved { background: var(--gp-approved-bg); color: var(--gp-approved-c); }
.gp-status-rejected { background: var(--gp-rejected-bg); color: var(--gp-rejected-c); }

/* ---- Table ---- */
.gp-table-wrap { overflow-x: auto; }
.gp-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.gp-table th,
.gp-table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; text-align: left; vertical-align: top; }
.gp-table th { background: #f8fafc; font-weight: 700; color: #374151; }
.gp-table tr:last-child td { border-bottom: none; }

/* ---- Notice ---- */
.gp-notice { background: var(--gp-warn-bg); color: var(--gp-warn-c); padding: 14px 18px; border-radius: 6px; }

/* ---- Admin ---- */
.gp-admin-wrap h1 { margin-bottom: 24px; }
.gp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.gp-filters label { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; font-weight: 600; color: #374151; }
.gp-filters select { padding: 7px 10px; border: 1.5px solid #d1d5db; border-radius: 6px; }
.gp-admin-table td { vertical-align: top; }
.gp-highlight { background: #fffbeb !important; }

/* ---- Modal ---- */
.gp-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 99999; display: flex; align-items: center; justify-content: center;
}
.gp-modal {
    background: #fff; border-radius: 10px; padding: 32px;
    width: 420px; max-width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.gp-modal h3 { margin: 0 0 16px; }
.gp-modal label { display: block; font-size: .875rem; font-weight: 600; color: #374151; margin-bottom: 8px; }
.gp-modal textarea { width: 100%; box-sizing: border-box; border: 1.5px solid #d1d5db; border-radius: 6px; padding: 8px 12px; font-size: .9rem; resize: vertical; }
.gp-modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
.gp-btn-reject { background: var(--gp-danger); color: #fff; }
.gp-btn-reject:hover { background: var(--gp-danger-h); }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .gp-field-row { grid-template-columns: 1fr; }
    .gp-dashboard-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .gp-tabs { flex-direction: column; }
    .gp-card { padding: 18px 16px; }
}
