@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&display=swap');

:root {
    --primary: #1f6f5c;
    --primary-dark: #16523f;
    --secondary: #2b3a55;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --text: #26313d;
    --muted: #6b7785;
    --border: #e2e6ea;
    --green: #1f9d55;
    --red: #d9534f;
    --orange: #e0952f;
    --blue: #2f7fe0;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    text-align: right;
}

a { color: inherit; text-decoration: none; }

.layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 250px;
    background: var(--secondary);
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar .brand {
    padding: 0 20px 20px;
    font-size: 19px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}

.sidebar .brand span {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    border-right: 3px solid transparent;
    transition: 0.15s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,0.08);
    border-right-color: var(--primary);
    color: #fff;
}

.sidebar .user-box {
    margin-top: 20px;
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
}

.sidebar .user-box .logout {
    display: inline-block;
    margin-top: 8px;
    color: #ffb3ab;
    font-size: 13px;
}

/* ---------- Main ---------- */
.main {
    flex: 1;
    padding: 25px 30px;
    max-width: 100%;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.topbar h1 {
    font-size: 20px;
    margin: 0;
}

/* ---------- Cards / Stats ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--primary);
}

.stat-card .label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-card .value {
    font-size: 22px;
    font-weight: 700;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card h2, .card h3 {
    margin-top: 0;
}

/* ---------- Forms ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

input[type=text], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=file],
select, textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    width: 100%;
}

textarea { resize: vertical; min-height: 90px; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: 0.15s;
}

.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); }
.btn-danger { background: var(--red); }
.btn-small { padding: 6px 12px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }

/* ---------- Table ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th, table td {
    padding: 12px 10px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

table tr:hover { background: #fafbfc; }

.actions { display: flex; gap: 6px; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.badge-green { background: var(--green); }
.badge-red { background: var(--red); }
.badge-orange { background: var(--orange); }
.badge-blue { background: var(--blue); }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #e4f7ec; color: #1f7a45; border: 1px solid #b7e6c9; }
.alert-error   { background: #fdeceb; color: #b03530; border: 1px solid #f5c6c3; }

/* ---------- Login / Install ---------- */
.center-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: var(--card-bg);
    padding: 35px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 380px;
}

.auth-box h1 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 25px;
    color: var(--primary-dark);
}

.install-box {
    max-width: 560px;
}

.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.steps .step {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    padding-bottom: 8px;
    border-bottom: 3px solid var(--border);
}

.steps .step.active {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 700;
}

/* ---------- Property images ---------- */
.property-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.property-images img {
    width: 110px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.share-box {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.share-box .item {
    background: #f4f9f7;
    border: 1px solid #dcecE6;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
}

@media (max-width: 800px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .main { padding: 15px; }
}
