/* Base layout */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111827;
    background-color: #f3f4f6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-ghost {
    background-color: transparent;
    color: #111827;
}

.btn-ghost:hover {
    background-color: rgba(15, 23, 42, 0.06);
}

.btn-full {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Login page */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, #bfdbfe 0, transparent 40%),
                radial-gradient(circle at bottom right, #fecaca 0, transparent 40%),
                #0f172a;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.login-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
    padding: 2rem;
}

.login-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
}

.login-subtitle {
    margin: 0.25rem 0 1.5rem;
    font-size: 0.95rem;
    color: #6b7280;
}

.login-form .form-group {
    margin-bottom: 1.1rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: #374151;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
}

.login-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

.password-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-field input {
    flex: 1;
}

.toggle-password {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    cursor: pointer;
}

.toggle-password:hover {
    background-color: #e5e7eb;
}

.login-footer {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #e5e7eb;
}

/* Dashboard layout */
.dashboard-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    background-color: #0f172a;
    color: #e5e7eb;
}

.brand {
    font-weight: 600;
    letter-spacing: 0.03em;
}

.user-info {
    font-size: 0.9rem;
    margin-right: 0.75rem;
}

.layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 220px;
    background-color: #111827;
    color: #9ca3af;
    padding-top: 1rem;
}

.sidebar-heading {
    margin: 0 1rem 0.75rem;
    padding-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #f9fafb;
    border-bottom: 1px solid #374151;
}

.menu {
    display: flex;
    flex-direction: column;
}

.menu-item {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
}

.menu-item:hover {
    background-color: #1f2937;
    color: #f9fafb;
}

.menu-item.active {
    background-color: #1d4ed8;
    color: #f9fafb;
}

.content {
    flex: 1;
    padding: 1.5rem;
    background-color: #f3f4f6;
}

.content h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.content p {
    margin-top: 0;
    color: #4b5563;
}

/* Filter form inline (admin pages) */
.filter-form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.filter-form-inline .form-group {
    margin-bottom: 0;
}

/* Data table & wrapper */
.table-wrapper {
    overflow-x: auto;
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.5rem;
    text-align: left;
    border-top: 1px solid #e5e7eb;
}

.data-table thead tr {
    background: #f3f4f6;
}

.data-table .table-empty {
    text-align: center;
    color: #6b7280;
    padding: 0.75rem;
}

.cell-multiline {
    white-space: pre-line;
    max-width: 220px;
    vertical-align: top;
}

/* Soft background highlights for check-in / check-out columns */
.cell-checkin {
    background-color: #eff6ff; /* very light blue */
}

.cell-checkout {
    background-color: #ecfdf3; /* very light green */
}

/* Link-style button for "View" */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover {
    color: #1d4ed8;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.modal.modal-open {
    visibility: visible;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
}

.modal-box {
    position: relative;
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.modal-title {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0 0.25rem;
}

.modal-close:hover {
    color: #111827;
}

.modal-body {
    padding: 1rem;
    overflow: auto;
}

.modal-table {
    font-size: 0.85rem;
}

.modal-table th,
.modal-table td {
    padding: 0.4rem 0.5rem;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .content {
        padding: 1rem;
    }
}

