/* ======================================
   TMS PAYROLL – GLOBAL STYLES
   ====================================== */

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
}

/* ---------- Page layout ---------- */
body {
    background: #f4f6f9;
    color: #333;
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    flex: 1;
}

/* ---------- Header ---------- */
.main-header {
    background: #1f2937;
    padding: 12px 25px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left a {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 42px;
    width: auto;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-user {
    color: #e5e7eb;
    font-size: 14px;
}

.logout-btn {
    background: #ef4444;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
}

.logout-btn:hover {
    background: #dc2626;
}

/* ---------- Containers ---------- */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 30px auto;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* Login container */
.container.login {
    max-width: 420px;
    margin: 80px auto;
    text-align: center;
}

/* ---------- Headings ---------- */
h1 {
    margin-top: 0;
    font-size: 24px;
}

h3 {
    margin-top: 0;
    font-size: 18px;
}

/* ---------- Buttons & links ---------- */
button,
.btn,
a.btn {
    background: #2563eb;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    width: auto; /* ✅ FIX */
}

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

/* Full-width buttons ONLY inside forms */
form button {
    width: 100%;
}

table a {
    color: #2563eb;
    font-size: 13px;
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

/* ---------- Forms (SAFE DEFAULT) ---------- */
form {
    display: block;
}

/* Multi-column forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

/* ---------- Form groups ---------- */
.form-group {
    width: 100%;
    margin-bottom: 15px;
}

/* ---------- Inputs ---------- */
input,
select,
textarea {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

textarea {
    resize: vertical;
}

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table th {
    background: #f1f5f9;
    padding: 10px;
    font-size: 12px;
    text-transform: uppercase;
    text-align: left;
}

table td {
    padding: 10px;
    border-top: 1px solid #e5e7eb;
}

/* ---------- Badges ---------- */
.badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
}

/* ---------- Errors ---------- */
.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
}

/* ---------- Footer ---------- */
.app-footer {
    background: #1f2937;
    color: #cbd5e1;
    font-size: 13px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left strong {
    color: #fff;
}

.footer-center,
.footer-right {
    font-size: 12px;
    color: #9ca3af;
}

.version {
    background: #111827;
    padding: 4px 8px;
    border-radius: 6px;
    color: #93c5fd;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {

    .container {
        margin: 20px;
        padding: 20px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-user {
        display: none;
    }
}
