/* ===========================
   Dashboard Layout
=========================== */

.admin-dashboard {
    display: flex;
    min-height: 100vh;
    font-family: 'Segoe UI', sans-serif;
    background: #f3f4f6;
}

/* Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    background: linear-gradient(180deg, #4f46e5, #7c3aed);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 1000;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.menu {
    list-style: none;
    padding: 0;
}

.menu li {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.7rem;
    cursor: pointer;
    transition: 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu li:hover,
.menu li.active {
    background: rgba(255, 255, 255, 0.15);
}

.logout-btn {
    background: #ef4444;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    color: white;
    cursor: pointer;
}

/* Main */
.admin-main {
    flex: 1;
    padding: 2rem 3rem;
}

/* Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-user {
    background: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Card */
.admin-card {
    background: white;
    padding: 2rem;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.section-title {
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.password-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #4f46e5;
    cursor: pointer;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, #4f46e5, #9333ea);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 1rem;
}

.secondary-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 1rem;
}

/* Status Message */
.status-message {
    margin-top: 1.5rem;
    padding: 12px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #065f46;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {

    .admin-dashboard {
        flex-direction: column;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        width: 240px;
    }

    .admin-sidebar.open {
    transform: translateX(0);
}

    .menu {
        display: flex;
        gap: 0.5rem;
    }

    .menu li {
        margin-bottom: 0;
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .admin-main {
        margin-left: 0;
        padding: 1.5rem;
    }
}

.admin-sidebar {
    width: 240px;
    transition: width 0.3s ease;
}

.admin-sidebar.collapsed {
    width: 70px;
}

.admin-sidebar.collapsed + .admin-main {
    margin-left: 70px;
}

.collapse-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* Dark Mode */
.admin-dashboard.dark {
    background: #111827;
    color: #f9fafb;
}

.admin-dashboard.dark .admin-card,
.admin-dashboard.dark .stat-card {
    background: #1f2937;
    color: white;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.status-online {
    color: #10b981;
}

/* Table */
.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th,
.modern-table td {
    padding: 12px;
}

.pagination {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
}

/* Spinner */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ccc;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.csv-upload-container {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.popup-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

.popup-message.success { background-color: #28a745; }
.popup-message.error { background-color: #dc3545; }
.popup-message.warning { background-color: #ffc107; color: #000; }
.popup-message.info { background-color: #17a2b8; }

.close-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 15px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}



.filter-bar{
display:flex;
gap:10px;
margin-bottom:15px;
flex-wrap:wrap;
}

.popup{
position:fixed;
bottom:20px;
right:20px;
padding:15px 20px;
border-radius:8px;
color:white;
font-weight:600;
z-index:999;
}

.popup.success{background:#22c55e;}
.popup.error{background:#ef4444;}
.popup.warning{background:#f59e0b;}
.popup.info{background:#3b82f6;}

.popup button{
background:none;
border:none;
color:white;
margin-left:10px;
cursor:pointer;
}


.table-container{
overflow-x:auto;
margin-top:20px;
}

.modern-table{
width:100%;
border-collapse:collapse;
background:white;
border-radius:10px;
overflow:hidden;
}

.modern-table th{
background:#2563eb;
color:white;
padding:12px;
text-align:left;
font-size:14px;
}

.modern-table td{
padding:12px;
border-bottom:1px solid #eee;
font-size:14px;
}

.modern-table tr:hover{
background:#f4f7ff;
}

.no-data{
text-align:center;
padding:20px;
color:#888;
}

.filter-bar{
display:flex;
flex-wrap:wrap;
gap:10px;
margin-bottom:15px;
align-items:center;
}

.filter-group{
flex:1;
min-width:180px;
}

.filter-actions{
display:flex;
gap:10px;
}

.loading-box{
padding:20px;
text-align:center;
color:#777;
}


.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table thead {
    background: linear-gradient(90deg,#2563eb,#1d4ed8);
    color: white;
}

.modern-table th,
.modern-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.modern-table tr:hover {
    background-color: #f3f4f6;
}

.visible-table {
    color: #000;
}

.visible-table th {
    color: #000;
    font-weight: bold;
}

.visible-table td {
    color: #000;
}

.analytics-card{
background:white;
margin-top:30px;
padding:25px;
border-radius:14px;
box-shadow:0 8px 20px rgba(0,0,0,0.08);
}

.analytics-card h3{
margin-bottom:15px;
}

.analytics-grid{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(400px,1fr));
gap:20px;
margin-top:20px;
}

.analytics-card{
background:white;
padding:20px;
border-radius:10px;
box-shadow:0 2px 10px rgba(0,0,0,0.05);
height:350px;
}

.analytics-card canvas{
height:100% !important;
}

.zoomable-img {
    transition: transform 0.25s ease;
}

.zoomable-img:hover {
    transform: scale(1.05);
}

.image-viewer-overlay{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.85);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:2000;
}

.zoom-image{
    max-width:90%;
    max-height:90%;
    cursor:grab;
    transition: transform 0.2s ease;
}

.close-btn{
    position:absolute;
    top:25px;
    right:30px;
    font-size:30px;
    border:none;
    background:white;
    border-radius:50%;
    width:45px;
    height:45px;
    cursor:pointer;
}

.zoomable-img{
    transition: transform 0.2s;
}

.zoomable-img:hover{
    transform:scale(1.05);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}