/* --- Urban Light & Modern Theme --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #f1f5f9;        /* Light Slate Gray */
    --card-bg: #ffffff;        /* Pure White */
    --primary-blue: #2563eb;   /* Modern Royal Blue */
    --text-main: #1e293b;      /* Dark Slate Text */
    --text-dim: #64748b;       /* Muted Slate */
    --border-color: #e2e8f0;   /* Soft Border */
    --error-red: #ef4444;
    --success-green: #22c55e;
    --sidebar-width: 240px;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* --- Layout Structure --- */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 800px; /* Increased from 450px to 800px */
    width: 95%;      /* Responsive width */
    margin: 2rem auto;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

/* --- Top Bar / Header --- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.welcome-text { font-weight: 600; color: var(--primary-blue); }
.logo {
    grid-column: 2; /* Forces logo to the middle column */
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.logout-link {
    grid-column: 3;
    justify-self: end; /* Keeps login/logout on the far right */
}
/* --- Sidebar Navigation --- */
.nav-sidebar {
    width: var(--sidebar-width);
    background-color: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    height: calc(100vh - 65px);
    position: sticky;
    top: 65px;
}

.nav-sidebar ul { list-style: none; }

.nav-sidebar li { margin-bottom: 0.25rem; }

.nav-sidebar a {
    text-decoration: none;
    color: var(--text-dim);
    padding: 0.6rem 1rem;
    display: block;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-sidebar a:hover {
    background: #eef2ff;
    color: var(--primary-blue);
}

/* --- Search Bar --- */
.search-bar {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.search-bar input[type="search"] {
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    color: var(--text-main);
    width: 250px;
}

.search-bar button {
    background: var(--primary-blue);
    border: none;
    color: white;
    padding: 0 1rem;
    cursor: pointer;
}

/* --- Login/Main Container --- */
.container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    margin: 4rem auto;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}


h2 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    letter-spacing: -0.025em;
    text-align: center;
}

/* --- Modern Form Elements --- */
label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}

input[type="text"], 
input[type="password"], 
select, 
textarea {
    width: 100%;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    margin-bottom: 1.25rem;
}

input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="submit"] {
    width: 100%;
    background: var(--primary-blue);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="submit"]:hover { background: #1d4ed8; }

/* --- Table Styles --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1rem;
}

th {
    background: #f8fafc;
    text-align: left;
    padding: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

/* --- Mobile Styling --- */
@media (max-width: 768px) {
    .content-container { flex-direction: column; }
    
    .nav-sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 0.75rem;
        display: flex;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-sidebar ul { display: flex; gap: 8px; }

    .top-bar {
    display: grid; /* Changed to grid for better centering */
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.75rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}
    
    .search-bar { width: 100%; margin-top: 10px; }
}