* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-bottom: 3px solid #4f46e5;
}

.header h1 {
    color: #1e293b;
    font-size: 2.2em;
    margin-bottom: 8px;
    font-weight: 700;
}

.header p {
    color: #64748b;
    font-size: 1.05em;
}

.btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

.btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #10b981;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    padding: 6px 12px;
    font-size: 0.9em;
}

.btn-danger:hover {
    background: #dc2626;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.plan-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.plan-header {
    padding: 20px;
    color: white;
    background: #4f46e5;
}

.plan-header.practical {
    background: #10b981;
}

.plan-header h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.plan-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
}

.plan-body {
    padding: 20px;
}

.plan-info {
    color: #64748b;
    font-size: 0.95em;
    line-height: 1.6;
}

.plan-info p {
    margin-bottom: 6px;
}

.plan-info strong {
    color: #1e293b;
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 1200px;
    margin: 20px auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.8em;
    color: #94a3b8;
    cursor: pointer;
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-btn:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
    font-size: 0.95em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.2s;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-left: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: #4f46e5;
    color: white;
    padding: 14px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
}

td {
    padding: 12px;
    border: 1px solid #e2e8f0;
}

td input,
td textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.2s;
    font-family: inherit;
}

td input:focus,
td textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

td textarea {
    min-height: 60px;
    resize: vertical;
    line-height: 1.4;
}

.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.detail-section {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.detail-section h3 {
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 1.2em;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.detail-item {
    background: white;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.detail-item strong {
    color: #4f46e5;
    display: block;
    margin-bottom: 6px;
    font-size: 0.85em;
    font-weight: 600;
}

.empty-state {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.empty-state h2 {
    color: #64748b;
    font-size: 1.8em;
    margin-bottom: 12px;
    font-weight: 600;
}

.empty-state p {
    color: #94a3b8;
    font-size: 1.1em;
}

.loading {
    text-align: center;
    padding: 60px;
    font-size: 1.4em;
    color: #64748b;
    font-weight: 600;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .header {
        padding: 24px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 24px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.85em;
    }

    th, td {
        padding: 10px 8px;
    }

    .empty-state {
        padding: 40px 20px;
    }
}
/* AI Generation Section */
.ai-generation-section {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #5f7cff 0%, #38c6a6 100%);
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ai-generation-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

#generateWithAI {
    background: # !important;
    border: none;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
}

#generateWithAI:hover:not(:disabled) {
    background: #7c3aed !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

#generateWithAI:disabled {
    background: #6b7280 !important;
    cursor: not-allowed;
    opacity: 0.6;
}

#generateWithAI.success {
    background: #10b981 !important;
}

.ai-filled {
    background-color: #d1fae5 !important;
    border: 2px solid #10b981 !important;
    transition: all 0.5s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ai-generated-row {
    animation: slideInRight 0.4s ease forwards;
}
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.loader-box {
  text-align: center;
  font-size: 18px;
  color: #333;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #ddd;
  border-top-color: #4a90e2;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
#toastContainer {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999999;
}

.toast {
  background: #333;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 16px;
  animation: slideUp 0.4s ease, fadeOut 0.5s ease 2.3s forwards;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.toast.success { background: #28a745; }
.toast.error { background: #dc3545; }
.toast.warning { background: #ffc107; color: black; }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-15px); }
}
