/* Admin panel — aligned with MahaJ admin (sidebar + orange accent) */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
}

.admin-wrapper { display: flex; min-height: 100vh; background: #f5f5f5; }

.admin-sidebar {
    width: 260px;
    background: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,.1);
}
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-logo { font-size: 1.15rem; font-weight: 700; color: #fff; }
.sidebar-sub { font-size: 0.8rem; color: rgba(255,255,255,.55); margin-top: 4px; }

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.sidebar-nav .nav-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,.82);
    text-decoration: none;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
}
.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-left-color: #ff6b35;
}
.sidebar-nav .nav-item.active {
    background: rgba(255, 107, 53, .2);
    color: #fff;
    border-left-color: #ff6b35;
}

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user-name { font-size: 0.9rem; font-weight: 600; color: #fff; }
.sidebar-user-email { font-size: 0.75rem; color: rgba(255,255,255,.55); word-break: break-all; }
.sidebar-signout {
    display: block;
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(255, 107, 53, .22);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}
.sidebar-signout:hover { background: rgba(255, 107, 53, .35); color: #fff; }

.admin-main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.admin-top-header {
    background: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    position: sticky;
    top: 0;
    z-index: 100;
}
.page-title { font-size: 1.35rem; font-weight: 700; color: #111; }

.admin-content { flex: 1; padding: 24px; overflow-y: auto; width: 100%; }

.admin-section {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    margin-bottom: 24px;
}
.section-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; color: #111; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.95rem; }
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.btn-primary {
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover { background: #e55a2b; color: #fff; }
.btn-secondary {
    background: #6c757d;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
}
.btn-secondary:hover { background: #5a6268; color: #fff; }
.btn-danger { background: #dc3545; color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.btn-danger:hover { background: #c82333; }
.btn-success { background: #28a745; color: #fff; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 0.85rem; display: inline-block; }
.btn-success:hover { background: #218838; color: #fff; }

.admin-table-container { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead { background: #f5f5f5; }
.admin-table th, .admin-table td { padding: 12px; text-align: left; border-bottom: 1px solid #e0e0e0; }
.admin-table th { font-weight: 600; color: #111; }
.admin-table tbody tr:hover { background: #f9f9f9; }

.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}
.form-group textarea { min-height: 120px; font-family: inherit; }
.form-group .hint { font-size: 0.8rem; color: #666; margin-top: 4px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
}
.stat-card h3 { font-size: 2rem; color: #ff6b35; margin-bottom: 4px; }
.stat-card p { color: #666; font-size: 0.9rem; }

/* QR Code Generator (matches MahaJ qr-code-generator) */
.qr-page-title { margin-bottom: 20px; font-size: 1.25rem; color: #333; }
.qr-table-wrap { overflow-x: auto; }
.qr-table { width: 100%; border-collapse: collapse; }
.qr-table thead tr { background-color: #f8f9fa; border-bottom: 2px solid #dee2e6; }
.qr-table th { padding: 12px; text-align: left; font-weight: 600; color: #333; }
.qr-table th.qr-th-center { text-align: center; }
.qr-table td { padding: 12px; vertical-align: middle; border-bottom: 1px solid #dee2e6; }
.qr-table tbody tr:hover { background-color: #f8f9fa; }
.qr-code-wrapper { display: inline-block; position: relative; }
.qr-code-target { width: 100px; height: 100px; }
.qr-loading {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    margin-top: -100px;
    position: relative;
    z-index: 1;
}
.qr-url-link { color: #ff6b35; text-decoration: none; font-size: 0.85rem; word-break: break-all; }
.qr-url-link:hover { text-decoration: underline; }
.qr-empty { padding: 40px; text-align: center; color: #999; }

/* Add Judgement — matches MahaJ add-judgement.blade.php */
.add-judgement-wrap { width: 100%; margin: 0; }
.add-judgement-wrap .form-container {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.add-judgement-wrap .form-group { margin-bottom: 25px; }
.add-judgement-wrap .form-label {
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    display: block;
    font-size: 16px;
}
.add-judgement-wrap .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    font-family: inherit;
}
.add-judgement-wrap .form-control:focus {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}
.add-judgement-wrap .form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}
.add-judgement-wrap .form-control::placeholder { color: #999; }
.add-judgement-wrap textarea.form-control {
    resize: vertical;
    min-height: 100px;
}
.add-judgement-wrap .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}
.add-judgement-wrap .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    justify-content: center;
    flex-wrap: wrap;
}
.add-judgement-wrap .form-actions .btn-add-save {
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.add-judgement-wrap .form-actions .btn-add-save:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}
.add-judgement-wrap .form-actions .btn-add-cancel {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 14px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}
.add-judgement-wrap .form-actions .btn-add-cancel:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}
.add-judgement-wrap .success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #4caf50;
}
.add-judgement-wrap .error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}
.add-judgement-wrap .error-message ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (max-width: 768px) {
    .add-judgement-wrap .form-row { grid-template-columns: 1fr; }
    .add-judgement-wrap .form-container { padding: 24px; }
}

@media (max-width: 900px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-main-content { margin-left: 0; }
}

/* Mobile app users — list view */
.mobile-users-page { max-width: 1200px; }
.mobile-users-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.mobile-users-search-wrap {
    min-width: 320px;
    flex: 1;
    max-width: 560px;
}
.mobile-users-search-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}
.mobile-users-search-input {
    width: 100%;
    border: 1px solid #d8dde3;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 0.92rem;
    background: #fff;
    outline: none;
}
.mobile-users-search-input:focus {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.16);
}
.mobile-users-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ff6b35;
    margin-bottom: 6px;
}
.mobile-users-lead {
    font-size: 0.98rem;
    line-height: 1.5;
    color: #555;
    max-width: 42rem;
}
.mobile-users-stat {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 18px 22px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.25);
    text-align: center;
    min-width: 140px;
}
.mobile-users-stat-value {
    display: block;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}
.mobile-users-stat-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 4px;
}
.mobile-users-panel {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.mobile-users-table-scroll {
    overflow-x: auto;
    margin: 0;
}
.mobile-users-no-match {
    padding: 18px 16px 22px;
    margin: 0;
    font-size: 0.9rem;
    color: #888;
}
.mobile-users-table {
    margin: 0;
}
.mobile-users-table thead {
    background: linear-gradient(180deg, #fafbfc 0%, #f0f2f5 100%);
}
.mobile-users-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5a6570;
    border-bottom: 2px solid #e8eaed;
    padding: 14px 16px;
    white-space: nowrap;
}
.mobile-users-table td {
    padding: 14px 16px;
    font-size: 0.92rem;
    border-bottom: 1px solid #eef0f3;
    vertical-align: middle;
}
.mobile-users-table tbody tr {
    transition: background 0.12s ease;
}
.mobile-users-table tbody tr:nth-child(even) {
    background: #fafbfc;
}
.mobile-users-table tbody tr:hover {
    background: #fff8f5;
}
.mobile-users-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.mobile-users-badge.is-on {
    background: #e8f5e9;
    color: #2e7d32;
}
.mobile-users-badge.is-off {
    background: #f5f5f5;
    color: #757575;
}
.mobile-users-empty-panel {
    padding: 48px 28px;
    text-align: center;
}
.mobile-users-empty-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}
.mobile-users-empty-hint {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.45;
}

a.mobile-users-name-link {
    color: #c2410c;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(194, 65, 12, 0.35);
}
a.mobile-users-name-link:hover {
    color: #9a3412;
    border-bottom-color: #9a3412;
}

.mobile-users-edit-page .mobile-user-edit-card {
    max-width: 560px;
    padding: 28px;
}
.mobile-user-readonly {
    display: grid;
    gap: 12px;
    margin: 0 0 24px;
    padding: 16px 18px;
    background: #f8f9fb;
    border-radius: 10px;
    border: 1px solid #e8eaed;
}
.mobile-user-readonly > div {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: baseline;
}
.mobile-user-readonly dt {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}
.mobile-user-readonly dd {
    margin: 0;
    font-size: 0.95rem;
    color: #111;
    word-break: break-word;
}
.mobile-user-edit-form .mobile-user-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
}
.mobile-user-edit-form .mobile-user-toggle-label input {
    width: 18px;
    height: 18px;
    accent-color: #ff6b35;
}
.mobile-user-edit-form .mobile-user-date-input {
    max-width: 200px;
    font-family: inherit;
}
.mobile-user-edit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
@media (max-width: 520px) {
    .mobile-users-search-wrap {
        min-width: 100%;
        max-width: none;
    }
    .mobile-user-readonly > div {
        grid-template-columns: 1fr;
    }
}
