/* ============================================================
   GLOBAL RESET
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ============================================================
   BODY
============================================================ */
body {
    background: #f0f2f5;
    color: #222;
    min-height: 100vh;
}

/* ============================================================
   LOGIN / REGISTER FORM CONTAINERS
============================================================ */
.container {
    width: 100%;
    max-width: 450px;
    margin: 60px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* ============================================================
   HEADINGS
============================================================ */
h1, h2, h3 {
    margin-bottom: 20px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* ============================================================
   FORM ELEMENTS
============================================================ */
form label {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: #444;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 15px;
    transition: border 0.2s ease;
}

input:focus, select:focus {
    border-color: #007bff;
    outline: none;
}

/* ============================================================
   BUTTONS
============================================================ */
button, .button-primary, .btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
    text-decoration: none;
}

button:hover, .button-primary:hover, .btn:hover {
    background: #0056c7;
}

/* ============================================================
   LINKS
============================================================ */
a {
    display: inline-block;
    margin-top: 10px;
    color: #007bff;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   ALERTS
============================================================ */
.alert-box {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
}

.alert-error {
    background:#ffe5e5;
    border-left:5px solid #d60000;
    color:#a30000;
}

.alert-success {
    background:#e5ffe8;
    border-left:5px solid #00a63c;
    color:#007f2b;
}

.alert-warning {
    background:#fff6d9;
    border-left:5px solid #ffb300;
    color:#8a6500;
}

/* ============================================================
   ADMIN SIDEBAR (Left-Aligned Version)
============================================================ */

.admin-sidebar {
    width: 240px;
    background: #1c1c1c;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
}

/* ===== Logo Section (Centered) ===== */
.sidebar-logo {
    padding: 20px 0 15px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    text-align: center; /* centers the logo */
}

.sidebar-logo img {
    max-width: 180px;
    height: auto;
    display: inline-block; /* ensures proper centering */
}


/* ===== Navigation ===== */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 18px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    text-align: left;
    border-radius: 0px;
    transition: background 0.2s ease, padding-left 0.2s ease;
}

/* Hover effect (cleaner) */
.sidebar-nav li a:hover {
    background: rgba(255,255,255,0.08);
    padding-left: 22px;
}

/* ===== Spacing between items ===== */
.sidebar-nav li {
    margin: 3px 0;
}

/* ===== Divider Above Logout ===== */
.sidebar-nav li.logout {
    margin-top: auto; /* pushes logout to the bottom */
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

/* Logout button */
.sidebar-nav li.logout a {
    background: #b30000;
    color: #fff !important;
    text-align: left;
    border-radius: 0px;
}

.sidebar-nav li.logout a:hover {
    background: #cc0000;
    padding-left: 18px; /* keeps alignment */
}


/* ============================================================
   HEADER
============================================================ */
.admin-header {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    height: 60px;
    background:#fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
}

/* ============================================================
   MAIN CONTENT
============================================================ */
.admin-main {
    margin-left: 240px;
    margin-top: 60px;
    padding: 20px;
}

/* ============================================================
   TABLES
============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

table thead {
    background: #f7f7f7;
}

table th, table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

table tr:hover {
    background: #f1f1f1;
}

/* ============================================================
   DASHBOARD CARDS
============================================================ */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: #fff;
    padding: 25px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.dashboard-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #555;
}

.dashboard-card p {
    font-size: 2rem;
    margin: 0;
    font-weight: bold;
    color: #111;
}

/* Cards responsive */
@media (max-width: 1000px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ============================================================
   FILTER BAR
============================================================ */
.filter-bar {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

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

.filter-group input,
.filter-group select {
    min-width: 180px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    align-items: center;
}

/* Colors per module */
.module-expenses      { background:#d1fae5; color:#065f46; } /* green */
.module-invoices      { background:#dbeafe; color:#1d4ed8; } /* blue */
.module-cog_index     { background:#fee2e2; color:#b91c1c; } /* red */

/* fallback for unknown modules */
.module-generic       { background:#e5e7eb; color:#374151; }

.module-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 6px;
    cursor: pointer;
    position: relative;
}

/* Tooltip */
.module-dot:hover::after {
    content: attr(data-title);
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 20;
    opacity: 0.95;
}

/* Colours per module */
.module-expenses  { background:#10b981; } /* emerald */
.module-invoices  { background:#3b82f6; } /* blue */
.module-cog_index { background:#ef4444; } /* red */

/* fallback */
.module-generic   { background:#6b7280; } /* gray */

.tag.company_admin {
    background: #fde68a; /* amber / gold */
    color: #92400e;      /* deep amber/brown text */
}

/* =======================
   LOGIN PAGE LAYOUT
======================= */

.login-container {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    display: flex;
    height: 100vh;
    width: 100%;
    background: #ffffff;
    text-align: left;
}

/* LEFT SIDE */
.login-left {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-box {
    max-width: 380px;
    width: 100%;
    text-align: left !important; /* FORCE LEFT ALIGN */
}

.login-box h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: left !important; /* HARD OVERRIDE */
}

/* INPUTS */
.login-box label {
    font-size: 14px;
    font-weight: 500;
}

.login-box input[type=email],
.login-box input[type=password] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d2d6dc;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 15px;
}

/* BUTTON */
.login-box button {
    width: 100%;
    padding: 12px;
    background: #2573d5;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    color: white;
    cursor: pointer;
    margin-top: 10px;
}

.login-box button:hover {
    background: #1d5fb1;
}

/* RIGHT SIDE BACKGROUND */
.login-right {
    width: 50%;
    height: 100vh;
    background-image: url('/assets/images/background1.avif'); /* actual file name */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.9);
}

/* HIDE ELEMENTS YOU DON'T WANT */
.remember-me,
.forgot-password,
.register-link,
.social-login {
    display: none !important;
}

/* MOBILE */
@media (max-width: 900px) {
    .login-right {
        display: none;
    }
    .login-left {
        width: 100%;
    }
}

/* ================================
   POLISHED LOGIN DESIGN
================================ */

/* =======================
   LOGIN PAGE LAYOUT
======================= */

.login-container {
    display: flex;
    height: 100vh;
    width: 100%;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* LEFT SIDE */
.login-left {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: #ffffff;
}

.login-box {
    max-width: 380px;
    width: 100%;
    text-align: left !important;
}

.login-box img {
    height: 100px !important;
    margin-bottom: 30px;
}

.login-box h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: left !important;
}

/* INPUTS */
.login-box label {
    font-size: 14px;
    font-weight: 500;
}

.login-box input[type=email],
.login-box input[type=password] {
    width: 100%;
    padding: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    margin-bottom: 18px;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.login-box input:focus {
    border-color: #2573d5;
    box-shadow: 0 0 8px rgba(37, 115, 213, 0.25);
}

/* PASSWORD TOGGLE */
.password-wrapper {
    position: relative;
}

#togglePassword {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: color 0.2s ease;
}

#togglePassword:hover,
#togglePassword.active {
    color: #2573d5;
}

/* BUTTON */
.login-box button {
    width: 100%;
    padding: 14px;
    background: #2573d5;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    color: white;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.login-box button:hover {
    background: #1d5fb1;
    transform: translateY(-2px);
}

/* RIGHT SIDE BACKGROUND */
.login-right {
    width: 50%;
    height: 100vh;
    background-image: url('/assets/images/background2.webp');
    background-size: cover;
    background-position: center;
    position: relative;
}

.login-right::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom right,
        rgba(0,0,0,0.25),
        rgba(0,0,0,0.45)
    );
    pointer-events: none;
}

/* HIDE UNUSED ELEMENTS */
.remember-me,
.forgot-password,
.register-link,
.social-login {
    display: none !important;
}

/* =======================
   MOBILE OPTIMISATION
======================= */

@media (max-width: 900px) {
    .login-right { display: none; }
    .login-left { width: 100%; padding: 30px; }

    .login-box img { height: 80px !important; }
    .login-box h1 { font-size: 22px; }
}

.login-extra {
    margin-top: 18px;
    font-size: 14px;
    color: #555;
}

.login-extra a {
    color: #2573d5;
    text-decoration: none;
    font-weight: 600;
}

.login-extra a:hover {
    text-decoration: underline;
}

