/* Admin Specific Styles */

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 3rem;
    flex-wrap: wrap;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--glass-shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    margin: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.glass-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.glass-input:focus {
    outline: none;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.glass-input::placeholder {
    color: var(--text-secondary);
}

.btn-block {
    width: 100%;
    padding: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.btn-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
}

.alert-glass {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #fca5a5;
}

.login-info {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 400px;
}

.login-info h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.credential-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.credential-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.credential-item:last-child {
    margin-bottom: 0;
}

.credential-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.credential-box code {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-family: 'Space Mono', monospace;
}

/* Dashboard Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

.admin-logo {
    padding: 0 2rem;
    margin-bottom: 2rem;
}

.admin-logo h2 {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.admin-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-nav-item {
    margin-bottom: 0.25rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.admin-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.nav-icon {
    font-size: 1.25rem;
}

.admin-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.admin-title {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-value {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Tables */
.table-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 0.75rem;
}

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

.table {
    width: 100%;
    color: var(--text-primary);
    margin: 0;
}

.table thead th {
    padding: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table tbody td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.badge-processing {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.badge-completed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-paid {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-unpaid {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-partial {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-edit {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: none;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: none;
}

.btn-view {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border: none;
}

/* Forms */
.form-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.image-preview {
    width: 100%;
    max-width: 300px;
    height: 200px;
    border: 2px dashed var(--glass-border);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0.5rem;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-placeholder {
    color: var(--text-secondary);
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-card {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem;
    }
    
    .login-info {
        width: 100%;
    }
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* Success Messages */
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fcd34d;
}

/* Invoice Specific */
.invoice-preview {
    background: white;
    color: #000;
    padding: 3rem;
    border-radius: 0.5rem;
    margin-top: 2rem;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.invoice-table {
    width: 100%;
    margin: 2rem 0;
}

.invoice-table th {
    background: #f3f4f6;
    padding: 0.75rem;
    text-align: left;
}

.invoice-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.invoice-total {
    text-align: right;
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1rem;
}

@media print {
    .admin-sidebar,
    .admin-header,
    .table-actions,
    .action-buttons,
    .form-actions {
        display: none !important;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .invoice-preview {
        box-shadow: none;
    }
}
