:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #ede9fe;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(79,70,229,.10);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

/* ── Layout ── */
.page-wrapper { min-height: 100vh; }

.form-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 48px 24px 80px;
    text-align: center;
    color: #fff;
}
.form-hero .logo { height: 44px; margin-bottom: 24px; }
.form-hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.form-hero p  { opacity: .85; font-size: 1.05rem; }

.form-container {
    max-width: 780px;
    margin: -48px auto 48px;
    padding: 0 16px;
}

/* ── Card ── */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-body { padding: 40px; }
@media(max-width:600px){ .card-body { padding: 24px 20px; } }

/* ── Section headers ── */
.section-title {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title svg { flex-shrink: 0; }

.form-section { margin-bottom: 32px; }

/* ── Form elements ── */
.field { margin-bottom: 20px; }

label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
label .req { color: var(--danger); margin-left: 2px; }

input[type=text],
input[type=email],
input[type=url],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: .9rem;
    color: var(--gray-900);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
textarea { resize: vertical; min-height: 90px; }

.field-hint {
    font-size: .78rem;
    color: var(--gray-400);
    margin-top: 5px;
    line-height: 1.4;
}

/* ── File upload ── */
.file-upload-area {
    border: 2px dashed var(--gray-200);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
    background: var(--gray-50);
}
.file-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.file-upload-area input[type=file] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-upload-icon { font-size: 2rem; margin-bottom: 8px; }
.file-upload-text { font-size: .85rem; color: var(--gray-600); }
.file-upload-text strong { color: var(--primary); }
.file-name { margin-top: 8px; font-size: .8rem; color: var(--success); font-weight: 600; display: none; }

/* ── Radio cards ── */
.radio-cards { display: grid; gap: 10px; }
.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
}
.radio-card:hover { border-color: var(--primary); background: var(--primary-light); }
.radio-card input[type=radio] { margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.radio-card-content { flex: 1; }
.radio-card-title { font-weight: 600; font-size: .9rem; display: block; }
.radio-card-desc  { font-size: .78rem; color: var(--gray-600); margin-top: 2px; line-height: 1.4; }
input[type=radio]:checked + .radio-card-content { color: var(--primary); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }

/* ── Checkboxes ── */
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media(max-width:480px){ .checkbox-grid { grid-template-columns: 1fr; } }

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    font-size: .875rem;
}
.checkbox-item:hover { border-color: var(--primary); background: var(--primary-light); }
.checkbox-item input { accent-color: var(--primary); }
.checkbox-item:has(input:checked) { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* ── SPF info box ── */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: .82rem;
    color: #1e40af;
    margin-bottom: 12px;
}
.info-box code {
    display: block;
    margin-top: 6px;
    background: #dbeafe;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: monospace;
    word-break: break-all;
    font-size: .8rem;
}

/* ── Submit button ── */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    letter-spacing: .02em;
}
.btn-submit:hover  { opacity: .92; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Progress steps ── */
.steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
    padding: 0 8px;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--gray-200);
}
.step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    font-weight: 700;
    font-size: .8rem;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
}
.step.active .step-num { background: var(--primary); color: #fff; }
.step-label { font-size: .7rem; color: var(--gray-400); margin-top: 4px; text-align: center; }
.step.active .step-label { color: var(--primary); font-weight: 600; }

/* ── Success page ── */
.success-card {
    max-width: 540px;
    margin: 80px auto;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 40px;
    text-align: center;
}
.success-icon { font-size: 3.5rem; margin-bottom: 16px; }
.success-card h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.success-card p  { color: var(--gray-600); margin-bottom: 8px; }
.ref-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: .1em;
    padding: 10px 24px;
    border-radius: 8px;
    margin: 16px 0;
}

/* ── Admin ── */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 240px;
    background: var(--gray-900);
    color: #fff;
    padding: 24px 0;
    flex-shrink: 0;
}
.admin-sidebar .brand {
    padding: 0 24px 24px;
    font-weight: 800;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 16px;
    line-height: 1.4;
}
.admin-sidebar .brand span { color: #a5b4fc; }
.admin-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 24px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .875rem;
    transition: all .2s;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.08); color: #fff; }

.admin-main { flex: 1; padding: 32px; overflow-y: auto; background: var(--gray-50); }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-header h1 { font-size: 1.4rem; font-weight: 700; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.stat-card .num { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: .75rem; color: var(--gray-600); margin-top: 2px; }

.table-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.table-toolbar {
    padding: 16px 20px;
    display: flex; gap: 12px; align-items: center;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
}
.table-toolbar input, .table-toolbar select {
    padding: 8px 12px; border-radius: 8px; border: 1.5px solid var(--gray-200);
    font-size: .85rem; outline: none;
}
.table-toolbar input:focus, .table-toolbar select:focus { border-color: var(--primary); }
.table-toolbar input { flex: 1; min-width: 180px; }

table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { padding: 12px 16px; text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-400); border-bottom: 1px solid var(--gray-100); }
td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: .72rem; font-weight: 700; letter-spacing: .03em;
}
.badge-bekliyor  { background: #fef9c3; color: #854d0e; }
.badge-islemde   { background: #dbeafe; color: #1e40af; }
.badge-tamamlandi{ background: #dcfce7; color: #166534; }
.badge-iptal     { background: #fee2e2; color: #991b1b; }

.btn-sm {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost   { background: var(--gray-100); color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-200); }

/* Admin detail */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:640px){ .detail-grid { grid-template-columns: 1fr; } }

.detail-field { margin-bottom: 0; }
.detail-field .lbl { font-size: .72rem; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.detail-field .val { font-size: .9rem; color: var(--gray-900); }

.note-area {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: .875rem;
    resize: vertical;
    min-height: 100px;
    outline: none;
}
.note-area:focus { border-color: var(--primary); }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: .875rem;
    margin-bottom: 16px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* Admin login */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}
.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 40px;
    width: 360px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-card h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.login-card p  { color: var(--gray-600); font-size: .875rem; margin-bottom: 24px; }
.login-card .field label { font-size: .85rem; }
.login-card input[type=password] {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200);
    border-radius: 8px; font-size: .9rem; outline: none;
}
.login-card input[type=password]:focus { border-color: var(--primary); }
.login-card .btn-submit { margin-top: 16px; font-size: .9rem; padding: 12px; }
.error-msg { color: var(--danger); font-size: .8rem; margin-top: 8px; }
