/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* Basic Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f6f9;
    color: #333;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

/* Sidebar (Premium & Collapsed) */
.sidebar {
    width: 260px;
    background-color: #001a35;
    /* Dark Navy Premium */
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: width 0.3s ease;
    overflow-x: hidden;
    z-index: 50;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px 20px 10px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: #f39c12;
    /* Accent Color */
    font-size: 1.2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background 0.2s;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.logo-text-group {
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
}

.logo-main {
    font-size: 20px;
    font-weight: 800;
    color: #f39c12;
    line-height: 1;
    letter-spacing: -0.5px;
}

.logo-sub {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.user-profile-compact {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.3s ease;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    transition: opacity 0.2s;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.user-status {
    font-size: 11px;
    color: #2ecc71;
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu-label {
    padding: 15px 25px 5px;
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.menu-list,
.menu-footer ul {
    list-style: none;
    padding: 0 10px;
}

.menu-list li,
.menu-footer li {
    margin-bottom: 4px;
}

.menu-list a,
.menu-footer a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 12px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.menu-list a i,
.menu-footer a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.menu-list li:hover a {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.menu-list li.active a {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0) 100%);
    color: #60a5fa;
    /* Light Blue */
    font-weight: 600;
}

.menu-list li.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 3px;
    background: #3b82f6;
    /* Accent Bar */
    border-radius: 0 4px 4px 0;
}

.menu-footer {
    margin-top: auto;
    padding-bottom: 20px;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    /* Red hover for logout */
}

/* --- Collapsed State --- */
body.sidebar-collapsed .sidebar {
    width: 80px;
}

body.sidebar-collapsed .logo-text-group,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .link-text,
body.sidebar-collapsed .menu-label {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    position: absolute;
    /* Remove from flow */
    pointer-events: none;
}

body.sidebar-collapsed .logo-area {
    justify-content: center;
}

body.sidebar-collapsed .user-profile-compact {
    padding: 20px 0;
    justify-content: center;
    border-bottom: none;
}

body.sidebar-collapsed .menu-list a,
body.sidebar-collapsed .menu-footer a {
    justify-content: center;
    padding: 15px;
    /* Larger hit area */
}

body.sidebar-collapsed .menu-list li.active a::before {
    display: none;
    /* Hide accent bar in collapsed mode or adjust */
    /* Or keep it but smaller? Let's hide it for cleaner icon look */
}

body.sidebar-collapsed .menu-list li.active a {
    background: rgba(37, 99, 235, 0.2);
    border-radius: 12px;
}

/* Main Content (Admin Panel) */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background-color: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #d2d6de;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h2 {
    font-size: 18px;
    font-weight: 400;
    margin: 0;
}

.page-title span {
    font-size: 12px;
    color: #777;
}

.content-wrapper {
    padding: 20px;
}

/* Action Buttons */
.btn-orange {
    background-color: #f39c12;
    /* Orange */
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-orange:hover {
    background-color: #e67e22;
}

.btn-red {
    background-color: #e74c3c;
    /* Red/Pink */
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-red:hover {
    background-color: #c0392b;
}

.btn-blue {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

/* Filters */
.filters-bar {
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex-grow: 0.5;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-count {
    color: #777;
    font-size: 14px;
    margin-right: 10px;
}

/* Table */
.table-container {
    background: #fff;
    margin-top: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    background-color: #fff;
    color: #333;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #f4f4f4;
    font-size: 13px;
    text-transform: uppercase;
}

.custom-table td {
    padding: 12px;
    border-bottom: 1px solid #f4f4f4;
    font-size: 13px;
    vertical-align: middle;
}

.parent-row {
    background-color: #fff;
}

.child-row {
    background-color: #fcfcfc;
}

.child-row td {
    border-top: none;
    padding-top: 5px;
    padding-bottom: 15px;
}

.detail-table {
    width: 95%;
    margin-left: auto;
    border-collapse: collapse;
}

.detail-table th {
    font-size: 11px;
    color: #666;
    border-bottom: 1px solid #eee;
    padding: 5px;
    text-transform: capitalize;
}

.detail-table td {
    font-size: 12px;
    color: #555;
    padding: 8px 5px;
    border-bottom: 1px solid #eee;
}

/* Utility */
.icon-toggle {
    color: #007bff;
    cursor: pointer;
    margin-right: 8px;
    font-weight: bold;
}

/* Login Page Redesign */
.login-body {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    align-items: stretch;
    justify-content: center;
}

.login-left {
    width: 60%;
    /* Flex child stretches automatically, just need to manage internal content */
    background: linear-gradient(135deg, #001f3f 0%, #003366 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    padding: 4rem;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Abstract shapes for premium feel */
.login-left::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(243, 156, 18, 0.1) 0%, rgba(243, 156, 18, 0) 60%);
    border-radius: 50%;
}

.login-right {
    width: 40%;
    /* Remove height: 100% so it behaves properly as a stretched flex item */
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    /* More internal breathing room */
    background: #fff;
    border-radius: 12px;
    /* Remove shadow if on white, add if on gray. Here on white right panel, no shadow needed or very subtle */
    /* box-shadow: 0 10px 40px rgba(0,0,0,0.05); */
}

.login-logo-container {
    margin-bottom: 2rem;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 180px;
    height: 180px;
}

.login-logo-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

/* Custom Logo placeholder with FontAwesome or logic */
.login-logo-circle i {
    font-size: 60px;
    color: #fff;
}

.gk-title-box {
    background-color: #f39c12;
    padding: 5px 20px;
    border-radius: 4px;
    margin-bottom: 30px;
    color: #fff;
    font-weight: bold;
    font-size: 1.5rem;
    display: inline-block;
    /* Removed for logo image replacement context, but keeping if still used or clean up */
    display: none;
}

.slogan-main {
    font-size: 2.5rem;
    /* Increased size */
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.slogan-sub {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.login-header {
    margin-bottom: 1rem;
    /* Reduced from 2rem */
    text-align: center;
}

.login-header h2 {
    font-weight: 700;
    color: #001f3f;
    margin-bottom: 0.2rem;
    font-size: 1.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.85rem;
}

.login-header a,
.login-form-wrapper a {
    color: #f39c12;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-header a:hover,
.login-form-wrapper a:hover {
    color: #e67e22;
    text-decoration: underline;
}

.role-toggle {
    display: flex;
    gap: 15px;
    margin-bottom: 1.2rem;
    /* Reduced from 2rem */
    justify-content: center;
    /* Centered */
}

.role-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: #999;
    padding: 6px 16px;
    border: 1px solid transparent;
    border-radius: 30px;
    transition: all 0.3s;
}

.role-option:hover {
    color: #555;
    background-color: #f8f9fa;
}

.role-option.active {
    color: #f39c12;
    background-color: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
}

.role-option i {
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 1.2rem;
    position: relative;
    text-align: left;
    /* Reverting to professional alignment */
}

/* Floating Label Style Attempt (Simulated via standard structure) */
.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-left: 2px;
}

.input-styled {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dfe1e6;
    background-color: #f9fafb;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #333;
    outline: none;
    transition: all 0.25s ease;
    text-align: left;
    /* Professional alignment */
}

.input-styled {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    /* Very subtle border */
    background-color: #ffffff;
    /* Clean white */
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
    outline: none;
    transition: all 0.25s ease;
    text-align: left;
    font-weight: 500;
}

.input-styled:focus {
    background-color: #ffffff;
    border-color: #f39c12;
    /* Brand accent focus */
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.1);
    /* Soft glow */
}

.input-styled::placeholder {
    color: #bbb;
    font-weight: 400;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        z-index: 1000;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        /* Hidden by default */
        transition: transform 0.3s ease-in-out;
        width: 260px;
        /* Fixed width on mobile */
    }

    .sidebar.active {
        transform: translateX(0);
        /* Slide in */
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
    }

    body.sidebar-collapsed .sidebar {
        /* On mobile, collapse logic shouldn't interfere with off-canvas behavior usually, 
           but if user toggles collapse on desktop then resizes, it might be weird. 
           Let's override collapse width on mobile to be full standard width if active. */
        width: 260px;
    }

    /* Ensure content doesn't have margin left on mobile */
    .w-full.md\:ml-0,
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 900;
        display: none;
        /* Hidden by default */
        opacity: 0;
        transition: opacity 0.3s;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block !important;
        /* Force show */
        opacity: 1;
    }
}

/* SweetAlert Minimalist Override (Image Match) */
.swal-minimal-popup {
    font-family: 'Poppins', sans-serif !important;
    font-size: 0.9rem !important;
    padding: 2rem !important;
    border-radius: 24px !important;
    /* Highly rounded as in image */
    width: 22rem !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #f1f5f9 !important;
    background: #ffffff !important;
}

.swal-minimal-btn {
    background-color: #5D5FEF !important;
    /* Indigo from typical modern designs */
    color: white !important;
    border-radius: 12px !important;
    padding: 10px 30px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    box-shadow: 0 4px 12px rgba(93, 95, 239, 0.3) !important;
    border: none !important;
    outline: none !important;
    transition: all 0.2s ease;
}

.swal-minimal-btn:hover {
    background-color: #4b4dce !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(93, 95, 239, 0.4) !important;
}

.swal2-title {
    color: #1e293b !important;
    /* Dark slate */
    font-weight: 700 !important;
}

.swal2-html-container {
    color: #64748b !important;
    /* Muted slate */
}

.swal2-title.swal-minimal-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 0.5rem !important;
}

/* Target the icon within our minimal popup */
.swal-minimal-popup .swal2-icon {
    transform: scale(0.7) !important;
    margin: 0 auto 1rem !important;
}

.swal2-html-container {
    font-size: 0.9rem !important;
    color: #64748b !important;
    margin: 0 !important;
}

.swal-minimal-btn {
    padding: 8px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    box-shadow: none !important;
    margin: 0 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.swal2-actions {
    margin-top: 1.2rem !important;
    gap: 0.5rem !important;
    width: 100% !important;
    justify-content: center !important;
}

.btn-login {
    width: 100%;
    background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
    padding: 14px;
    border: none;
    border-radius: 8px;
    /* Slightly more rounded */
    font-family: 'Poppins', sans-serif;
    /* Explicitly set */
    font-size: 1rem;
    /* Larger */
    font-weight: 800;
    /* Extra Bold */
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1.5rem;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    /* More spacing */
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(230, 126, 34, 0.35);
}

.btn-login:hover {
    background-color: #e67e22;
}

.or-divider {
    text-align: center;
    margin: 1.5rem 0;
    color: #aaa;
    font-size: 0.9rem;
}

.btn-register {
    width: 100%;
    background-color: #f4f6f9;
    color: #555;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-register:hover {
    background-color: #e9ecef;
}

@media (max-width: 768px) {
    .login-left {
        display: none;
    }

    .login-right {
        width: 100%;
        padding: 1rem !important;
    }

    .login-form-wrapper {
        padding: 1.5rem !important;
        box-shadow: none;
    }

    .login-logo-container {
        width: 120px;
        height: 120px;
        margin-bottom: 1rem;
        padding: 10px;
    }

    .login-header {
        margin-bottom: 0.5rem;
    }

    .role-toggle {
        margin-bottom: 1rem;
    }
}

/* Google Maps Autocomplete Correction & Styling */
.pac-container {
    z-index: 2000000 !important;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: none;
    font-family: 'Poppins', sans-serif;
    margin-top: 2px;
}

.pac-item {
    padding: 12px 16px;
    font-size: 13px;
    cursor: pointer;
    border-top: 1px solid #f1f5f9;
}

.pac-item:first-child {
    border-top: none;
}

.pac-item:hover {
    background-color: #f8fafc;
}

.pac-item-query {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.pac-icon {
    margin-top: 2px;
}