@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: #f4f5f7;
    color: #1f2330;
    direction: rtl;
}

a { color: #4f46e5; text-decoration: none; }

/* ---------- Navbar ---------- */
.navbar {
    background: #1f2330;
    color: #fff;
}
.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.navbar-brand {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.navbar-links {
    display: flex;
    gap: 18px;
}
.navbar-links a {
    color: #c9cbd6;
    font-size: 14px;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
}
.navbar-links a.active,
.navbar-links a:hover {
    color: #fff;
    border-bottom-color: #4f46e5;
}
.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #c9cbd6;
}
.btn-logout {
    background: #2d3142;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
}
.btn-logout:hover { background: #3a3f56; }

/* ---------- Layout ---------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.section-title {
    font-size: 16px;
    margin-bottom: 14px;
    color: #1f2330;
}

/* ---------- Timer Card ---------- */
.timer-card, .recent-card, .add-project-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 24px;
}

.timer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#descriptionInput {
    flex: 1;
    min-width: 200px;
    padding: 12px 14px;
    border: 1px solid #e0e1e8;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}

#projectSelect {
    padding: 12px 14px;
    border: 1px solid #e0e1e8;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    min-width: 160px;
    background: #fff;
}

.timer-display {
    font-size: 22px;
    font-weight: 700;
    min-width: 110px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

.btn-timer {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    transition: background .15s;
}
.btn-start { background: #16a34a; }
.btn-start:hover { background: #128a3e; }
.btn-stop { background: #dc2626; }
.btn-stop:hover { background: #b91c1c; }

.hint {
    margin-top: 12px;
    font-size: 13px;
    color: #6b7280;
}

/* ---------- Tables ---------- */
.entries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.entries-table th {
    text-align: right;
    padding: 10px 8px;
    color: #6b7280;
    font-weight: 600;
    border-bottom: 2px solid #eee;
    font-size: 13px;
}
.entries-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
}
.entries-table tfoot td {
    border-top: 2px solid #eee;
    border-bottom: none;
    padding-top: 14px;
}

.project-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
}

.empty-state {
    color: #9ca3af;
    font-size: 14px;
    padding: 20px 0;
    text-align: center;
}

.btn-delete-entry, .btn-delete-project, .btn-archive-project {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    margin-inline-start: 6px;
}
.btn-delete-entry:hover, .btn-delete-project:hover { background: #fee2e2; border-color: #fecaca; color:#b91c1c; }
.btn-archive-project:hover { background: #fef3c7; border-color: #fde68a; }

/* ---------- Add Project ---------- */
.add-project-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
#newProjectName {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #e0e1e8;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}
#newProjectColor {
    width: 44px;
    height: 40px;
    border: 1px solid #e0e1e8;
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
}
.error-text {
    color: #dc2626;
    font-size: 13px;
    margin-top: 10px;
    min-height: 1em;
}

.btn-primary {
    background: #4f46e5;
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:hover { background: #4338ca; }

/* ---------- Reports filter ---------- */
.filter-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    font-size: 14px;
}
.filter-row input[type=date] {
    padding: 8px 10px;
    border: 1px solid #e0e1e8;
    border-radius: 6px;
    font-family: inherit;
    margin-inline-start: 6px;
}

.pct-bar-wrap {
    display: inline-block;
    width: 80px;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
    margin-inline-end: 8px;
}
.pct-bar { height: 100%; }

/* ---------- Auth pages ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.auth-box {
    background: #fff;
    border-radius: 12px;
    padding: 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.auth-title {
    text-align: center;
    color: #4f46e5;
    font-size: 22px;
    margin-bottom: 6px;
}
.auth-subtitle {
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    margin-bottom: 24px;
}
.auth-box label {
    display: block;
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
    margin-top: 14px;
}
.auth-box input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #e0e1e8;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}
.auth-box .btn-primary {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #6b7280;
}
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 10px;
}
.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.alert ul { padding-right: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .navbar-inner { flex-direction: column; align-items: flex-start; }
    .timer-row { flex-direction: column; align-items: stretch; }
    .timer-display { text-align: center; }
    .entries-table { font-size: 12px; }
}
