body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f4f5f7;
    color: #222;
}

.app-header {
    background: #111827;
    color: #f9fafb;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header img.logo {
    height: 40px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
}

.app-header-right {
    font-size: 14px;
}

.app-header-right a {
    color: #e5e7eb;
    text-decoration: none;
    margin-left: 10px;
}

.app-header-right a:hover {
    text-decoration: underline;
}

.app-container {
    max-width: 1100px;
    margin: 20px auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

h1, h2 {
    margin-top: 0;
    color: #111827;
}

label {
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
}

button,
.button {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: #2563eb;
    color: white;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

button:hover,
.button:hover {
    background: #1d4ed8;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.table th,
.table td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    text-align: left;
}

.table th {
    background: #f3f4f6;
    font-weight: 600;
}

/* Ενοποιημένα .badge */
.badge {
    display: inline-block;
    padding: 3px 8px; /* Προτιμάται η πιο λεπτομερής τιμή (3px 8px) */
    border-radius: 999px;
    font-size: 11px;
    background: #e5e7eb;
    color: #374151; /* Προστέθηκε η ιδιότητα color από το δεύτερο block */
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Layout γύρω από τη σελίδα */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.page-subtitle {
    margin-top: 4px;
    font-size: 14px;
    color: #6b7280;
}

/* Μπάρα φίλτρων */
.filters-bar {
    display: flex;
    justify-content: space-between; /* εργοστάσιο αριστερά, τα άλλα δεξιά */
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filter-group {
    min-width: 220px;
}

.filters-right {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}


.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

/* Grid layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
}

.card-full {
    margin-top: 10px;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 16px;
    margin: 0;
}

.card-body {
    padding: 12px 16px 16px;
}

/* Forms */
.form-vertical label {
    font-size: 13px;
    font-weight: 500;
}

.form-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

/* Text helpers */
.muted {
    color: #9ca3af;
    font-size: 14px;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Status για Μέσα / Εκτός */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge-inside {
    background: #dcfce7;
    color: #166534;
}

.status-badge-out {
    background: #fee2e2;
    color: #991b1b;
}

/* Buttons (επέκταση) */
.button-small {
    padding: 5px 10px;
    font-size: 12px;
}

.button-secondary {
    background: #6b7280;
}

.button-secondary:hover {
    background: #4b5563;
}

.button-danger {
    background: #dc2626;
}

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

/* Pagination */
.pagination {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-info {
    font-size: 13px;
    color: #6b7280;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.small {
    font-size: 12px;
}

/* ρόλος badges */
.tag-role {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}

.tag-role-admin {
    background: #dbeafe;
    color: #1d4ed8;
}

.tag-role-guard {
    background: #fef3c7;
    color: #92400e;
}

/* alerts */
.alert {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-error ul {
    margin: 0;
    padding-left: 18px;
}

/* Dashboard metric tiles */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 14px 16px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.metric-value {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
}

.metric-footer {
    font-size: 12px;
    color: #9ca3af;
}

/* Quick links row */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-badge-active {
    background: #dcfce7;
    color: #166534;
}

.status-badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Ενοποιημένα .active-link */
.active-link {
    color: #1d4ed8;
    font-weight: 600;
    border-bottom: 2px solid #1d4ed8; /* Κράτησε την πιο λεπτομερή δήλωση */
}

.app-footer {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    padding: 16px 0;
    margin-top: 40px;
    border-top: 1px solid #e5e7eb;
}

/* --- Media Queries --- */

@media (max-width: 1024px) {
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Ενοποιήθηκαν οι όροι για max-width: 900px */
@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-right {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    /* Header */
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .app-header-right {
        font-size: 13px;
    }

    /* Container */
    .app-container {
        margin: 8px;
        padding: 12px;
        border-radius: 0;
        box-shadow: none;
    }

    /* Φίλτρα */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-right {
        flex-direction: column;
        align-items: stretch;
        width: 100%; /* Προέρχεται από το δεύτερο block */
    }

    .filter-group {
        min-width: 100%;
    }

    .filter-actions {
        justify-content: flex-start;
        width: 100%; /* Προέρχεται από το δεύτερο block */
    }

    .filter-actions .button,
    .filter-actions .button-secondary {
        width: 100%;
        text-align: center;
    }

    /* Δύο panels → μία στήλη */
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .form-vertical.grid-2 { /* Συμπεριλήφθηκε το mobile tweak για τη φόρμα */
        display: block;
    }

    .form-vertical.grid-2 > div {
        margin-bottom: 12px;
    }

    .card {
        margin-bottom: 10px;
    }

    /* Πίνακες με οριζόντιο scroll */
    .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .table th,
    .table td {
        white-space: nowrap;
    }

    /* Τίτλοι λίγο μικρότεροι */
    h1 {
        font-size: 20px;
    }

    .card-header h2 {
        font-size: 15px;
    }
}

@media (max-width: 640px) {
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .quick-links {
        flex-direction: column;
    }

    .quick-links .button {
        width: 100%;
        text-align: center;
    }
}

.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    padding: 16px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
}

.login-logo-area {
    text-align: center;
    padding-top: 12px;
    padding-bottom: 4px;
}

.login-title {
    margin: 6px 0 0;
    font-size: 22px;
}

.login-subtitle {
    margin: 2px 0 10px;
    font-size: 13px;
    color: #6b7280;
}

.login-footer {
    padding: 10px 16px 14px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

/* alerts – αν δεν τα έχεις ήδη */
.alert {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Export filters – 4 στήλες στη σειρά */
.filters-bar-export {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: flex-end;
}

/* Ευθυγράμμιση του κουμπιού με τα inputs */
.filter-actions-export {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

/* Mobile: τα κάνουμε στήλη */
@media (max-width: 900px) {
    .filters-bar-export {
        grid-template-columns: 1fr;
    }

    .filter-actions-export {
        justify-content: stretch;
    }

    .filter-actions-export .button {
        width: 100%;
        text-align: center;
    }
}
