/* ============================================================
   Dekont Oluşturma Sistemi - Ana Stil Dosyası
   ============================================================ */

/* Reset & Temel */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #eef1f5;
    color: #333;
    min-height: 100vh;
}

/* ---- Navbar ---- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a2e;
    padding: 0 24px;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.3px;
}
.brand-icon { font-size: 22px; }
.nav-links { display: flex; gap: 6px; }
.nav-link {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: all .2s;
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}

/* ---- Ana Düzen ---- */
.app-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    min-height: calc(100vh - 56px);
}

/* ---- Sol Panel (Form) ---- */
.form-panel {
    background: #fff;
    border-right: 1px solid #dde1e9;
    overflow-y: auto;
    max-height: calc(100vh - 56px);
    padding-bottom: 20px;
}
.panel-header {
    padding: 20px 20px 14px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #f8f9ff, #eff2fb);
}
.panel-header h2 { font-size: 16px; color: #1a1a2e; margin-bottom: 3px; }
.panel-header p  { font-size: 12px; color: #888; }

/* ---- Tema Seçimi ---- */
.theme-selector { padding: 16px 20px 0; }
.section-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}
.theme-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.theme-btn {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    transition: all .2s;
    outline: none;
}
.theme-btn:hover {
    border-color: var(--tema-renk, #1a73e8);
    color: var(--tema-renk, #1a73e8);
}
.theme-btn.active {
    background: var(--tema-renk, #1a73e8);
    border-color: var(--tema-renk, #1a73e8);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* ---- Form ---- */
.dekont-form { padding: 0 20px; }
.form-section { margin-top: 18px; }
.section-title {
    font-size: 12px;
    font-weight: 700;
    color: #1a73e8;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8f0fe;
    margin-bottom: 10px;
}
.form-group { margin-bottom: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}
.req { color: #e53e3e; }
input[type=text],
input[type=number],
input[type=date],
input[type=time],
input[type=email],
input[type=password] {
    width: 100%;
    padding: 9px 11px;
    border: 1.5px solid #dde1e9;
    border-radius: 7px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    background: #fafbfe;
    color: #222;
}
input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,.1);
    background: #fff;
}
.help-text { font-size: 11px; color: #999; margin-top: 3px; display: block; }
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; }
.input-with-btn button {
    padding: 9px 12px;
    background: #f0f2f9;
    border: 1.5px solid #dde1e9;
    border-radius: 7px;
    cursor: pointer;
    font-size: 16px;
    transition: background .2s;
}
.input-with-btn button:hover { background: #dde1e9; }

/* ---- Form Butonları ---- */
.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 14px;
    border-radius: 7px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary   { background: #1a73e8; color: white; }
.btn-primary:hover { background: #1557b0; }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #545b62; }
.btn-success   { background: #34a853; color: white; }
.btn-success:hover { background: #2d8f47; }
.btn-danger    { background: #ea4335; color: white; }
.btn-danger:hover  { background: #c5352a; }
.btn-full { width: 100%; }

/* ---- Sağ Panel (Önizleme) ---- */
.preview-panel {
    background: #f0f2f8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - 56px);
}
.preview-panel .panel-header {
    background: linear-gradient(135deg, #f0f2f8, #e4e9f5);
    border-right: none;
    flex-shrink: 0;
}
.preview-wrapper {
    flex: 1;
    overflow: auto;
    padding: 20px 10px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    min-width: 0;
}
.dekont-preview-area {
    transform-origin: top left;
    transition: transform .2s;
    flex-shrink: 0;
}
.preview-placeholder {
    text-align: center;
    color: #aaa;
    padding: 60px 20px;
    font-size: 14px;
}
.preview-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #dde1e9;
    flex-shrink: 0;
}
.preview-controls button {
    width: 32px; height: 32px;
    border: 1.5px solid #dde1e9;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 16px;
    transition: background .2s;
}
.preview-controls button:hover { background: #f0f2f8; }
#zoomLabel { font-size: 13px; color: #666; min-width: 44px; text-align: center; }
#btnZoomReset { width: auto; padding: 0 10px; font-size: 12px; }

/* ---- Modal ---- */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.modal-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.modal-icon { font-size: 50px; margin-bottom: 12px; }
.modal-msg  { font-size: 14px; color: #444; line-height: 1.5; }

/* ---- Loading Overlay ---- */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
    font-size: 16px;
    gap: 12px;
}
.spinner {
    width: 30px; height: 30px;
    border: 3px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Admin Sayfaları ---- */
.admin-container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    overflow: hidden;
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a1a2e, #0d3460);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h2 { font-size: 16px; }
.card-body { padding: 20px; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    background: #f5f7fa;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #666;
    border-bottom: 2px solid #e0e4ed;
}
td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f2f8;
    color: #333;
}
tr:hover td { background: #f8f9ff; }
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-admin { background: #e8f0fe; color: #1a73e8; }
.badge-user  { background: #e6f4ea; color: #34a853; }

/* ---- Login Sayfası ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    padding: 20px;
}
.login-box {
    background: white;
    border-radius: 12px;
    padding: 36px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .icon { font-size: 50px; }
.login-logo h1 { font-size: 20px; color: #1a1a2e; margin-top: 8px; }
.login-logo p { font-size: 13px; color: #888; margin-top: 4px; }
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-danger  { background: #fde8e8; color: #c0392b; border-left: 4px solid #c0392b; }
.alert-success { background: #e6f4ea; color: #27ae60; border-left: 4px solid #27ae60; }
.alert-info    { background: #e8f0fe; color: #1a73e8; border-left: 4px solid #1a73e8; }
.alert-warning { background: #fff8e1; color: #b7791f; border-left: 4px solid #f6ad55; }

/* ---- Stats Kartları ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-icon { font-size: 32px; }
.stat-info label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .4px; }
.stat-info .stat-value { font-size: 22px; font-weight: 700; color: #1a1a2e; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .app-container { grid-template-columns: 1fr; }
    .form-panel { max-height: none; border-right: none; border-bottom: 1px solid #dde1e9; }
    .preview-panel { max-height: none; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1; min-width: 120px; }
    .navbar { padding: 0 14px; }
}
