@font-face {
    font-family: "B Nazanin";
    src: url("fonts/BNazanin.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* { box-sizing: border-box; }
body {
    font-family: "B Nazanin", Tahoma, Vazirmatn, sans-serif;
    background: #f4f5f7;
    margin: 0;
    direction: rtl;
}
.container { max-width: 700px; margin: 20px auto; padding: 0 16px; }
.nav {
    background: #1f2937;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.nav-links a {
    color: #fff;
    margin-inline-start: 14px;
    text-decoration: none;
}
.nav-links a:hover { text-decoration: underline; }
.card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.auth-box {
    max-width: 360px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}
label { display: block; margin: 12px 0 4px; font-weight: bold; }
input, textarea, button {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 14px;
}
button {
    background: #2563eb;
    color: #fff;
    border: none;
    margin-top: 16px;
    cursor: pointer;
    font-weight: bold;
}
button:hover { background: #1d4ed8; }
.alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.alert.success {
    background: #dcfce7;
    color: #166534;
}
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: normal;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
    margin-inline-start: 8px;
}
.badge-public {
    background: #e0e7ff;
    color: #3730a3;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}
table th, table td {
    text-align: right;
    padding: 10px;
    border-bottom: 1px solid #eee;
}
table th {
    background: #f0f2f5;
}
.btn-danger {
    background: #dc2626;
    width: auto;
    padding: 6px 12px;
    font-size: 13px;
    display: inline-block;
}
.btn-danger:hover { background: #b91c1c; }
.top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.chart-toggles {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.toggle-btn {
    width: auto;
    padding: 6px 14px;
    border: 2px solid #d1d5db;
    background: #fff;
    color: #6b7280;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
}
.toggle-btn.active {
    background: currentColor;
    color: #fff;
}
.toggle-btn.active {
    color: #fff;
    background: var(--btn-color, #2563eb);
}
.toggle-btn[data-series="gold"].active { background: #2563eb; }
.toggle-btn[data-series="intrinsic"].active { background: #16a34a; }
.toggle-btn[data-series="dollar"].active { background: #ea580c; }
.toggle-btn[data-series="ounce"].active { background: #9333ea; }
.collapsed-card summary {
    cursor: pointer;
    font-weight: bold;
    list-style: none;
}
.collapsed-card summary::-webkit-details-marker { display: none; }
.collapsed-card summary::before {
    content: "▸ ";
    color: #6b7280;
}
.collapsed-card[open] summary::before {
    content: "▾ ";
}
.collapsed-card summary .summary-date {
    display: block;
    font-weight: normal;
    color: #9ca3af;
    margin-top: 4px;
}
.collapsed-card p { margin-top: 10px; }