body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    direction: rtl;
    color: #2c3e50;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0 25px;
    padding: 8px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
}

.tab-btn {
    padding: 12px 20px;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
    background: transparent;
    color: #64748b;
    border: 2px solid transparent;
    box-shadow: none;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.tab-btn.is-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 900px) {
    .container {
        max-width: 980px;
    }
}

.card {
    text-align: right;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.card .result {
    text-align: right;
    line-height: 1.8;
}

.card h2 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #34495e;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

h1 {
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

textarea {
    width: 100%;
    height: 130px;
    margin-bottom: 15px;
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    outline: none;
    transition: all 0.3s ease;
    background: #f8fafc;
    resize: vertical;
}

input {
    width: 100%;
    margin-bottom: 15px;
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    outline: none;
    transition: all 0.3s ease;
    background: #f8fafc;
}

input:focus, textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
}

button {
    padding: 14px 28px;
    margin: 12px auto;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 30px;
    border-radius: 12px;
    overflow: hidden;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

table th, table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

table tbody tr {
    transition: 0.2s;
}

table tbody tr:hover {
    background-color: #f8fafc;
}

.discount-header {
    color: #fff;
}

.discount-cell {
    font-weight: 700;
    color: #667eea;
}

.discount-cell:empty::after {
    content: "—";
    color: #94a3b8;
}

.hidden {
    display: none;
}

.result {
    margin-top: 15px;
    padding: 14px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    color: #1e293b;
    font-weight: 500;
}
