/* ============= ADMIN PANEL STYLES ============= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============= HEADER ============= */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header h1 {
    color: #4a5568;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header h1 i {
    color: #667eea;
    margin-right: 12px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    font-weight: 500;
}

/* ============= NAVIGATION ============= */
.navigation {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ============= ADMIN PANEL ============= */
.admin-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* ============= SECTIONS ============= */
.section {
    margin-bottom: 40px;
    padding: 25px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    color: #4a5568;
    font-size: 1.5em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input {
    width: 200px;
}

.filter-select {
    width: 150px;
}

/* ============= STATS GRID ============= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-number {
    font-size: 2.8em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    color: #666;
    font-size: 0.95em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============= FORM STYLES ============= */
.create-account-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95em;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group small {
    color: #6c757d;
    font-size: 0.8em;
    font-style: italic;
    margin-top: 2px;
}

.permissions-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.checkbox-label:hover {
    background: rgba(102, 126, 234, 0.1);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* ============= BUTTONS ============= */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #4fd1c7, #38b2ac);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

/* ============= TABLE STYLES ============= */
.accounts-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 13px;
}

.accounts-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.accounts-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.accounts-table tr:hover {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.accounts-table tr:last-child td {
    border-bottom: none;
}

/* ============= BADGES ============= */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 1px solid #b8dacc;
}

.status-locked {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 1px solid #f1b0b7;
}

.role-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.role-user {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
    color: #4a5568;
}

/* ============= TABLE ACTIONS ============= */
.table-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.table-actions .btn {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 6px;
    min-width: 65px;
}

/* ============= DATA MANAGEMENT ============= */
.data-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.data-action-card {
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.data-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.action-icon {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 15px;
}

.data-action-card h4 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.data-action-card p {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* ============= MODAL STYLES ============= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.modal-header h3 {
    color: #4a5568;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2em;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f1f3f4;
    color: #495057;
}

.modal-form {
    padding: 25px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* ============= EMPTY STATE ============= */
.empty-state {
    text-align: center;
    padding: 50px;
    color: #666;
}

.empty-state i {
    font-size: 4em;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.empty-state p {
    font-size: 0.9em;
    line-height: 1.4;
}

/* ============= NOTIFICATION ============= */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    min-width: 300px;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.notification.error {
    background: linear-gradient(135deg, #f56565, #e53e3e);
}

.notification.warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.notification.info {
    background: linear-gradient(135deg, #4fd1c7, #38b2ac);
}

/* ============= RESPONSIVE DESIGN ============= */
@media (max-width: 1200px) {
    .create-account-form {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .admin-panel {
        padding: 20px;
    }
    
    .section {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
    
    .create-account-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 2.2em;
    }
    
    .data-management-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .table-actions .btn {
        width: 100%;
    }
    
    .navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-form {
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .permissions-group {
        gap: 8px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
        min-width: auto;
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6em;
    }
    
    .section-header h3 {
        font-size: 1.2em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
    
    .stat-label {
        font-size: 0.8em;
    }
    
    .accounts-table {
        font-size: 11px;
    }
    
    .accounts-table th,
    .accounts-table td {
        padding: 8px 6px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .table-actions .btn {
        padding: 5px 8px;
        font-size: 10px;
        min-width: 50px;
    }
}

/* ============= ACCESSIBILITY ============= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.form-group input:focus,
.form-group select:focus,
.search-input:focus,
.filter-select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.checkbox-label:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .section {
        border: 3px solid #000;
    }
    
    .accounts-table {
        border: 2px solid #000;
    }
    
    .accounts-table th {
        border: 1px solid #000;
    }
    
    .accounts-table td {
        border: 1px solid #000;
    }
    
    .btn {
        border: 2px solid #000;
    }
    
    .form-group input,
    .form-group select {
        border: 2px solid #000;
    }
}

/* ============= LOADING STATES ============= */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============= SUCCESS/ERROR STATES ============= */
.success-highlight {
    background: rgba(72, 187, 120, 0.1);
    border-color: #48bb78;
    animation: successPulse 0.6s ease;
}

.error-highlight {
    background: rgba(245, 101, 101, 0.1);
    border-color: #f56565;
    animation: errorPulse 0.6s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ============= DARK MODE COMPATIBILITY ============= */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .header,
    .admin-panel,
    .section {
        background: rgba(45, 55, 72, 0.95);
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .accounts-table {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .accounts-table th {
        background: linear-gradient(135deg, #4a5568, #2d3748);
    }
    
    .form-group input,
    .form-group select,
    .search-input,
    .filter-select {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .stat-card,
    .data-action-card {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .modal-header {
        background: linear-gradient(135deg, #4a5568, #2d3748);
        border-color: #718096;
    }
}