:root {
  --ink: #17251f;
  --muted: #708078;
  --green: #1f694f;
  --green-dark: #174f3c;
  --green-pale: #e9f4ef;
  --cream: #f6f5f0;
  --line: #e6e9e6;
  --white: #fff;
  --red: #a63838;
  --amber: #9a6218;
  --shadow: 0 10px 35px rgba(26, 44, 36, .07);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, .btn { -webkit-tap-highlight-color: transparent; }

.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--ink); color: #fff; padding: 28px 18px 20px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; color: #fff; background: var(--green); font-family: Georgia, serif; font-size: 24px; font-weight: 700; }
.brand strong { display: block; font-family: Georgia, serif; font-size: 22px; letter-spacing: .2px; }
.brand small { display: block; color: #a9b8b1; font-size: 11px; margin-top: 2px; }
.nav-list { margin-top: 44px; display: grid; gap: 7px; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 0 14px; color: #bac5c0; border-radius: 12px; font-size: 14px; font-weight: 600; }
.nav-link span { width: 19px; text-align: center; font-size: 19px; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.09); }
.nav-link.active { box-shadow: inset 3px 0 #5aaf87; }
.sidebar-user { margin-top: auto; padding: 17px 10px 0; border-top: 1px solid rgba(255,255,255,.1); display: grid; grid-template-columns: 38px minmax(0,1fr) 30px; align-items: center; gap: 10px; }
.sidebar-user strong, .sidebar-user small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { font-size: 13px; }.sidebar-user small { margin-top: 3px; color: #9eaea6; font-size: 11px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #416556; color: #fff; font-weight: 700; }
.avatar.pale { color: var(--green); background: var(--green-pale); }
.logout { border: 0; color: #aebcb5; background: transparent; cursor: pointer; font-size: 19px; padding: 4px; }
.main-column { min-width: 0; }
.mobile-header { display: none; }
.content { width: min(1440px, 100%); margin: auto; padding: 44px 48px 70px; }
.page-heading, .sign-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading.compact { align-items: start; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-family: Georgia, serif; font-size: clamp(30px, 4vw, 43px); line-height: 1.08; letter-spacing: -.5px; }
h2 { margin-bottom: 6px; font-family: Georgia, serif; font-size: 23px; }
h3 { margin-bottom: 5px; font-size: 15px; }
.muted { color: var(--muted); margin-bottom: 0; line-height: 1.5; }
.eyebrow { margin-bottom: 9px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 1.7px; text-transform: uppercase; }
.eyebrow.light { color: #91c6ae; }
.btn { min-height: 43px; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 13px; font-weight: 750; cursor: pointer; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--green); box-shadow: 0 7px 17px rgba(31,105,79,.17); }
.btn-primary:hover { background: var(--green-dark); }
.btn-dark { color: #fff; background: var(--ink); }
.btn-soft { color: #3c4b44; background: #fff; border-color: var(--line); }
.btn-block { width: 100%; }.btn-large { min-height: 52px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.back-link { display: inline-block; margin-bottom: 17px; color: var(--green); font-size: 13px; font-weight: 700; }
.notice, .alert { padding: 13px 15px; margin-bottom: 20px; border-radius: 10px; font-size: 13px; }
.notice { display: flex; gap: 10px; color: #17543d; background: #e4f3ec; border: 1px solid #c8e4d7; }
.alert { color: #852d2d; background: #fff0f0; border: 1px solid #f0cece; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; margin-bottom: 23px; }
.stat-card { min-height: 116px; padding: 22px; display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.stat-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 48px; border-radius: 13px; font-size: 19px; }
.stat-icon.sand { color: #775d35; background: #f4eee1; }.stat-icon.amber { color: #9a6218; background: #fff1d8; }.stat-icon.blue { color: #376883; background: #e7f2f6; }.stat-icon.green { color: var(--green); background: var(--green-pale); }
.stat-card small { color: var(--muted); display: block; font-size: 12px; }.stat-card strong { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 30px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.panel-head { min-height: 84px; padding: 19px 23px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin-bottom: 3px; }.panel-head p { font-size: 12px; }
.text-link { color: var(--green); font-size: 13px; font-weight: 700; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 22px; text-align: left; border-bottom: 1px solid #eef0ee; white-space: nowrap; font-size: 13px; }
th { color: #87928d; font-size: 10px; letter-spacing: .9px; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.doc-name { display: flex; align-items: center; gap: 11px; }
.pdf-icon { width: 36px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; color: #9f4040; background: #faeaea; border-radius: 7px; font-size: 8px; font-weight: 900; }
.pdf-icon.large { width: 43px; height: 48px; }
.status { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status.sent { color: #895b17; background: #fff1d5; }.status.signed { color: #27607c; background: #e6f2f7; }.status.completed { color: #256146; background: #e4f3ec; }
.icon-button { width: 35px; height: 35px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #52625a; background: #fff; cursor: pointer; }
.empty-state { padding: 70px 24px; text-align: center; }.empty-state > span { width: 55px; height: 55px; display: grid; place-items: center; margin: 0 auto 17px; color: var(--green); background: var(--green-pale); border-radius: 50%; font-size: 24px; }.empty-state p { margin: 0; color: var(--muted); }

.tabs { display: flex; gap: 7px; margin-bottom: 18px; padding: 5px; width: fit-content; border: 1px solid var(--line); border-radius: 12px; background: #eceeea; }
.tabs a { min-height: 37px; padding: 0 17px; display: grid; place-items: center; border-radius: 8px; color: #65736c; font-size: 12px; font-weight: 700; }
.tabs a.active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.06); }
.document-panel { overflow: hidden; }
.document-row { padding: 18px 21px; display: grid; grid-template-columns: minmax(260px, 2fr) minmax(140px, .8fr) 110px auto; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.document-row:last-child { border-bottom: 0; }
.doc-main { display: flex; align-items: center; gap: 13px; min-width: 0; }.doc-main div { min-width: 0; }.doc-main h3, .doc-main p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.doc-main p { margin: 0; color: var(--muted); font-size: 11px; }
.doc-person small, .doc-person strong { display: block; }.doc-person small { margin-bottom: 4px; color: var(--muted); font-size: 10px; }.doc-person strong { font-size: 12px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }.row-actions form { margin: 0; }

.form-panel { max-width: 760px; padding: 30px; }.form-panel h2 { margin-bottom: 4px; }.small-panel { align-self: start; }
.form-stack { display: grid; gap: 20px; margin-top: 25px; }
label { color: #35443d; font-size: 12px; font-weight: 750; }
input, select { width: 100%; height: 47px; margin-top: 8px; padding: 0 13px; color: var(--ink); background: #fff; border: 1px solid #d9dedb; border-radius: 9px; outline: none; }
input:focus, select:focus { border-color: #5b9b7d; box-shadow: 0 0 0 3px rgba(31,105,79,.1); }
.file-drop { min-height: 190px; margin-top: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); background: #fbfcfa; border: 1.5px dashed #bfc9c3; border-radius: 13px; cursor: pointer; text-align: center; }
.file-drop input { display: none; }.file-drop small { margin-top: 7px; color: var(--muted); font-weight: 400; }.upload-symbol { width: 46px; height: 46px; margin-bottom: 12px; display: grid; place-items: center; color: var(--green); background: var(--green-pale); border-radius: 50%; font-size: 24px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.two-column { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(430px, 1.25fr); gap: 20px; }
.user-list { padding: 5px 20px; }.user-row { padding: 15px 3px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }.user-row:last-child { border: 0; }.user-row strong, .user-row small { display: block; }.user-row strong { font-size: 13px; }.user-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }.role-pill { padding: 5px 9px; border-radius: 7px; color: var(--green); background: var(--green-pale); font-size: 10px; font-weight: 800; }

.sign-heading { align-items: center; }.sign-heading h1 { font-size: 30px; }
.sign-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 19px; align-items: start; }
.pdf-stage { min-width: 0; overflow: hidden; position: relative; background: #dfe3e0; }
.pdf-toolbar { min-height: 54px; padding: 9px 14px; display: flex; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); font-size: 12px; }.pdf-toolbar .icon-button { width: 32px; height: 32px; }.toolbar-spacer { flex: 1; }
.pdf-page-wrap { position: relative; width: fit-content; max-width: calc(100% - 34px); min-height: 520px; margin: 17px auto; line-height: 0; box-shadow: 0 5px 18px rgba(0,0,0,.16); touch-action: none; }
#pdf-canvas { display: block; max-width: 100%; height: auto; background: #fff; }
.pdf-loading { position: absolute; inset: 54px 0 0; display: grid; place-items: center; color: var(--muted); background: #e4e7e5; font-size: 13px; }
.pdf-loading[hidden] { display: none; }
.signature-panel { padding: 25px; position: sticky; top: 22px; }
.step-badge { width: 25px; height: 25px; margin-bottom: 11px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 11px; font-weight: 800; }
.signature-panel h2 { font-size: 19px; }.signature-panel p { font-size: 12px; }
.signature-pad-wrap { position: relative; height: 155px; margin-top: 18px; background: #fbfcfb; border: 1px dashed #b9c5bf; border-radius: 10px; overflow: hidden; touch-action: none; }
#signature-pad { display: block; width: 100%; height: 100%; cursor: crosshair; }.signature-line { position: absolute; left: 12%; right: 12%; bottom: 34px; border-bottom: 1px solid #cdd4d0; pointer-events: none; }
.signature-tools { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 11px; }.step-divider { border-top: 1px solid var(--line); margin: 25px 0; }
.signature-panel .alert { margin-top: 18px; margin-bottom: 0; }.signature-panel .btn-block { margin-top: 20px; }
.signature-stamp { position: absolute; left: 10%; top: 70%; width: 25%; min-width: 90px; aspect-ratio: 3 / 1; z-index: 5; cursor: move; border: 1px dashed var(--green); background: rgba(255,255,255,.35); touch-action: none; line-height: 0; }
.signature-stamp img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.resize-handle { position: absolute; right: -6px; bottom: -6px; width: 15px; height: 15px; border: 2px solid #fff; border-radius: 50%; background: var(--green); cursor: nwse-resize; }
.error-state { max-width: 560px; margin: 10vh auto; padding: 55px 30px; text-align: center; }.error-state > span { width: 58px; height: 58px; margin: 0 auto 20px; display: grid; place-items: center; color: #8a5515; background: #fff0d6; border-radius: 50%; font: 700 30px Georgia; }.error-state p { color: var(--muted); }.standalone { margin: auto; }

.login-page { background: var(--ink); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.login-intro { min-height: 100vh; padding: 48px clamp(45px, 7vw, 110px); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(circle at 18% 85%, rgba(76,133,106,.35), transparent 30%), linear-gradient(145deg,#17251f,#203b30); }
.brand-light { padding: 0; }.login-intro h1 { max-width: 640px; font-size: clamp(42px,5vw,68px); line-height: 1.02; }.login-copy { max-width: 580px; color: #b9c8c1; font-size: 16px; line-height: 1.7; }
.feature-row { display: flex; flex-wrap: wrap; gap: 25px; color: #c3d2cb; font-size: 12px; }
.login-card { display: grid; place-items: center; padding: 35px; background: #f7f7f3; }.login-form-wrap { width: min(410px,100%); }.login-form-wrap h2 { margin-bottom: 8px; font-size: 31px; }.login-form-wrap .form-stack { margin-top: 32px; }.login-form-wrap input { height: 51px; }.login-form-wrap .btn { height: 52px; margin-top: 6px; }
.scrim { display: none; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .document-row { grid-template-columns: minmax(220px, 1fr) 110px auto; }.doc-person { display: none; }
  .sign-layout { grid-template-columns: 1fr; }.signature-panel { position: static; }
  .two-column { grid-template-columns: 1fr; }.small-panel { max-width: none; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }.sidebar { position: fixed; left: 0; transform: translateX(-102%); width: min(290px, 85vw); transition: transform .2s ease; }.menu-open .sidebar { transform: translateX(0); }.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(13,25,20,.45); }.menu-open .scrim { display: block; }
  .mobile-header { height: 64px; padding: 0 18px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 15; background: rgba(246,245,240,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }.menu-toggle { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }.mobile-brand { display: flex; align-items: center; gap: 9px; font: 18px Georgia,serif; }.mobile-brand .brand-mark { width: 33px; height: 33px; flex-basis: 33px; font-size: 18px; border-radius: 9px; }
  .content { padding: 27px 16px 55px; }.page-heading { align-items: start; }.page-heading .btn { white-space: nowrap; }.page-heading h1 { font-size: 32px; }
  .stats-grid { gap: 10px; }.stat-card { min-height: 98px; padding: 15px; gap: 11px; }.stat-icon { width: 40px; height: 40px; flex-basis: 40px; }.stat-card strong { font-size: 25px; }.stat-card small { font-size: 10px; }
  .panel-head { padding: 17px; }.document-row { grid-template-columns: 1fr auto; padding: 16px; gap: 13px; }.document-row > .status { align-self: start; }.row-actions { grid-column: 1 / -1; justify-content: stretch; }.row-actions .btn, .row-actions form { flex: 1; }.row-actions form .btn { width: 100%; }
  .form-panel { padding: 21px; }.tabs { width: 100%; }.tabs a { flex: 1; padding: 0 9px; }.two-column { display: block; }.two-column > * + * { margin-top: 18px; }
  .sign-heading { align-items: start; }.sign-heading h1 { font-size: 25px; }.sign-layout { gap: 13px; }.pdf-toolbar .muted { display: none; }.pdf-page-wrap { min-height: 360px; max-width: calc(100% - 16px); margin: 8px auto; }.signature-panel { padding: 20px; }
  .login-shell { display: block; }.login-intro { display: none; }.login-card { min-height: 100vh; padding: 26px; }.login-form-wrap::before { content: 'İ'; width: 50px; height: 50px; margin-bottom: 35px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 14px; font: 700 27px Georgia; }
}

@media (max-width: 460px) {
  .page-heading { display: block; }.page-heading > .btn { width: 100%; margin-top: 18px; }.stats-grid { grid-template-columns: 1fr 1fr; }.stat-card { display: block; }.stat-icon { margin-bottom: 10px; }.doc-main .pdf-icon { display: none; }.document-row { grid-template-columns: minmax(0,1fr) auto; }.row-actions { flex-wrap: wrap; }.row-actions .btn { min-width: 75px; }.form-actions .btn { flex: 1; }
}
