:root {
    --navy: #0f3760;
    --navy-dark: #092945;
    --blue: #1769aa;
    --bg: #f3f6f9;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #dbe3ea;
    --success: #23835b;
    --danger: #c63f46;
    --warning: #d88a13;
    --shadow: 0 8px 28px rgba(15, 55, 96, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.topbar { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); color: #fff; box-shadow: 0 3px 18px rgba(9, 41, 69, .18); }
.topbar-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; flex: 0 0 auto; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 16px; letter-spacing: .35px; }
.brand small { opacity: .82; font-size: 13px; margin-top: 2px; }
.user-area { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; opacity: .9; }

.page-space { padding-top: 28px; padding-bottom: 36px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
.page-heading h1, .panel h1 { margin: 0; color: var(--navy-dark); font-size: 27px; }
.page-heading p, .panel-head p { margin: 5px 0 0; color: var(--muted); }
.heading-actions { display: flex; gap: 9px; align-items: center; }

.btn { appearance: none; border: 1px solid transparent; border-radius: 8px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; text-decoration: none; cursor: pointer; transition: .15s ease; min-height: 42px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-secondary { background: #e8eef4; color: var(--navy-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); color: #fff; }
.btn-outline { background: #fff; border-color: #b8c5d1; color: var(--navy); }
.btn-danger-outline { background: #fff; border-color: #e5a9ac; color: #a52930; }
.btn-small { min-height: 34px; padding: 7px 10px; font-size: 13px; }
.btn-block { width: 100%; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.summary-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 17px 19px; text-decoration: none; box-shadow: 0 3px 14px rgba(15,55,96,.04); }
.summary-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.summary-card.today::before { background: var(--success); }
.summary-card.overdue::before { background: var(--danger); }
.summary-card.done::before { background: #6f7e8c; }
.summary-card.active { border-color: #99b6d0; box-shadow: 0 5px 20px rgba(15,55,96,.11); }
.summary-card strong { font-size: 29px; color: var(--navy-dark); float: right; line-height: 1; }
.summary-label { color: var(--muted); font-weight: 600; font-size: 14px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { padding: 19px 21px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-head.simple { align-items: flex-start; }
.panel-head h2 { margin: 0; color: var(--navy-dark); font-size: 19px; }
.search-form { display: flex; gap: 8px; min-width: min(420px, 100%); }
.search-form input { min-width: 0; flex: 1; }

input, select, textarea { width: 100%; border: 1px solid #cbd5df; border-radius: 8px; background: #fff; color: var(--text); padding: 10px 11px; outline: none; }
input, select { min-height: 43px; }
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: #6c9ac2; box-shadow: 0 0 0 3px rgba(23,105,170,.10); }

.reminder-list { padding: 4px 20px 18px; }
.reminder-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 4px; border-bottom: 1px solid #e7edf2; }
.reminder-card:last-child { border-bottom: 0; }
.reminder-card.is-overdue { border-left: 3px solid #e05c63; padding-left: 12px; }
.reminder-card.priority-high:not(.is-overdue) { border-left: 3px solid var(--warning); padding-left: 12px; }
.reminder-card.is-done { opacity: .72; }
.reminder-main { min-width: 0; flex: 1; }
.reminder-main h3 { margin: 8px 0 3px; color: #1f3448; font-size: 18px; overflow-wrap: anywhere; }
.is-done .reminder-main h3 { text-decoration: line-through; }
.reminder-note { margin: 4px 0 0; color: #53616e; white-space: pre-line; overflow-wrap: anywhere; }
.reminder-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.date-badge { color: var(--navy-dark); font-weight: 700; font-size: 13px; }
.tag { background: #edf2f7; color: #53616e; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700; }
.tag-danger { background: #fdebec; color: #a72d34; }
.tag-success { background: #e7f5ee; color: #1b7651; }
.priority-yuksek { background: #fff1dd; color: #9a5d05; }
.reminder-actions { display: flex; flex: 0 0 auto; gap: 7px; align-items: center; }
.reminder-actions form { margin: 0; }

.directory-stats { color: var(--muted); font-size: 13px; font-weight: 600; }
.contact-list { padding: 4px 20px 18px; }
.contact-card { display: grid; grid-template-columns: minmax(210px, 1.35fr) repeat(5, minmax(110px, 1fr)) auto; gap: 14px; align-items: center; padding: 16px 4px; border-bottom: 1px solid #e7edf2; }
.contact-card:last-child { border-bottom: 0; }
.contact-name { min-width: 0; }
.contact-name strong { display: block; color: #1f3448; font-size: 16px; overflow-wrap: anywhere; }
.contact-item { min-width: 0; }
.contact-item small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .35px; }
.contact-item span, .contact-item a { display: block; color: #405466; font-size: 13px; overflow-wrap: anywhere; text-decoration: none; }
.contact-item a:hover { color: var(--blue); text-decoration: underline; }
.contact-actions { display: flex; gap: 7px; justify-content: flex-end; }

.empty-state { text-align: center; padding: 50px 18px; color: var(--muted); }
.empty-state h3 { color: #435365; margin: 10px 0 4px; }
.empty-state p { margin: 0; }
.empty-icon { margin: 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #eaf4ee; color: var(--success); font-weight: 800; font-size: 21px; }

.form-page { max-width: 900px; }
.form-panel { padding-bottom: 22px; }
.entry-form { padding: 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; color: #34495c; font-weight: 600; font-size: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid #e7edf2; padding-top: 18px; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #eef5fb 0, #f4f7fa 42%, #eaf0f5 100%); }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 55px rgba(15,55,96,.13); padding: 30px; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo { width: 86px; height: 86px; object-fit: contain; margin-bottom: 10px; }
.login-brand h1 { margin: 0; font-size: 19px; color: var(--navy-dark); letter-spacing: .4px; }
.login-brand p { margin: 5px 0 0; color: var(--muted); }
.form-stack { display: grid; gap: 15px; }
.login-footer { text-align: center; margin-top: 22px; padding-top: 17px; border-top: 1px solid #edf1f4; color: #84909c; font-size: 12px; }
.alert { margin: 0 0 17px; padding: 11px 13px; border-radius: 8px; font-size: 14px; }
.alert-danger { background: #fdebec; color: #8e252b; border: 1px solid #f3c7ca; }
.alert-success { background: #eaf6ef; color: #176a49; border: 1px solid #c9e7d7; }
.setup-card { width: min(500px, 100%); }
.setup-info { background: #f5f8fa; border: 1px solid #e0e7ed; border-radius: 8px; padding: 13px; margin-bottom: 16px; color: #455666; font-size: 14px; }
.confirm-card { text-align: center; }
.confirm-card h1 { color: var(--navy-dark); font-size: 23px; margin-bottom: 14px; }
.confirm-icon { width: 50px; height: 50px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 50%; background: #fdebec; color: var(--danger); font-size: 27px; font-weight: 800; }
.confirm-actions { display: flex; justify-content: center; gap: 9px; margin-top: 22px; }
.muted { color: var(--muted); }
.site-footer { text-align: center; color: #7a8793; font-size: 12px; padding: 0 16px 28px; }

@media (max-width: 760px) {
    .container { width: min(100% - 22px, 1180px); }
    .topbar-inner { min-height: 70px; gap: 10px; }
    .brand img { width: 44px; height: 44px; }
    .brand strong { font-size: 13px; }
    .brand small { font-size: 11px; }
    .user-name { display: none; }
    .page-space { padding-top: 19px; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading h1, .panel h1 { font-size: 23px; }
    .page-heading > .btn { width: 100%; }
    .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .heading-actions .btn { width: 100%; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
    .summary-card { padding: 14px; }
    .summary-card strong { font-size: 25px; }
    .panel-head { align-items: stretch; flex-direction: column; padding: 16px; }
    .search-form { min-width: 0; width: 100%; }
    .reminder-list { padding: 2px 14px 12px; }
    .reminder-card { align-items: stretch; flex-direction: column; gap: 13px; padding-top: 16px; padding-bottom: 16px; }
    .reminder-actions { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
    .reminder-actions form, .reminder-actions .btn, .reminder-actions form .btn { width: 100%; }
    .contact-list { padding: 2px 14px 12px; }
    .contact-card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px 2px; }
    .contact-name { grid-column: 1 / -1; padding-bottom: 2px; }
    .contact-actions { grid-column: 1 / -1; justify-content: stretch; }
    .contact-actions .btn { flex: 1; }
    .entry-form { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
    .field-full { grid-column: auto; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .login-body { padding: 15px; }
    .login-card { padding: 23px 18px; }
}

@media (max-width: 420px) {
    .brand small { display: none; }
    .brand strong { max-width: 190px; }
    .summary-label { display: block; }
    .summary-card strong { float: none; display: block; margin-top: 6px; }
    .reminder-actions { grid-template-columns: 1fr; }
    .search-form { display: grid; grid-template-columns: 1fr auto; }
    .heading-actions { grid-template-columns: 1fr; }
    .contact-card { grid-template-columns: 1fr; }
    .contact-name, .contact-actions { grid-column: auto; }
}
