/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ===== Content width constraints (avoid stretched settings/forms) ===== */
#page-content {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 1024px) {
    #page-content { max-width: 100%; }
}
@media (min-width: 600px) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        max-width: 520px;
    }
    .btn:not(.btn-block) { width: auto; }
}

/* ===== Mobile/Tablet layout (hamburger + right drawer) ===== */
.topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e2e4e8;
    z-index: 1200;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}
.topbar-brand { font-weight: 800; color: #1B1C3C; letter-spacing: 0.2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-user {
    font-size: 13px;
    color: #555;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-burger {
    width: 42px;
    height: 42px;
    border: 1px solid #e2e4e8;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
}
.topbar-burger span { width: 18px; height: 2px; background: #1B1C3C; display: block; border-radius: 2px; }

.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1300;
}
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(360px, 92vw);
    background: #1B1C3C;
    color: #fff;
    z-index: 1400;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}
.mobile-nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.mobile-nav-drawer-title { font-weight: 800; letter-spacing: 0.2px; }
.mobile-nav-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}
.mobile-nav-drawer-body { padding: 10px 0; overflow: auto; flex: 1; }
.mobile-nav-drawer .sidebar-menu, .mobile-nav-menu { list-style: none; margin: 0; padding: 0; }
.mobile-nav-drawer .sidebar-menu li a, .mobile-nav-drawer .mobile-nav-menu li a { padding: 14px 18px; }
.mobile-nav-drawer-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.12); }

body.nav-open .mobile-nav-overlay { display: block; }
body.nav-open .mobile-nav-drawer { transform: translateX(0); }

@media (max-width: 600px) {
    .topbar { display: flex; }
    .sidebar { display: none; }
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 76px;
    }
    .card { padding: 16px; }
    .data-table { display: block; overflow-x: auto; }
}

@media (max-width: 520px) {
    .main-content { padding: 12px; padding-top: 72px; }
    .topbar-user { display: none; }
    .card { padding: 14px; }
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #ffffff;
    color: #111827;
    padding: 20px 0;
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid #e5e7eb;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 6px;
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 10px;
    margin: 2px 12px;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: #f3f4f6;
    color: #111827;
}

.sidebar-menu li a.active {
    background: #eef2ff;
    color: #1d4ed8;
}

.sidebar-menu .icon {
    margin-right: 12px;
    font-size: 14px;
    width: 18px;
    text-align: center;
    color: #6b7280;
}

.sidebar-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 20px;
}

.logout-btn {
    width: 100%;
    padding: 10px 12px;
    background: #f3f4f6;
    color: #111827;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 13px;
    font-weight: 600;
}

.logout-btn:hover {
    background: #e5e7eb;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

.main-content.full-width {
    margin-left: 0;
}

/* Navigation links */
.nav-link {
    text-decoration: none;
    color: inherit;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1B1C3C 0%, #2c3e50 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    color: #1B1C3C;
}

.login-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: #1B1C3C;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 48px;
    color: #1B1C3C;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 12px;
}

.stat-icon i {
    font-size: 40px;
}

.stat-info h3 {
    font-size: 32px;
    margin-bottom: 4px;
    color: #1B1C3C;
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #1B1C3C;
    color: white;
}

.btn-primary:hover {
    background: #2a2d5a;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1B1C3C;
}

/* Task Cards */
.task-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.task-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.task-reward {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 16px;
}

.task-status {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.task-status.active {
    background: #d1ecf1;
    color: #0c5460;
}

.task-status.completed {
    background: #d4edda;
    color: #155724;
}

.task-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.task-status.draft {
    background: #fff3cd;
    color: #856404;
}

/* Search Bar */
.search-bar {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #1B1C3C;
}

/* User List */
.user-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s;
}

.user-item:hover {
    transform: translateX(4px);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1B1C3C;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

/* Top Up Form */
.top-up-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.amount-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.amount-input {
    flex: 1;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
}

.currency-selector {
    padding: 12px 16px;
    background: #f0f0f0;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.converted-amount {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
}

.converted-amount-value {
    font-size: 32px;
    font-weight: bold;
    color: #1B1C3C;
}

/* Profile */
.profile-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #1B1C3C;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 32px;
}

.profile-info h2 {
    margin-bottom: 8px;
    color: #1B1C3C;
}

.profile-info p {
    color: #666;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.menu-item:hover {
    background: #f8f9fa;
}

.menu-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1B1C3C;
}

/* Google Sign-In Button */
#google-signin-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

#google-signin-button > div {
    margin: 0 auto !important;
    display: inline-block !important;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

/* Filter Menu */
.filter-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    max-height: 70vh;
    overflow-y: auto;
}

.filter-option {
    padding: 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-option:hover {
    background: #f8f9fa;
}

.filter-option.selected {
    font-weight: 600;
    color: #1B1C3C;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
}

/* Force single navigation on tablet/mobile (hide left sidebar) */
@media (max-width: 600px) {
    .sidebar { display: none !important; }
    .topbar { display: flex !important; }
}

