/* ====================================================
   GLOBAL BASE STYLES
==================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #ffffff;
    color: #000000;
}

a {
    color: #2563eb;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* ====================================================
   MODERN WHITE SIDEBAR
==================================================== */
.sidebar {
    width: 260px;
    background: #ffffff;
    color: #000000;
    padding: 1.8rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    border-right: 2px solid rgba(0,0,0,0.08);
    transform: translateX(0);
    transition: transform 0.3s ease;
    box-shadow: 5px 0 20px rgba(0,0,0,0.25);
}

.sidebar.closed {
    transform: translateX(-280px);
}

/* Sidebar Logo */
.logo-box {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-img {
    width: 180px;
    height: auto;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.3));
}

.sidebar-logo {
    width: 120px;
    height: auto;
    margin: 0 auto 15px;
    display: block;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.3));
}

/* Sidebar links */
.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    color: #000000;
    transition: 0.25s ease;
    text-decoration: none;
}
.nav-link .icon {
    width: 23px;
    height: 23px;
    opacity: 0.85;
    transition: 0.25s;
    object-fit: contain;
}
.nav-link:hover {
    background: rgba(0, 170, 0, 0.15);
    color: #008f2f;
    transform: translateX(5px);
    text-decoration: none;
}
.nav-link:hover .icon {
    opacity: 1;
}

/* ====================================================
   MAIN LAYOUT
==================================================== */
.main {
    flex: 1;
    position: relative;
    padding: 1.5rem 2rem;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    background-image: url("img/dashboardbackg.jpg");
    background-size: cover;
    background-position: center;
}
.main::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: inherit;
    background-size: inherit;
    background-position: inherit;
    filter: blur(8px);
    z-index: 0;
}
.main > * {
    position: relative;
    z-index: 1;
}
.main.expanded {
    margin-left: 0;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.menu-btn {
    display: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: #000000;
}

/* Page title wrap */
.page-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.page-title-wrap h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f4d3f;
    margin: 0;
}

.page-title-logo {
    width: 80px;
    height: auto;
}

/* Logged in badge */
.logged-in-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(15, 77, 63, 0.1);
    border-radius: 8px;
    color: #0f4d3f;
}

.logged-user-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* ====================================================
   BUTTONS & CARDS
==================================================== */
.btn {
    display: inline-block;
    padding: 0.65rem 1.2rem;
    border-radius: 0.5rem;
    border: none;
    background: #2563eb;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn.secondary { background: #6b7280; }
.btn.danger { background: #dc2626; }
.btn:hover { 
    opacity: 0.9;
    transform: translateY(-1px);
}

.card {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
    color: #000;
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #000;
}

.card .number {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* ====================================================
   FORMS
==================================================== */
form .field {
    margin-bottom: 0.9rem;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.8);
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #dcdcdc;
}
form .field.full {
    grid-column: span 2;
}

form label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-weight: bold;
    color: #1d1d1d;
}

form input,
form textarea,
form select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #cfcfcf;
    font-size: 14px;
    background: #ffffff;
    color: #000000;
}

/* Form grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

/* ====================================================
   CLIENT CARD / GLASS EFFECT
==================================================== */
.client-container {
    display: flex;
    justify-content: center;
}
.client-card {
    width: 100%;
    max-width: 1100px;
    background: rgba(255,255,255,0.55);
    padding: 35px;
    border-radius: 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.4);
}

/* Section title */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 20px 0 12px;
    color: #0f4d3f;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid #dcdcdc;
    margin: 25px 0;
}

/* ====================================================
   ACCOUNT TABLE
==================================================== */
.account-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    overflow: hidden;
}
.account-table th {
    background: #0f4d3f;
    color: white;
    padding: 10px;
    font-size: 14px;
}
.account-table td {
    padding: 10px;
    border-bottom: 1px solid #e5e5e5;
}
.account-table input {
    width: 100%;
}

/* Save Button */
.save-btn {
    margin-top: 25px;
    background: #0f4d3f;
    padding: 12px 22px;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}
.save-btn:hover {
    background: #136853;
}

/* ====================================================
   ALERTS
==================================================== */
.alert {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-weight: 600;
}
.alert.success {
    background: #d5f7e4;
    color: #0f4d3f;
}
.alert.error {
    background: #ffd8d8;
    color: #b30000;
}

/* ====================================================
   MOBILE RESPONSIVE
==================================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-280px);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .menu-btn {
        display: block;
    }
    .main {
        margin-left: 0 !important;
        padding: 1rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .page-title-wrap h1 {
        font-size: 1rem;
    }
    .topbar {
        flex-wrap: wrap;
        gap: 10px;
    }
}