/* ===================================
   NairaCrest Admin Panel Styles
   =================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #374151;
    background: #f9fafb;
}

/* ===================================
   Login Page Styles
   =================================== */
   
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    width: 100%;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.login-form-container {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.login-header p {
    color: #6b7280;
    font-size: 1rem;
}

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 25px;
}

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

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 15px;
    color: #9ca3af;
    z-index: 2;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f9fafb;
}

.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.password-toggle {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    z-index: 2;
    padding: 5px;
}

.password-toggle:hover {
    color: #374151;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

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

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

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #dc2626;
}

.login-info {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-info h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    font-weight: 700;
}

.login-info ul {
    list-style: none;
    margin-bottom: 40px;
}

.login-info ul li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-size: 1rem;
}

.login-info ul li i {
    margin-right: 15px;
    width: 20px;
    color: #dbeafe;
}

.contact-info {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 30px;
}

.contact-info p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.contact-info p i {
    margin-right: 10px;
    width: 16px;
}

/* ===================================
   Dashboard Layout
   =================================== */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1f2937;
    color: white;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid #374151;
    text-align: center;
}

.sidebar-logo {
    width: 60px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f9fafb;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-group {
    margin-bottom: 30px;
}

.nav-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px 10px;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: #374151;
    color: white;
    border-left-color: #3b82f6;
}

.nav-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.topbar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-btn {
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.topbar-btn.primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.topbar-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f9fafb;
}

/* ===================================
   Dashboard Cards
   =================================== */

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3b82f6;
}

.stat-card.success {
    border-left-color: #10b981;
}

.stat-card.warning {
    border-left-color: #f59e0b;
}

.stat-card.danger {
    border-left-color: #ef4444;
}

.stat-card-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: #3b82f6;
}

.stat-card.success .stat-card-icon {
    background: #10b981;
}

.stat-card.warning .stat-card-icon {
    background: #f59e0b;
}

.stat-card.danger .stat-card-icon {
    background: #ef4444;
}

.stat-card-title {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-card-trend {
    font-size: 0.75rem;
    color: #10b981;
    margin-top: 5px;
}

.stat-card-trend.down {
    color: #ef4444;
}

/* ===================================
   Tables
   =================================== */

.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.table-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.table-filters {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
}

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

.data-table th,
.data-table td {
    padding: 15px 25px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.info {
    background: #dbeafe;
    color: #1e40af;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: 1px solid;
    background: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sm.edit {
    color: #3b82f6;
    border-color: #3b82f6;
}

.btn-sm.edit:hover {
    background: #3b82f6;
    color: white;
}

.btn-sm.delete {
    color: #ef4444;
    border-color: #ef4444;
}

.btn-sm.delete:hover {
    background: #ef4444;
    color: white;
}

/* ===================================
   Forms
   =================================== */

.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: #f9fafb;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.error-text {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn.primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn.secondary {
    background: white;
    border-color: #d1d5db;
    color: #374151;
}

.btn.secondary:hover {
    background: #f3f4f6;
}

.btn.success {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.btn.success:hover {
    background: #059669;
    border-color: #059669;
}

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

.btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* ===================================
   Enhanced Responsive Design
   =================================== */

@media (max-width: 1024px) {
    .login-container {
        max-width: 800px;
        margin: 0 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .login-page {
        padding: 15px;
        background-attachment: fixed;
    }
    
    .login-container {
        grid-template-columns: 1fr;
        max-width: 100%;
        margin: 0;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    }
    
    .login-info {
        order: -1;
        padding: 30px 25px;
        text-align: center;
    }
    
    .login-info h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .login-info ul li {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .login-form-container {
        padding: 30px 25px;
    }
    
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .login-logo {
        width: 70px;
    }
    
    .input-group input {
        padding: 14px 14px 14px 42px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .login-btn {
        padding: 16px;
        font-size: 16px;
    }
    
    /* Dashboard adjustments */
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
        position: relative;
        height: auto;
    }
    
    .main-content {
        order: 1;
        margin-left: 0;
    }
    
    .topbar {
        padding: 0 20px;
        height: 60px;
    }
    
    .topbar-title {
        font-size: 1.25rem;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .data-table {
        font-size: 0.875rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 15px;
        min-width: 120px;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal {
        padding: 15px;
    }
    
    .modal {
        max-width: 90%;
        margin: 15px;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 10px;
    }
    
    .login-container {
        border-radius: 12px;
    }
    
    .login-info,
    .login-form-container {
        padding: 25px 20px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .login-header p {
        font-size: 0.9rem;
    }
    
    .login-logo {
        width: 60px;
    }
    
    .input-group input {
        padding: 12px 12px 12px 40px;
    }
    
    .login-btn {
        padding: 14px;
        font-size: 15px;
    }
    
    .login-info ul li {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    
    .contact-info p {
        font-size: 0.8rem;
    }
    
    /* Dashboard mobile optimizations */
    .topbar {
        padding: 0 15px;
        height: 56px;
    }
    
    .topbar-title {
        font-size: 1.1rem;
    }
    
    .topbar-actions {
        gap: 10px;
    }
    
    .topbar-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .stats-grid {
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px;
        text-align: center;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    .stat-card-title {
        font-size: 0.8rem;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .action-buttons {
        gap: 6px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}

@media (max-width: 360px) {
    .login-info,
    .login-form-container {
        padding: 20px 15px;
    }
    
    .login-header h1 {
        font-size: 1.35rem;
    }
    
    .input-group input {
        font-size: 15px;
    }
    
    .content-area {
        padding: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 8px;
        font-size: 0.75rem;
        min-width: 80px;
    }
}

/* Landscape phone optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .login-container {
        grid-template-columns: 1fr 1fr;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .login-info {
        order: 0;
        padding: 20px;
    }
    
    .login-form-container {
        padding: 20px;
    }
    
    .login-info h2 {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }
    
    .login-info ul li {
        margin-bottom: 8px;
        font-size: 0.8rem;
    }
}

/* High DPI screen optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-logo,
    .sidebar-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===================================
   Loading States
   =================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6b7280;
}

.loading i {
    margin-right: 10px;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   Modals
   =================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 25px 30px 0;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 0 30px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}