/* ==== ریست ==== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Tahoma, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* ==== لاگین ==== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    text-align: center;
}

.login-box .subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.login-box label {
    display: block;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #555;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.login-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.login-box button:hover {
    background: #5568d3;
}

/* ==== هدر ==== */
header {
    background: white;
    padding: 16px 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

header h1 {
    font-size: 1.2rem;
}

header nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

header nav a {
    text-decoration: none;
    color: #555;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

header nav a:hover {
    background: #f0f2f5;
}

header nav a.active {
    background: #667eea;
    color: white;
}

header nav a.logout {
    color: #e74c3c;
}

header nav a.logout:hover {
    background: #fdecea;
}

/* ==== main ==== */
main {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 16px;
}

/* ==== کارت ==== */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #333;
}

/* ==== بنر وضعیت www ==== */
.info-banner {
    background: #e8f4fd;
    border: 1px solid #bee3f8;
    color: #2c5282;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.info-banner a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.info-banner a:hover {
    text-decoration: underline;
}

/* ==== فرم افزودن ==== */
.add-form {
    display: flex;
    gap: 8px;
}

.add-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    direction: ltr;
    text-align: left;
}

.add-form input:focus {
    outline: none;
    border-color: #667eea;
}

.add-form button {
    padding: 12px 24px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.add-form button:hover {
    background: #229954;
}

.hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 8px;
}

/* ==== جدول ==== */
table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.domain-cell a {
    color: #667eea;
    text-decoration: none;
    direction: ltr;
    display: inline-block;
}

.domain-cell a:hover {
    text-decoration: underline;
}

.www-tag {
    display: inline-block;
    background: #e8f4fd;
    color: #2c5282;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

.date-cell {
    font-size: 0.85rem;
    color: #666;
    direction: ltr;
}

/* ==== بج ==== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* ==== دکمه‌ها ==== */
.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.85;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-primary {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    align-self: flex-start;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #5568d3;
}

/* ==== alert ==== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.empty {
    text-align: center;
    color: #888;
    padding: 32px;
}

/* ==== فرم تنظیمات ==== */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
}

.settings-form label {
    display: block;
    font-size: 0.9rem;
    color: #555;
}

.settings-form input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    direction: ltr;
}

.settings-form input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

/* ==== رادیو گروه ==== */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

.radio-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.radio-item input[type="radio"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.radio-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-item strong {
    font-size: 0.95rem;
    color: #333;
}

.radio-item span {
    font-size: 0.85rem;
    color: #888;
}

.radio-item input[type="radio"]:checked + div strong {
    color: #667eea;
}

/* ==== موبایل ==== */
@media (max-width: 600px) {
    header {
        padding: 12px 16px;
    }
    header h1 {
        font-size: 1rem;
    }
    header nav a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .add-form {
        flex-direction: column;
    }
    table {
        font-size: 0.85rem;
    }
    th, td {
        padding: 8px;
    }
    .actions {
        flex-direction: column;
    }
}
/* ==== ناوبری ==== */
header nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

header nav a {
    text-decoration: none;
    color: #555;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

header nav a:hover {
    background: #f0f2f5;
}

header nav a.active {
    background: #667eea;
    color: white;
}

header nav a.logout {
    color: #e74c3c;
}

header nav a.logout:hover {
    background: #fdecea;
}

/* ==== بنر حالت www ==== */
.info-banner {
    background: #e8f4fd;
    border: 1px solid #bee3f8;
    color: #2c5282;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.info-banner a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.info-banner a:hover {
    text-decoration: underline;
}

/* ==== فرم تنظیمات ==== */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
}

.settings-form label {
    display: block;
    font-size: 0.9rem;
    color: #555;
}

.settings-form input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    direction: ltr;
}

.settings-form input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

/* ==== رادیو گروه ==== */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

.radio-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.radio-item input[type="radio"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.radio-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-item strong {
    font-size: 0.95rem;
    color: #333;
}

.radio-item span {
    font-size: 0.85rem;
    color: #888;
    direction: ltr;
}

.radio-item input[type="radio"]:checked + div strong {
    color: #667eea;
}

/* ==== دکمه اصلی ==== */
.btn-primary {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    align-self: flex-start;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #5568d3;
}

/* ==== موبایل ==== */
@media (max-width: 600px) {
    header {
        padding: 12px 16px;
    }
    header h1 {
        font-size: 1rem;
    }
    header nav a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .add-form {
        flex-direction: column;
    }
    table {
        font-size: 0.85rem;
    }
    th, td {
        padding: 8px;
    }
    .actions {
        flex-direction: column;
    }
}
/* ==== هدر کارت ==== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.card-header h2 {
    margin: 0;
}

/* ==== جدول لاگ‌ها ==== */
.logs-table {
    font-size: 0.85rem;
}

.logs-table th,
.logs-table td {
    padding: 10px 8px;
    vertical-align: top;
}

.logs-table .date-cell {
    white-space: nowrap;
    font-size: 0.8rem;
    color: #666;
}

.logs-table .details-cell {
    color: #888;
    font-size: 0.8rem;
}

/* ==== بج‌های اضافی ==== */
.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    background: #eee;
    color: #555;
}

/* ==== موبایل ==== */
@media (max-width: 700px) {
    .logs-table {
        font-size: 0.75rem;
    }
    .logs-table th,
    .logs-table td {
        padding: 6px 4px;
    }
    .logs-table .details-cell {
        display: none;
    }
}
