/* Tekne Kooperatifi Takip Sistemi — temel stil */
:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #1f2933;
    --muted: #6b7785;
    --line: #d9e0e6;
    --primary: #1d6fa5;
    --primary-dark: #155a86;
    --danger: #c0392b;
    --ok: #2e7d4f;
    --radius: 6px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }code { background: #eef2f5; padding: 1px 5px; border-radius: 3px; font-size: .85em; }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }

/* --- Layout --- */
.container { max-width: 1080px; margin: 1.25rem auto; padding: 0 1rem; }
.site-footer { text-align: center; color: var(--muted); padding: 2rem 0 1rem; font-size: .85rem; }

/* --- Nav --- */
.topnav { background: #0f2b3d; color: #fff; }
.topnav-inner { max-width: 1080px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; gap: 1.25rem; min-height: 52px; flex-wrap: wrap; }
.topnav a, .topnav .dropbtn { color: #cdd9e1; text-decoration: none; padding: .4rem .1rem; display: inline-block; cursor: pointer; }
.topnav a:hover, .topnav .dropbtn:hover { color: #fff; }
.topnav a.active, .topnav .dropbtn.active { color: #fff; border-bottom: 2px solid var(--primary); }
.topnav .brand { font-weight: 700; color: #fff; font-size: 1rem; }
.navlinks { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.navuser { margin-left: auto; display: flex; gap: .9rem; align-items: center; font-size: .85rem; color: #9fb3c0; }
.dropdown { position: relative; }
.dropmenu { display: none; position: absolute; top: 100%; left: 0; background: #12384f; min-width: 190px; border-radius: 0 0 var(--radius) var(--radius); padding: .35rem 0; z-index: 20; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.dropdown:hover .dropmenu { display: block; }
.dropmenu a { display: block; padding: .5rem .9rem; }
.dropmenu a:hover { background: #1a4864; }

/* --- Page head --- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.muted { color: var(--muted); }

/* --- Panels --- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1.15rem; }

/* --- Buttons --- */
.btn { display: inline-block; background: #eef2f5; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .85rem; font-size: .875rem; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: #e2e8ec; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-link { background: none; border: none; color: var(--primary); padding: .45rem .3rem; }
.btn-sm { padding: .25rem .55rem; font-size: .8rem; }
.btn-block { width: 100%; text-align: center; }

/* --- Forms --- */
.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; max-width: 640px; }
.field { margin-bottom: 1rem; }
.field > label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .85rem; }
.field input[type=text], .field input[type=password], .field input[type=email], .field input[type=search],
.field input[type=date], .field input[type=time], .field input[type=datetime-local], .field input[type=month],
.field input[type=number], .field input[type=tel], .field input[type=url], .field input:not([type]),
.field select, .field textarea {
    width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: #fff;
}
.field textarea { resize: vertical; }
.field .hint { display: block; color: var(--muted); font-size: .78rem; margin-top: .25rem; }
.field .error-text { display: block; color: var(--danger); font-size: .8rem; margin-top: .25rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.req { color: var(--danger); }
.check { display: flex; align-items: center; gap: .45rem; font-weight: 400; margin: .25rem 0; }
.check input { width: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-actions { margin-top: 1rem; display: flex; gap: .6rem; align-items: center; }
.form-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.form-inline input:not([type=checkbox]):not([type=radio]),
.form-inline select {
    padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: #fff;
}
.filters { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.filters input:not([type=checkbox]):not([type=radio]), .filters select {
    padding: .45rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: #fff;
}

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.data th, table.data td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: #eef2f5; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.data tr:last-child td { border-bottom: none; }
table.data .empty { text-align: center; color: var(--muted); padding: 1.5rem; }
.row-inactive td { opacity: .55; }
.col-actions { white-space: nowrap; display: flex; gap: .35rem; align-items: center; }
.col-actions form { display: inline; margin: 0; }
table.matrix td, table.matrix th { font-size: .82rem; }
.group-row td { background: #f0f4f7; font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; }
.override-cell label { margin-right: .8rem; font-size: .8rem; }

/* --- Badges --- */
.badge { display: inline-block; background: #e7edf1; color: #40515e; border-radius: 20px; padding: .1rem .55rem; font-size: .75rem; }
.badge-ok { background: #dff0e5; color: var(--ok); }
.badge-muted { background: #ececec; color: #888; }

/* --- Flash --- */
.flash-stack { margin-bottom: 1rem; }
.flash { padding: .65rem .9rem; border-radius: var(--radius); margin-bottom: .5rem; border: 1px solid transparent; }
.flash-success { background: #e4f4ea; border-color: #b7e0c5; color: #1f6b41; }
.flash-error { background: #fbe6e3; border-color: #f0b7ae; color: #a5281a; }
.flash-info { background: #e6f0f6; border-color: #b3d3e5; color: #1c5a7d; }

/* --- Pagination --- */
.pagination { display: flex; gap: .3rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.pagination .page { padding: .3rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pagination .page.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-info { color: var(--muted); font-size: .8rem; margin-left: .5rem; }

/* --- Dashboard --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-num { display: block; font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--muted); font-size: .82rem; }

/* --- Boat boxes (panel) — yoğun POS ızgarası --- */
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: middle; }
.dot-green { background: #2e7d4f; }
.dot-yellow { background: #d9a520; }
.dot-red { background: #c0392b; }

.boat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 3px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.boat-box {
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    text-align: center; text-decoration: none;
    padding: .45rem .3rem .35rem;
    min-height: 62px;
    color: #fff;
    line-height: 1.15;
}
.boat-box:hover { text-decoration: none; filter: brightness(1.06); }
.boat-name { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; word-break: break-word; }
.boat-num  { font-size: 1.15rem; font-weight: 700; }

.boat-green  { background: #2e7d4f; }
.boat-yellow { background: #d9a520; color: #201800; }
.boat-red    { background: #b23b30; }

/* --- POS satış ekranı --- */
.pos { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; }
.pos-head { display: flex; justify-content: space-between; align-items: center; background: #eef2f5; border-radius: var(--radius); padding: .5rem .8rem; font-size: .9rem; flex-wrap: wrap; gap: .4rem; }
.pos-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.25rem; }
.pos-col h3 { font-size: .95rem; margin: 1rem 0 .5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
.pos-col h3:first-child { margin-top: 0; }
.pos .field { margin-bottom: .6rem; }
.pos input.num { text-align: right; }
table.pax { width: 100%; border-collapse: collapse; }
table.pax td { padding: .25rem .3rem; vertical-align: middle; }
table.pax td:first-child { width: 68px; font-weight: 600; }
table.pax input.num { width: 100%; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
table.pax input.ro { width: 100%; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; text-align: right; background: #eef2f5; color: var(--muted); }
table.pax .rt { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); width: 90px; }
table.pay { width: 100%; border-collapse: collapse; }
table.pay td { padding: .28rem .3rem; }
table.pay .pay-lbl { font-size: .85rem; white-space: nowrap; }
table.pay input.pay-amt { width: 100%; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; text-align: right; }
.pos-totals { margin-top: .8rem; border-top: 2px solid var(--line); padding-top: .6rem; }
.pos-totals > div { display: flex; justify-content: space-between; padding: .2rem 0; font-size: .95rem; }
.pos-totals strong { font-variant-numeric: tabular-nums; }
.pos-foot { display: flex; justify-content: flex-end; margin-top: 1.1rem; }
.btn-save { font-size: 1.1rem; font-weight: 700; padding: .9rem 2.8rem; letter-spacing: .04em; }
table.pay thead th { font-size: .72rem; text-transform: uppercase; color: var(--muted); text-align: left; padding-bottom: .3rem; }
table.pay select { padding: .35rem .4rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; width: 100%; }
@media (max-width: 720px) { .pos-grid { grid-template-columns: 1fr; } }

/* --- Raporlar (yatay çubuklar) --- */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 150px; align-items: center; gap: 10px; font-size: .85rem; }
.bar-label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: #e7edf1; border-radius: 3px; height: 14px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.filters label { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
@media (max-width: 640px) { .bar-row { grid-template-columns: 90px 1fr 110px; } }

/* --- Auth --- */
.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; width: 340px; }
.auth-card h1 { font-size: 1.15rem; margin-bottom: .25rem; }
.auth-card p { margin-top: 0; }

/* --- Permission matrix --- */
.perm-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.perm-group { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .75rem; }
.perm-group legend { font-weight: 700; padding: 0 .3rem; }

@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .navuser { width: 100%; margin-left: 0; }
}
