

/* Font Locali */
@font-face {
  font-family: 'Inter';
  src: url('font/InterTight-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Inter';
  src: url('font/InterTight-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Inter';
  src: url('font/InterTight-Bold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}
/* Sidebar personalizzata scura */
.sidebar {
  width: 280px;
  background: #1e2125;
  color: #fff;
  flex-shrink: 0;
  padding: 25px 20px;
  display: flex;
  flex-direction: column;
  height: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar a {
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 5px;
  transition: all 0.2s ease-in-out;
  font-weight: 500;
}

.sidebar a:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(4px);
}

.sidebar .nav-link.active {
  background-color: #0d6efd;
  color: #fff;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

.sidebar .user-info {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}


body {
    display: flex;
    min-height: 100vh;
    background-color: #f4f6f9;
    overflow-x: hidden;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* Sidebar personalizzata scura */
.sidebar {
    width: 260px;
    background: #212529;
    color: #fff;
    flex-shrink: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar a {
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    display: block;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
    color: #fff;
    background: #0d6efd; /* Bootstrap Primary */
    text-decoration: none;
}

.sidebar h3, .sidebar h4 {
    color: #6c757d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 700;
}

.main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* Container stile Card */
.container {
    max-width: 98%;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-top: 0;
}

/* Login centrato */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: auto; /* Centra nel body flex */
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Tabelle più eleganti */
table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    vertical-align: top;
    border-color: #dee2e6;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
}

th,
td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Override Form Elements per matchare Bootstrap se non hanno la classe */
input[type="text"], input[type="password"], select, textarea {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    margin-bottom: 15px;
}

/* --- Responsive Mobile --- */
@media (max-width: 991px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px;
    }

    /* Sovrascrive gli stili inline di index.php per permettere lo scroll della pagina */
    .main, .content {
        height: auto !important;
        overflow: visible !important;
        padding: 15px !important;
    }

    /* Rende le tabelle scrollabili orizzontalmente se non ci stanno */
    .card-body {
        overflow-x: auto;
    }
}

/* Card e Blocchi Schema */
.card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.25rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.schema-block {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #0d6efd;
    border-radius: 4px;
}

.error { color: #dc3545; font-weight: bold; }
.success { color: #198754; font-weight: bold; }

/* Admin Index/Ordini navbar + UI refinements (moved from index.php) */
.admin-navbar {
    background: #ffffff !important;
    border-bottom: 4px solid #e5eef7ff !important;
    border-top: 4px solid #e5eef7ff !important;
    padding: 1rem 2rem !important;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.admin-navbar.navbar {
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

.admin-navbar .view-site-link {
    color: #6c757d !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
}

.admin-navbar .view-site-link:hover {
    color: #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.05);
}

.admin-navbar .view-site-link i {
    font-size: 0.75rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.admin-navbar .view-site-link:hover i {
    opacity: 1;
    transform: translate(2px, -2px);
}

.admin-navbar .navbar-text {
    font-weight: 600;
    color: #4a5568 !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.admin-navbar .view-site-link span {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.admin-navbar .view-site-link {
    text-transform: uppercase;
}

.admin-navbar .navbar-text::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    margin-right: 12px;
}

.admin-navbar .btn-outline-primary {
    border: 1.5px solid #0d6efd;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 18px;
    transition: all 0.3s ease;
    background-color: rgba(13, 110, 253, 0.02);
}

.admin-navbar .btn-outline-primary:hover {
    background-color: #0d6efd;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
}


table tbody tr {
    transition: background-color 0.2s ease;
}

table tbody tr:hover {
    background-color: #f8fbff;
}

table img {
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

table img:hover {
    transform: scale(1.1);
}

td:first-child {
    font-family: monospace;
    color: #6c757d;
    font-size: 0.85rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid #dee2e6;
    background: white;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

input[type="text"].search-input {
    padding-left: 40px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    height: 45px;
}

input[type="text"].search-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar .logout-button {
    margin-top: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.main .d-flex.justify-content-between.align-items-center.mb-4 {
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 20px;
    margin-bottom: 30px !important;
}

.main h2 {
    font-weight: 700;
    color: #1e2125;
    margin: 0;
    letter-spacing: -0.5px;
}

.badge.bg-warning {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary.text-nowrap {
    margin-right: 30px;
    background-color: #0d6efd;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.btn-primary.text-nowrap:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.35);
}

.btn-primary.text-nowrap:active {
    transform: translateY(0);
}

.btn-primary.text-nowrap i {
    font-size: 1.1rem;
    -webkit-text-stroke: 0.5px;
}

/* Users create form: consistent heights and baseline alignment */
.users-create-form .users-align-input,
.users-create-form .users-align-btn {
    height: 40px;
    min-width: 96px;
}

.users-create-form .users-align-input {
    line-height: 38px;
}

.users-create-form select.users-align-input {
    line-height: 38px;
    padding-top: 0;
    padding-bottom: 0;
}

.users-create-form .users-align-actions {
    align-items: flex-start;
    padding-top: 30px;
}

.users-create-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.users-create-form .form-label {
    margin-bottom: 6px;
}
