@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@500;700;900&family=IBM+Plex+Sans+Arabic:wght@400;500;600&display=swap');

:root {
    --ink: #1E2233;
    --ink-soft: #3A3F58;
    --paper: #F1EFEA;
    --panel: #FFFFFF;
    --line: #E2DFD6;
    --gold: #C68A2E;
    --gold-deep: #A66F1E;
    --danger: #B33A3A;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(30,34,51,0.06), 0 6px 20px rgba(30,34,51,0.06);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    background: var(--paper);
    background-image:
        radial-gradient(circle at 1px 1px, rgba(30,34,51,0.06) 1px, transparent 0);
    background-size: 22px 22px;
    color: var(--ink);
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3 { font-family: 'Tajawal', sans-serif; font-weight: 900; margin: 0 0 .3em; }

a { color: inherit; }

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.topbar {
    background: var(--ink);
    color: #F1EFEA;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 900;
    font-size: 1.15rem;
}

.brand .dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(198,138,46,0.25);
}

.topbar nav { display: flex; gap: 22px; font-size: .95rem; }
.topbar nav a { text-decoration: none; opacity: .85; padding-bottom: 3px; border-bottom: 2px solid transparent; }
.topbar nav a:hover, .topbar nav a.active { opacity: 1; border-color: var(--gold); }

.wrap { max-width: 880px; margin: 0 auto; padding: 32px 20px 80px; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.page-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: .95rem; }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--gold); color: #1E2233; font-weight: 700;
    border: none; border-radius: 8px; padding: 10px 18px;
    cursor: pointer; text-decoration: none; font-size: .95rem;
    transition: transform .08s ease, background .15s ease;
}
.btn:hover { background: var(--gold-deep); color: #fff; }
.btn:active { transform: scale(.97); }
.btn.secondary { background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.btn.secondary:hover { background: #f6f4ef; color: var(--ink); }
.btn.danger { background: #fdf0f0; color: var(--danger); border: 1px solid #f0d3d3; }
.btn.danger:hover { background: var(--danger); color: #fff; }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 18px;
}

.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.list-tab {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 16px 16px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .12s ease;
}
.list-tab:hover { transform: translateY(-2px); }
.list-tab::before {
    content: "";
    position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
    width: 6px;
    background: var(--list-color, var(--gold));
}
.list-tab .name { font-family: 'Tajawal', sans-serif; font-weight: 700; font-size: 1.05rem; display: block; margin-bottom: 4px; }
.list-tab .count { color: var(--ink-soft); font-size: .85rem; }

.dot-sw { width: 14px; height: 14px; border-radius: 50%; display: inline-block; vertical-align: middle; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 0; border-bottom: 1px dashed var(--line);
}
.timeline li:last-child { border-bottom: none; }

.clock-badge {
    flex: none;
    background: var(--ink);
    color: #F1EFEA;
    font-weight: 700;
    font-size: .82rem;
    border-radius: 999px;
    padding: 6px 12px;
    text-align: center;
    min-width: 64px;
}

.reminder-body { flex: 1; }
.reminder-body .title { font-weight: 700; font-family: 'Tajawal', sans-serif; }
.reminder-body .desc { color: var(--ink-soft); font-size: .9rem; margin-top: 2px; }
.reminder-body .date { color: var(--ink-soft); font-size: .8rem; margin-top: 4px; }
.reminder-actions { flex: none; display: flex; gap: 8px; }
.reminder-actions a { font-size: .82rem; text-decoration: none; color: var(--ink-soft); border-bottom: 1px dotted var(--ink-soft); }
.reminder-actions a.del { color: var(--danger); border-color: var(--danger); }

.form-grid { display: grid; gap: 14px; }
.form-grid label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.form-grid input[type=text], .form-grid input[type=email], .form-grid input[type=password],
.form-grid input[type=date], .form-grid input[type=time], .form-grid input[type=number],
.form-grid textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    font-family: inherit; font-size: .95rem; background: #FCFBF8;
}
.form-grid textarea { min-height: 80px; resize: vertical; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 140px; }

.color-picker { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.color-picker input[type=radio] { display: none; }
.color-picker .swatch {
    width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
    display: inline-block;
}
.color-picker input[type=radio]:checked + .swatch { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

.empty {
    text-align: center; padding: 50px 20px; color: var(--ink-soft);
    border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel);
}

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; }
.login-card .brand { justify-content: center; margin-bottom: 18px; color: var(--ink); font-size: 1.3rem; }

.hint {
    background: #FBF3E2; border: 1px solid #EAD9AE; color: #6B4E14;
    border-radius: 8px; padding: 12px 14px; font-size: .85rem; margin-bottom: 16px;
}

code {
    background: #F1EFEA; border: 1px solid var(--line); border-radius: 5px;
    padding: 2px 6px; font-size: .85em; word-break: break-all;
}

.error-msg { background: #fdf0f0; border: 1px solid #f0d3d3; color: var(--danger); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem; }
.success-msg { background: #eef7ee; border: 1px solid #c9e5c9; color: #2F6A2F; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem; }

@media (max-width: 600px) {
    .topbar { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
    .wrap { padding: 22px 14px 60px; }
}
