/* Modern Dark Mode Theme */
:root {
    /* Dark Mode Base Colors */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252b3b;
    --bg-elevated: #2d3548;
    
    /* Text Colors */
    --text-primary: #e8eaed;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Accent Colors */
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-secondary: #06b6d4;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    
    /* Border Colors */
    --border-subtle: #374151;
    --border-medium: #4b5563;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Base Styles */
body {
    font-family: 'Inter', 'Maven Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1f2e 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: var(--text-primary);
    padding: 24px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Container */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
}

/* Typography */
h2, h3 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-top: 0;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 24px;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-secondary);
}

/* Admin Navigation */
.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.admin-menu {
    display: flex;
    gap: 8px;
}

.admin-menu a {
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.admin-menu a:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    text-decoration: none;
}

.admin-menu a.active {
    background: var(--accent-primary);
    color: white;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border: 1px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    text-decoration: none;
}

.btn-danger {
    background: var(--accent-error);
    color: white;
    border: 1px solid var(--accent-error);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3), var(--shadow-md);
    text-decoration: none;
}

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

label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"], 
textarea, 
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-elevated);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

    /* Tables */
.text-nowrap {
    white-space: nowrap;
}
.text-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: var(--bg-tertiary);
    /* transform: scale(1.01); */
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-new { 
    background: rgba(59, 130, 246, 0.15); 
    color: #60a5fa; 
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-unconfirmed { 
    background: rgba(245, 158, 11, 0.15); 
    color: #fbbf24; 
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-confirmed { 
    background: rgba(16, 185, 129, 0.15); 
    color: #34d399; 
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-whitelisted { 
    background: rgba(107, 114, 128, 0.15); 
    color: #9ca3af; 
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Indicators */
.indicator-overdue {
    color: var(--accent-error);
    margin-left: 8px;
    cursor: help;
    font-size: 1.1rem;
    vertical-align: middle;
}

.indicator-blocked {
    color: var(--accent-error);
    margin-left: 8px;
    cursor: help;
    font-size: 1.1rem;
    vertical-align: middle;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: var(--accent-error);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border-color: var(--accent-primary);
}

.alert strong {
    color: var(--text-primary);
}

/* Modals */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-secondary);
    margin: 10% auto;
    padding: 32px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Recipient List */
.recipient-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.recipient-list li {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.recipient-list li:last-child {
    border-bottom: none;
}

.recipient-list li a {
    display: block;
    font-weight: 500;
    color: var(--accent-primary);
}

.recipient-list li a:hover {
    color: var(--accent-secondary);
}

/* Filters */
.filters form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 24px;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
    margin: 0;
}

.filters input[type="checkbox"] {
    width: auto;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Pagination */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.pagination a, .pagination span {
    padding: 10px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-weight: 500;
}

.pagination a:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    text-decoration: none;
    transform: translateY(-2px);
}

.pagination .active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 6px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-medium);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--accent-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 20px 16px;
        padding: 24px;
    }
    
    .admin-nav {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .filters form {
        flex-direction: column;
        align-items: stretch;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 12px 8px;
    }
}
