/* assets/css/app.css — 2K Karavan Premium Beyaz Tema */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Renkler */
  --bg:          #f5f6fa;
  --bg2:         #ffffff;
  --bg3:         #eef0f6;
  --border:      #e2e5ef;
  --border2:     #d0d4e4;
  --text:        #1a1d2e;
  --text2:       #4a5068;
  --text3:       #9399b2;
  --accent:      #1a1d2e;
  --accent2:     #2d3254;
  --gold:        #c8922a;
  --gold-light:  #f9f0e1;
  --green:       #1a7a4a;
  --green-light: #e8f5ee;
  --red:         #c0392b;
  --red-light:   #fdecea;
  --blue:        #1e4fa8;
  --blue-light:  #e8effe;
  --purple:      #6b3fa8;
  --purple-light:#f0eaff;
  --orange:      #c45f10;
  --orange-light:#fff1e6;
  --wa:          #1a7a3a;
  --wa-light:    #e8f5ee;

  /* Tipografi */
  --font:      'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Gölge */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 2px 8px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.1),  0 2px 8px rgba(0,0,0,.06);

  /* Radius */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
}

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

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */
.app-wrap { display: flex; min-height: 100vh; }

/* Header */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 56px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  box-shadow: var(--shadow-sm);
}

.header-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.header-logo img { height: 34px; width: auto; object-fit: contain; }
.header-logo-text { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.header-logo-text span { color: var(--gold); }

.header-right { display: flex; align-items: center; gap: 10px; }

.notif-btn {
  position: relative; background: none; border: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: background .15s;
}
.notif-btn:hover { background: var(--bg3); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 16px; height: 16px; background: var(--red);
  border-radius: 50%; font-size: 9px; font-weight: 700;
  color: #fff; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg2);
}

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px;
  background: var(--bg3); border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); text-decoration: none;
}
.user-avatar {
  width: 26px; height: 26px; background: var(--accent);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 700; color: #fff;
}
.user-name { font-size: 12px; color: var(--text); font-weight: 500; }

.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text2); padding: 4px; border-radius: var(--r-sm);
}
.hamburger:hover { background: var(--bg3); }

/* Sidebar */
.app-sidebar {
  position: fixed; top: 56px; left: 0; bottom: 0; z-index: 100;
  width: 210px; background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 16px 0; overflow-y: auto;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.sb-section {
  font-size: 10px; font-weight: 600; letter-spacing: .6px;
  color: var(--text3); text-transform: uppercase;
  padding: 10px 20px 5px;
}

.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 20px; font-size: 13px; color: var(--text2);
  text-decoration: none; border-left: 2px solid transparent;
  transition: all .12s; position: relative;
}
.sb-item:hover { background: var(--bg3); color: var(--text); }
.sb-item.active {
  background: var(--gold-light); color: var(--gold);
  border-left-color: var(--gold); font-weight: 500;
}
.sb-item svg { flex-shrink: 0; opacity: .75; }
.sb-item.active svg { opacity: 1; }
.sb-div { border-top: 1px solid var(--border); margin: 8px 0; }

/* Main */
.app-main {
  margin-left: 210px; margin-top: 56px;
  padding: 24px; flex: 1; min-width: 0;
}

/* ══════════════════════════════════════
   SHARED COMPONENTS
══════════════════════════════════════ */

/* Kart */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.card-body { padding: 18px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text); }

/* Sayfa başlığı */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.page-title { font-size: 18px; font-weight: 700; color: var(--text); }
.page-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* Input */
.inp {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r-sm); padding: 8px 12px;
  color: var(--text); font-size: 13px; width: 100%;
  font-family: var(--font); transition: border-color .15s, box-shadow .15s;
}
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,29,46,.08); }
.inp::placeholder { color: var(--text3); }
.inp:disabled { background: var(--bg3); color: var(--text3); cursor: not-allowed; }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239399b2' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
textarea.inp { resize: vertical; }

.inp-group { margin-bottom: 12px; }
.inp-label {
  font-size: 11px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 5px;
}
.inp-label .opt { color: var(--text3); font-weight: 400; text-transform: none; letter-spacing: 0; }
.inp-hint { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* Butonlar */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; font-family: var(--font);
  cursor: pointer; border: none; text-decoration: none;
  transition: all .15s; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-danger { background: var(--red-light); color: var(--red); border: 1px solid #f5c6c3; }
.btn-danger:hover { background: #fad5d2; }
.btn-green { background: var(--green-light); color: var(--green); border: 1px solid #b8dfc8; }
.btn-blue { background: var(--blue-light); color: var(--blue); border: 1px solid #bdd0f5; }
.btn-wa { background: var(--wa-light); color: var(--wa); border: 1px solid #b8dfc8; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; padding: 3px 8px;
  border-radius: 20px; white-space: nowrap;
}
.badge-draft   { background: var(--bg3);          color: var(--text3); }
.badge-waiting { background: var(--orange-light);  color: var(--orange); }
.badge-sent    { background: var(--blue-light);    color: var(--blue); }
.badge-approved{ background: var(--green-light);   color: var(--green); }
.badge-rejected{ background: var(--red-light);     color: var(--red); }
.badge-revise  { background: var(--purple-light);  color: var(--purple); }
.badge-corporate{ background: var(--blue-light);   color: var(--blue); }
.badge-personal { background: var(--orange-light); color: var(--orange); }

/* Tablo */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th {
  padding: 9px 12px; text-align: left; font-size: 10px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text3); background: var(--bg);
  border-bottom: 1px solid var(--border);
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text2); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover td { background: var(--bg); }
table.tbl .td-primary { font-size: 13px; font-weight: 500; color: var(--text); }
table.tbl .td-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* Alert */
.alert { padding: 12px 14px; border-radius: var(--r-sm); font-size: 12px; margin-bottom: 14px; }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #b8dfc8; }
.alert-danger  { background: var(--red-light);   color: var(--red);   border: 1px solid #f5c6c3; }
.alert-info    { background: var(--blue-light);  color: var(--blue);  border: 1px solid #bdd0f5; }
.alert-warn    { background: var(--gold-light);  color: var(--gold);  border: 1px solid #e8d0a0; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* İstatistik kart */
.stat-card { padding: 18px 20px; }
.stat-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); margin-bottom: 6px; }
.stat-val { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-trend { font-size: 11px; color: var(--text3); }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.col-span-2 { grid-column: 1 / -1; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: #fff;
  border-radius: var(--r); padding: 12px 18px;
  font-size: 13px; font-weight: 500; z-index: 9999;
  box-shadow: var(--shadow-lg); display: none;
  max-width: 320px; line-height: 1.4;
  transform: translateY(10px); opacity: 0;
  transition: all .25s;
}
.toast.show { display: block; transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.info    { background: var(--blue); }

/* Modal */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 500;
  align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--bg2); border-radius: var(--r-lg);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 14px; font-weight: 600; color: var(--text); }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 20px; line-height: 1;
  padding: 2px 6px; border-radius: 4px;
}
.modal-close:hover { background: var(--bg3); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Responsive */
@media (max-width: 768px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .app-main { margin-left: 0; padding: 16px; }
  .hamburger { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: 1; }
}
@media (max-width: 480px) {
  .app-main { padding: 12px; }
  .page-title { font-size: 16px; }
}
