:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
}

.admin-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Card */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

@media (max-width: 640px) {
    .container {
        padding: 1rem 0.75rem;
    }
    .card {
        padding: 1.5rem 1.25rem;
        border-radius: var(--radius-md);
    }
}

/* Brand Logo */
.brand-logo-wrapper {
    text-align: center;
    margin-bottom: 1.5rem;
}

.brand-logo {
    height: 42px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: inline-block;
}

.admin-header-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.admin-header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Header */
.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
    border: 1px solid var(--primary-border);
}

.title {
    font-size: 1.875rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

label .required {
    color: var(--danger-color);
    margin-left: 2px;
}

.input-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease-in-out;
    outline: none;
}

.input-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-control::placeholder {
    color: #9ca3af;
}

/* Phone input group with country dial prefix */
.phone-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.phone-prefix-wrapper {
    width: 110px;
    flex-shrink: 0;
}

.phone-prefix-input {
    width: 100%;
    text-align: center;
    font-weight: 600;
    background: #f8fafc;
    color: #334155;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.5rem;
    font-size: 0.95rem;
    outline: none;
}

.phone-prefix-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.phone-main-input {
    flex: 1;
}

/* Dropdown Autocomplete for Nationality */
.autocomplete-wrapper {
    position: relative;
}

.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.suggestions-dropdown.open {
    display: block;
}

.suggestion-item {
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s;
}

.suggestion-item:hover, .suggestion-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.suggestion-code {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--primary-color);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.btn-sm {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-success {
    background-color: var(--success-color);
}
.btn-success:hover {
    background-color: #059669;
}

/* Success Card */
.success-banner {
    display: none;
    text-align: center;
    padding: 2.5rem 1rem;
}

.success-banner.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #dcfce7;
    color: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Admin Dashboard Specific */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-val {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0.35rem;
}

.table-card {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-toolbar {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: #1e293b;
    white-space: nowrap;
}

tr:hover td {
    background-color: #f8fafc;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1e293b;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    font-size: 0.875rem;
    animation: fadeIn 0.3s;
}

/* Footer note */
.footer-note {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(12px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-body {
    padding: 1.75rem 1.5rem 1.25rem 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.modal-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fee2e2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-icon-wrapper.warning {
    background: #fef3c7;
    color: #d97706;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem 0;
}

.modal-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.modal-footer {
    background: #f8fafc;
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Progress Bar */
.progress-bar-bg {
    background-color: #f1f5f9;
    border-radius: 9999px;
    height: 8px;
    width: 100%;
    overflow: hidden;
    margin-top: 4px;
}
.progress-bar-fill {
    background-color: var(--primary-color);
    height: 100%;
    border-radius: 9999px;
}

/* Form Validation Error State & Bottom Alert */
.card.has-error {
    border: 2px solid var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18), var(--shadow-xl) !important;
    animation: shake 0.35s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.error-alert-bottom {
    margin-top: 1.5rem;
    background: #fef2f2;
    color: #b91c1c;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid #fecaca;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 0.65rem;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.25s ease-out;
}

