/* Global styles for Imani Libya */
html,
body {
    font-family: Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

/* Header styles (post-login) */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.site-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.site-header .logo {
    width: 25%;
    max-width: 120px;
    height: auto;
}

.site-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: normal;
}

.site-header .header-right {
    display: flex;
    gap: 18px;
}

.site-header .header-right a {
    text-decoration: none;
    color: #007bff;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.site-header .header-right a:hover {
    background: #e9ecef;
}

.site-header .header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.site-header .barcode-img {
    height: 60px;
    /* Adjust size to fit header nicely */
    width: auto;
}

.site-header .barcode-label {
    font-size: 10px;
    color: #333;
    margin-top: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Main content area */
.main-content {
    padding: 24px;
}

.home-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Basic centering and layout for the login view */
.auth-container {
    max-width: 420px;
    margin: 6vh auto;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: #fff;
}

.auth-logo {
    text-align: center;
    margin-bottom: 12px;
}

.auth-logo img {
    width: 50%;
    height: auto;
}

.auth-heading {
    text-align: center;
    margin: 12px 0 18px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.btn-login {
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.btn-login:hover {
    background: #0069d9;
}

.alert {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Change Password View */
.change-password-container {
    max-width: 480px;
    margin: 6vh auto;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: #fff;
}

.change-password-box {
    text-align: center;
}

.change-password-box .logo {
    width: 50%;
    height: auto;
    margin-bottom: 12px;
}

.change-password-box h1 {
    margin: 12px 0 8px;
}

.change-password-box h2 {
    font-size: 1.25rem;
    color: #495057;
    margin: 8px 0;
}

.info-text {
    color: #6c757d;
    margin-bottom: 18px;
}

.password-requirements {
    text-align: left;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin: 12px 0;
}

.password-requirements p {
    margin: 0 0 8px;
}

.password-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.password-requirements li {
    font-size: 14px;
    line-height: 1.6;
}

.btn-submit {
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: #28a745;
    color: #fff;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 8px;
}

.btn-submit:hover {
    background: #218838;
}

/* User Management Styles */
.users-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.users-container h1 {
    margin: 0 0 18px;
}

.success-message {
    padding: 12px;
    margin-bottom: 18px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.error-message {
    padding: 12px;
    margin-bottom: 18px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.error-message ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.error-message li {
    margin-bottom: 4px;
}

/* Users Controls */
.users-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}

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

.filters label {
    font-weight: 600;
    margin-right: 4px;
}

.filters select {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.btn-create,
.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-create:hover,
.btn-primary:hover {
    background: #0069d9;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

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

/* Users Table */
.users-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.users-table thead {
    background: #f8f9fa;
}

.users-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.users-table th a {
    text-decoration: none;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 6px;
}

.users-table th a:hover {
    color: #007bff;
}

.sort-indicator {
    font-size: 12px;
}

.users-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.user-row:hover {
    background: #f8f9fa;
}

.user-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.user-link:hover {
    text-decoration: underline;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.no-results {
    text-align: center;
    color: #6c757d;
    padding: 24px !important;
}

/* User Form */
.user-form {
    max-width: 600px;
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-form .form-group {
    margin-bottom: 18px;
}

.user-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.required {
    color: #dc3545;
}

.user-form input[type="text"],
.user-form input[type="password"],
.user-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-family: Verdana, sans-serif;
}

.disabled-input {
    background: #e9ecef;
    cursor: not-allowed;
}

.help-text {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.info-box {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 12px;
    margin: 18px 0;
}

.info-box p {
    margin: 8px 0;
}

.info-box ul {
    margin: 8px 0;
    padding-left: 20px;
}

.note {
    font-size: 13px;
    color: #0c5460;
    font-style: italic;
}

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

/* Responsive nav for smaller screens */
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-header .header-right {
        margin-top: 12px;
    }

    .users-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .filters select {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Generic Table Styles (Locations etc) */
.table {
    width: 100%;
    min-width: 50%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

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

.table th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: #e2e6ea;
    cursor: default;
}

/* Catalog Styles */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.catalog-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

.catalog-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    fill: #007bff;
}

.catalog-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}