/* ================= GENERAL ================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease;
}

body.dark {
    background-color: #2f3542;
    color: #f1f2f6;
}

.dashboard {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: 250px;
    background-color: #1e272e;
    color: #fff;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sidebar.open {
    width: 250px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #1e272e;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease;
    border-radius: 6px;
}

.sidebar-menu li a:hover {
    background-color: #57606f;
}

.sidebar-menu .icon {
    margin-right: 0.8rem;
}

/* ================= MAIN CONTENT ================= */
.main-content {
    flex: 1;
    padding: 1.5rem;
    transition: margin-left 0.3s ease;
    min-width: 0;
}

/* ================= TOPBAR ================= */
.topbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.hamburger, .dark-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

/* ================= ADMIN CARD ================= */
.admin-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    width: 100%;
    overflow-x: auto;
}

body.dark .admin-card {
    background-color: #404756;
}

/* ================= CARD HEADER ================= */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.header-badge {
    background-color: #ffa502;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ================= FORM GRID ================= */
.modern-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-group {
    position: relative;
    margin-top: 1.5rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.8rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: none;
    outline: none;
    font-size: 0.95rem;
    transition: border 0.2s;
}

body.dark .input-group input,
body.dark .input-group select {
    border-color: #60656f;
    color: #f1f2f6;
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 0.6rem;
    transform: translateY(-50%);
    background-color: #fff;
    padding: 0 0.25rem;
    color: #666;
    pointer-events: none;
    transition: 0.2s ease all;
}

body.dark .input-group label {
    background-color: #404756;
    color: #ccc;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label,
.input-group select:focus + label,
.input-group select:not([value=""]) + label {
    top: -0.6rem;
    font-size: 0.75rem;
    color: #ffa502;
}

.select-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

/* ================= PASSWORD TOGGLE ================= */
.toggle-password {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ffa502;
    cursor: pointer;
}

/* ================= BUTTONS ================= */
.btn-modern {
    background-color: #ffa502;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.btn-modern:hover {
    background-color: #e59402;
}

.btn-outline {
    border: 1px solid #ffa502;
    background: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: #ffa502;
    font-weight: bold;
    cursor: pointer;
    margin-top: 0.5rem;
}

.btn-outline:hover {
    background-color: #ffa502;
    color: #fff;
}

/* ================= UPLOAD STATUS ================= */
.status {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.status.uploading {
    color: #ff4757;
}

/* ================= TABLE ================= */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    display: block;
    overflow-x: auto;
}

.modern-table th,
.modern-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ccc;
    min-width: 100px;
}

body.dark .modern-table th,
body.dark .modern-table td {
    border-color: #60656f;
}

.modern-table th {
    background-color: #f1f2f6;
}

body.dark .modern-table th {
    background-color: #404756;
}

/* ================= PAGINATION ================= */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    gap: 0.5rem;
}

.pagination button {
    padding: 0.5rem 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #ffa502;
    color: #fff;
    transition: 0.2s;
}

.pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.pagination span {
    font-weight: bold;
}

/* ================= TRANSITIONS ================= */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= SEARCH BOX ================= */
.search-box {
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-bottom: 0.8rem;
    width: 100%;
    max-width: 250px;
    font-size: 0.95rem;
}

body.dark .search-box {
    border-color: #60656f;
    background-color: #404756;
    color: #f1f2f6;
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 1024px) {
    .modern-form .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        position: absolute;
        top: 0;
        left: -250px;
        height: 100%;
        z-index: 1000;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 1rem;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .pagination {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 200px;
    }

    .btn-modern,
    .btn-outline {
        width: 100%;
    }

    .upload-section {
        flex-direction: column;
    }

    .modern-table th,
    .modern-table td {
        min-width: 80px;
    }
}

.sidebar-email {
    font-size: 0.9rem;
    color: #ccc;
    margin-top: 4px;
    display: block;
}


.account-icon {
    font-size: 1rem;      /* slightly bigger for visibility */
}


/* Sidebar default */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background-color: #1e1e2f;
    color: #fff;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Collapsed state */
.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    position: relative;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.sidebar-email {
    font-size: 0.85rem;
    color: #ccc;
    margin-top: 4px;
    word-break: break-all;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

/* Menu styling */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.sidebar-menu li {
    margin: 0.5rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    text-decoration: none;
    color: #fff;
    transition: background 0.2s;
}

.sidebar-menu a:hover {
    background-color: #2e2e4d;
}

.sidebar-menu .icon {
    margin-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        transition: margin-left 0.3s;
    }
}

@media (min-width: 769px) {
    .main-content {
        margin-left: 250px;
        transition: margin-left 0.3s;
    }

    .sidebar.collapsed + .main-content {
        margin-left: 60px;
    }
}


.change-password-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}


.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); }
}

.date-input {
    width: 100%;
    padding: 10px;
    border: none;
    outline: none;
    background: transparent;
}


.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
}

.btn-success {
    background-color: #28a745;
    color: white;
    border: none;
}

.btn-warning {
    background-color: #ffc107;
    color: black;
    border: none;
}

.btn-primary {
    background-color: #0d6efd;
    color: white;
    border: none;
}
