/**
 * Vesac India - Admin Panel Stylesheet
 * Professional Dashboard & Management Interface
 * Updated: February 2, 2026
 */

/* ===== Admin Panel Base Styles ===== */
.admin-wrapper {
    display: flex;
    height: 100vh;
    background: var(--light);
}

.admin-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* ===== Admin Header ===== */
.admin-header {
    background: linear-gradient(135deg, var(--dark) 0%, #1a3a47 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.admin-header h1 {
    font-size: 24px;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header .logo {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.admin-header .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-header .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.admin-header .logout-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.admin-header .logout-btn:hover {
    background: #e89450;
    transform: translateY(-2px);
}

/* ===== Admin Sidebar ===== */
.admin-sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--dark) 0%, #1a3a47 100%);
    height: calc(100vh - 72px);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    padding: 24px 0;
}

.admin-sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

.admin-sidebar h3 {
    color: white;
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    opacity: 0.7;
}

.admin-sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar-menu li {
    margin: 0;
}

.admin-sidebar a {
    display: block;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.admin-sidebar a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
}

.admin-sidebar a.active {
    color: white;
    background: rgba(42, 157, 143, 0.2);
    border-left-color: var(--accent);
}

.admin-sidebar-section {
    margin-bottom: 8px;
}

.admin-sidebar-section + .admin-sidebar-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Admin Main Content ===== */
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--light);
}

.admin-content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== Admin Breadcrumb ===== */
.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.admin-breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.admin-breadcrumb a:hover {
    text-decoration: underline;
}

.admin-breadcrumb span {
    color: var(--text-lighter);
}

/* ===== Admin Page Title ===== */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.admin-page-title h1 {
    font-size: 28px;
    color: var(--dark);
    margin: 0;
}

.admin-page-actions {
    display: flex;
    gap: 12px;
}

/* ===== Admin Dashboard Grid ===== */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.admin-stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--accent);
    transition: all 0.3s ease;
}

.admin-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.admin-stat-label {
    color: var(--text-light);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.admin-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.admin-stat-change {
    font-size: 12px;
    color: var(--success);
}

.admin-stat-change.negative {
    color: var(--error);
}

/* ===== Admin Table ===== */
.admin-table {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.admin-table-header {
    background: linear-gradient(135deg, var(--dark) 0%, #1a3a47 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.admin-table-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.admin-table-actions {
    display: flex;
    gap: 8px;
}

.admin-table-actions .btn {
    padding: 8px 16px;
    font-size: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: #f8f9fa;
    border-bottom: 2px solid var(--border);
}

table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
}

table tbody tr:hover {
    background: #f5f5f5;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Admin Form Styles ===== */
.admin-form {
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 800px;
}

.admin-form-group {
    margin-bottom: 24px;
}

.admin-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    transition: all 0.3s ease;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.admin-form textarea {
    resize: vertical;
    min-height: 120px;
}

.admin-form-description {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.admin-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.admin-form-actions .btn {
    flex: 1;
}

/* ===== Admin Modal ===== */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.admin-modal.active {
    display: flex;
}

.admin-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
}

.admin-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.admin-modal-close:hover {
    color: var(--dark);
}

.admin-modal-body {
    padding: 24px;
}

.admin-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== Admin Status Badges ===== */
.admin-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-badge-success {
    background: var(--accent-light);
    color: var(--dark);
}

.admin-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.admin-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.admin-badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ===== Admin Notifications ===== */
.admin-alert {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border-left: 4px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-alert-success {
    background: var(--accent-light);
    color: var(--dark);
    border-left-color: var(--success);
}

.admin-alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--warning);
}

.admin-alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--error);
}

.admin-alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.admin-alert-close:hover {
    opacity: 1;
}

/* ===== Admin Footer ===== */
.admin-footer {
    background: white;
    color: var(--text-light);
    text-align: center;
    padding: 20px 24px;
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ===== Mobile Admin Adjustments ===== */
@media (max-width: 768px) {
    
    .admin-wrapper {
        flex-direction: column;
        height: auto;
    }
    
    .admin-container {
        height: auto;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        display: none;
        padding: 16px 0;
    }
    
    .admin-sidebar.mobile-open {
        display: block;
    }
    
    .admin-content {
        padding: 16px;
        overflow-y: visible;
    }
    
    .admin-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .admin-page-actions {
        width: 100%;
    }
    
    .admin-page-actions .btn {
        flex: 1;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 10px 12px;
    }
    
    .admin-form {
        padding: 16px;
    }
    
    .admin-modal-content {
        max-width: 95%;
    }
}

/* ===== Sidebar Toggle Button ===== */
.admin-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 16px;
}

@media (max-width: 768px) {
    .admin-sidebar-toggle {
        display: block;
    }
}

/* ===== Loading Spinner ===== */
.admin-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Admin Color Variants ===== */
.admin-stat-card.primary {
    border-top-color: var(--primary);
}

.admin-stat-card.secondary {
    border-top-color: var(--secondary);
}

.admin-stat-card.accent {
    border-top-color: var(--accent);
}

.admin-stat-card.dark {
    border-top-color: var(--dark);
}