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

body {
    font-family: 'Noto Sans Devanagari', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.admin-header-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
}

.nav-tabs {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.nav-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-tab.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.tab-content {
    display: none;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.tab-content.active {
    display: block;
}

.preview-section {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.controls {
    min-width: 380px;
    max-width: 400px;
}

.preview {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: 'Noto Sans Devanagari', Arial, sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    font-family: inherit;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f, #a8e6cf);
    color: white;
}

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

.certificate-preview,
.id-card-preview {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: auto;
    max-height: 80vh;
}

.certificate {
    width: 100%;
    max-width: 800px;
    height: auto;
    min-height: 550px;
    margin: 0 auto;
    border: 12px solid #1a4fa0;
    border-radius: 15px;
    padding: 25px;
    position: relative;
    background: linear-gradient(45deg, #f8f5e4 0%, #fff 100%);
    box-sizing: border-box;
    aspect-ratio: 4/3;
}

.certificate::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 3px solid #d4af37;
    border-radius: 10px;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(212, 175, 55, 0.1) 10px, rgba(212, 175, 55, 0.1) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(212, 175, 55, 0.1) 10px, rgba(212, 175, 55, 0.1) 20px);
}

.certificate-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.certificate-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1a4fa0;
    margin: 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.certificate-subtitle {
    font-size: 1rem;
    color: #d32f2f;
    margin-bottom: 20px;
    font-weight: bold;
}

.certificate-content {
    line-height: 1.8;
    font-size: 0.95rem;
    color: #2c3e50;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: start;
}

.certificate-text {
    text-align: left;
}

.certificate-photo {
    width: 100px;
    height: 120px;
    border: 3px solid #1a4fa0;
    border-radius: 5px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 10px;
}

.certificate-field {
    display: inline;
    border-bottom: 1px dotted #2c3e50;
    min-width: 150px;
    padding: 2px 8px;
    margin: 0 5px;
    font-weight: bold;
    color: #1a4fa0;
}

.decorative-element {
    position: absolute;
    width: 60px;
    height: 60px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="%23d4af37" stroke-width="2"/><circle cx="50" cy="50" r="35" fill="none" stroke="%23d4af37" stroke-width="1"/><circle cx="50" cy="50" r="25" fill="none" stroke="%23d4af37" stroke-width="1"/></svg>') no-repeat center;
    background-size: contain;
}

.decorative-element.top-left {
    top: 20px;
    left: 20px;
}

.decorative-element.top-right {
    top: 20px;
    right: 20px;
}

.decorative-element.bottom-left {
    bottom: 20px;
    left: 20px;
}

.decorative-element.bottom-right {
    bottom: 20px;
    right: 20px;
}

.id-card {
    width: 350px;
    height: 220px;
    margin: 0 auto;
    border-radius: 15px;
    background: linear-gradient(135deg, #f2f3b4 0%, #eaf0d2 25%, #e1f5c7 50%, #dbe6d2 75%, #edf0d2 100%);
    color: white;
    padding: 0;
    position: relative;
    overflow: hidden;
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
    border: 2px solid #1a237e;
}

.id-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(90deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.15) 100%);
    border-radius: 15px 15px 0 0;
    z-index: 2;
}

.id-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(255,255,255,0.05);
    border-radius: 0 0 15px 15px;
}

.id-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    position: relative;
    z-index: 3;
}

.id-card .logo-placeholder {
    width: 40px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    text-align: center;
    flex-shrink: 0;
    color: #fff;
}

.id-card .org-info h3 {
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
    color: #fff;
}

.id-card .org-info p {
    margin: 2px 0 0 0;
    font-size: 11px;
    opacity: 0.9;
    font-weight: bold;
    color: #fff;
}

.id-card-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 3px;
    text-align: center;
}

.id-card-content {
    display: flex;
    gap: 15px;
    padding: 5px 15px 15px;
    position: relative;
    z-index: 3;
}

.id-photo {
    width: 75px;
    height: 95px;
    border-radius: 8px;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    text-align: center;
    flex-shrink: 0;
    color: #666;
    border: 2px solid #2d3782;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.id-details {
    flex: 1;
    font-size: 8px;
    line-height: 1.2;
}

.id-field {
    margin-bottom: 6px;
    word-wrap: break-word;
}

.id-field strong {
    display: block;
    font-weight: bold;
    color: #fff;
    margin-bottom: 1px;
}

.id-field span {
    color: #e8eaf6;
    font-size: 9px;
}

.id-card .footer-signatures {
    position: absolute;
    bottom: 8px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    z-index: 3;
    padding: 8px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 0 0 13px 13px;
}

.id-card .decorative-lines {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.id-card .decorative-lines::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="%23ffffff" stroke-width="1" opacity="0.1"/><circle cx="50" cy="50" r="35" fill="none" stroke="%23ffffff" stroke-width="1" opacity="0.15"/><circle cx="50" cy="50" r="25" fill="none" stroke="%23ffffff" stroke-width="2" opacity="0.2"/></svg>') no-repeat center;
    background-size: contain;
}

.id-card .decorative-lines::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><polygon points="50,5 95,75 5,75" fill="none" stroke="%23ffffff" stroke-width="2" opacity="0.15"/><polygon points="50,15 85,65 15,65" fill="none" stroke="%23ffffff" stroke-width="1" opacity="0.1"/></svg>') no-repeat center;
    background-size: contain;
}

/* Enhanced visual elements */
.id-card .enhanced-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
        linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.03) 50%, transparent 70%);
    z-index: 1;
}

.id-card .tech-pattern {
    position: absolute;
    top: 50%;
    right: -20px;
    width: 100px;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><g stroke="%23ffffff" stroke-width="0.5" fill="none" opacity="0.08"><circle cx="50" cy="20" r="2"/><circle cx="80" cy="50" r="2"/><circle cx="50" cy="80" r="2"/><circle cx="20" cy="50" r="2"/><line x1="50" y1="20" x2="80" y2="50"/><line x1="80" y1="50" x2="50" y2="80"/><line x1="50" y1="80" x2="20" y2="50"/><line x1="20" y1="50" x2="50" y2="20"/></g></svg>') no-repeat center;
    background-size: contain;
    transform: translateY(-50%);
    z-index: 1;
}

.admin-section {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.admin-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.asset-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.asset-item h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.table tr:hover {
    background: #f8f9fa;
}

.pagination {
    text-align: center;
    margin-top: 20px;
}

.pagination button {
    margin: 0 5px;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.pagination button.active {
    background: #764ba2;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
}

.message {
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: slideInDown 0.3s ease;
}

.message.success {
    background: linear-gradient(135deg, #56ab2f, #a8e6cf);
}

.message.error {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    text-align: center;
}

.login-card h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
}

.login-form .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-form button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

.login-info {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
}

.error-message {
    background: #ff4b2b;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .preview-section {
        flex-direction: column;
    }
    
    .controls {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
    
    .certificate {
        font-size: 0.8rem;
        min-height: 400px;
    }
    
    .id-card {
        transform: scale(0.8);
    }
    
    .admin-header-actions {
        position: relative;
        text-align: center;
        margin-top: 15px;
    }
}

@media print {
    body * {
        visibility: hidden;
    }
    .certificate, .certificate *,
    .id-card, .id-card * {
        visibility: visible;
    }
    .certificate {
        position: absolute;
        left: 0;
        top: 0;
        width: 11in !important;
        height: 8.5in !important;
        max-width: none !important;
        transform: none !important;
    }
    .id-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 3.5in !important;
        height: 2.2in !important;
        max-width: none !important;
        transform: none !important;
        box-shadow: none !important;
    }
}
