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

:root {
  --color-primary:     #0F3D3E;
  --color-primary-light: #1a5556;
  --color-secondary:   #1FA463;
  --color-secondary-light: #25c074;
  --color-accent:      #F28C28;
  --color-accent-light: #f9a54e;
  --color-bg:          #F6F8FA;
  --color-bg-card:     #ffffff;
  --color-text:        #17212B;
  --color-text-muted:  #6c7a89;
  --color-border:      #e2e8f0;
  --color-danger:      #e53e3e;
  --color-success:     #1FA463;
  --color-warning:     #F28C28;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 16px rgba(15,61,62,0.10);
  --shadow-lg:  0 8px 32px rgba(15,61,62,0.14);

  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-height: 60px;
}

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

body {
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--color-secondary); text-decoration: none; }
a:hover { color: var(--color-secondary-light); text-decoration: underline; }

.navbar-trendinyeri {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0d3032 100%);
  box-shadow: var(--shadow-md);
  min-height: var(--nav-height);
  padding: 0 1rem;
}

.navbar-brand-custom {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-brand-custom .brand-dot {
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  display: inline-block;
}

.navbar-nav .nav-link {
  color: rgba(255,255,255,0.82) !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #ffffff !important;
  background: rgba(255,255,255,0.10);
}

.navbar-toggler {
  border: none;
  padding: 0.25rem;
  outline: none;
  box-shadow: none;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

.navbar-toggler-icon {
  filter: invert(1);
}

@media (max-width: 767.98px) {
  .navbar-trendinyeri .navbar-collapse {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0d3032 100%);
    padding: 0.5rem 0 0.75rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .navbar-trendinyeri .navbar-nav {
    gap: 2px;
  }

  .navbar-trendinyeri .navbar-nav .nav-link {
    padding: 0.6rem 0.75rem;
  }
}

.mobile-nav-section {
  padding-bottom: 0.5rem;
}

.mobile-nav-divider {
  border-color: rgba(255, 255, 255, 0.12);
  margin: 0.5rem 0 0.75rem;
}

.mobile-nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 0.25rem 0.25rem 0.35rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  margin-bottom: 2px;
}

.mobile-nav-link:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  text-decoration: none;
}

.mobile-nav-link.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 600;
}

.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: 220px;
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-border);
  padding: 1.25rem 0.75rem;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border: none;
  background: none;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.sidebar-link.active {
  background: rgba(15,61,62,0.08);
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar-link svg { flex-shrink: 0; }

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0.75rem 0.875rem 0.25rem;
}

.main-content {
  margin-left: 220px;
  padding: 1.5rem;
  min-height: calc(100vh - var(--nav-height));
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 1rem 0.75rem; }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.card-custom {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  transition: box-shadow 0.15s ease;
}

.card-custom:hover { box-shadow: var(--shadow-md); }

.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-primary   { background: rgba(15,61,62,0.10);  color: var(--color-primary); }
.stat-icon-secondary { background: rgba(31,164,99,0.12); color: var(--color-secondary); }
.stat-icon-accent    { background: rgba(242,140,40,0.12); color: var(--color-accent); }
.stat-icon-danger    { background: rgba(229,62,62,0.10);  color: var(--color-danger); }

.stat-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.btn-primary-custom {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary-custom:hover {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15,61,62,0.25);
  transform: translateY(-1px);
}

.btn-accent-custom {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-accent-custom:hover {
  color: #fff;
  box-shadow: 0 4px 12px rgba(242,140,40,0.30);
  transform: translateY(-1px);
}

.btn-outline-primary-custom {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.875rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.btn-outline-primary-custom:hover {
  background: var(--color-primary);
  color: #fff;
}

.expense-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.625rem;
  transition: all 0.15s ease;
  border-left: 4px solid transparent;
}

.expense-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--color-secondary);
}

.expense-card-receipt   { border-left-color: var(--color-secondary); }
.expense-card-einvoice  { border-left-color: var(--color-primary); }
.expense-card-invoice   { border-left-color: var(--color-accent); }
.expense-card-undocumented { border-left-color: var(--color-text-muted); }

.expense-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
}

.expense-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.expense-amount {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
}

.expense-actions {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
  font-size: 0;
}

.action-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.action-btn.danger:hover { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.action-btn.accent:hover { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

.badge-doc-receipt      { background: rgba(31,164,99,0.12);  color: #1a7a4a; font-size: 0.72rem; }
.badge-doc-einvoice     { background: rgba(15,61,62,0.10);   color: var(--color-primary); font-size: 0.72rem; }
.badge-doc-invoice      { background: rgba(242,140,40,0.12); color: #b36620; font-size: 0.72rem; }
.badge-doc-undocumented { background: rgba(108,122,137,0.12); color: #4a5568; font-size: 0.72rem; }

.badge-photo-yes   { background: rgba(31,164,99,0.10); color: #1a7a4a; }
.badge-photo-no    { background: rgba(229,62,62,0.10);  color: var(--color-danger); }
.badge-accounting  { background: rgba(15,61,62,0.10);  color: var(--color-primary); }

.form-label-custom {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.form-control-custom {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg-card);
  width: 100%;
  transition: border-color 0.15s ease;
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(31,164,99,0.12);
}

.item-row {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.photo-upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--color-bg);
}

.photo-upload-area:hover {
  border-color: var(--color-secondary);
  background: rgba(31,164,99,0.04);
}

.photo-upload-area.dragging {
  border-color: var(--color-secondary);
  background: rgba(31,164,99,0.08);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(229,62,62,0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, #0a2829 100%);
  padding: 1rem;
}

.login-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo h1 {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0;
}

.login-logo .sub {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.alert-custom {
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: none;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-success { background: rgba(31,164,99,0.12); color: #1a7a4a; }
.alert-danger   { background: rgba(229,62,62,0.10); color: #c53030; }
.alert-warning  { background: rgba(242,140,40,0.12); color: #9c5000; }
.alert-info     { background: rgba(15,61,62,0.08);  color: var(--color-primary); }

.table-custom {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.table-custom th {
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.625rem 0.875rem;
  border-bottom: 2px solid var(--color-border);
}

.table-custom td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table-custom tr:hover td { background: rgba(15,61,62,0.02); }

.filter-bar {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.share-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0d3032 100%);
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.mobile-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(242,140,40,0.4);
  text-decoration: none;
  font-size: 1.5rem;
  z-index: 999;
  transition: all 0.15s ease;
}

.mobile-fab:hover {
  color: white;
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(242,140,40,0.5);
}

.pagination-custom {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  flex-wrap: wrap;
}

.pagination-custom .page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.12s ease;
}

.pagination-custom .page-item.active .page-link {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.pagination-custom .page-item .page-link:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

@media (max-width: 576px) {
  .page-title { font-size: 1.125rem; }
  .stat-card  { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .stat-value { font-size: 1.1rem; }
  .expense-card { padding: 0.875rem 1rem; }
  .expense-actions .action-btn { width: 36px; height: 36px; }
}

.photo-action-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 576px) {
  .photo-action-buttons {
    grid-template-columns: 1fr 1fr;
  }
  .photo-action-drop {
    grid-column: 1 / -1;
  }
}

.photo-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 1.25rem 0.75rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
  text-decoration: none;
  color: var(--color-text);
}

.photo-action-btn i {
  font-size: 1.75rem;
  display: block;
  line-height: 1;
}

.photo-action-btn span:not(.photo-action-sub) {
  font-weight: 600;
  font-size: 0.875rem;
}

.photo-action-sub {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.photo-action-camera {
  border-color: rgba(31,164,99,0.3);
  background: rgba(31,164,99,0.04);
  color: var(--color-secondary);
}
.photo-action-camera:hover {
  border-color: var(--color-secondary);
  background: rgba(31,164,99,0.10);
  box-shadow: 0 4px 16px rgba(31,164,99,0.15);
  transform: translateY(-2px);
  color: var(--color-secondary);
}

.photo-action-gallery {
  border-color: rgba(15,61,62,0.2);
  background: rgba(15,61,62,0.03);
  color: var(--color-primary);
}
.photo-action-gallery:hover {
  border-color: var(--color-primary);
  background: rgba(15,61,62,0.08);
  box-shadow: 0 4px 16px rgba(15,61,62,0.12);
  transform: translateY(-2px);
  color: var(--color-primary);
}

.photo-action-drop {
  border-style: dashed;
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
.photo-action-drop:hover,
.photo-action-drop.photo-action-btn--dropping {
  border-color: var(--color-accent);
  background: rgba(242,140,40,0.06);
  color: var(--color-accent);
  transform: translateY(-2px);
}

.photo-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.50);
  color: white;
  font-size: 0.62rem;
  padding: 2px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-primary-custom { color: var(--color-primary) !important; }
.text-secondary-custom { color: var(--color-secondary) !important; }
.text-accent { color: var(--color-accent) !important; }
.bg-primary-custom { background-color: var(--color-primary) !important; }
.border-primary-custom { border-color: var(--color-primary) !important; }
.rounded-custom { border-radius: var(--radius-md) !important; }
