:root {
    --primary: #1e40af;
    --secondary: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --border: #e5e7eb;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    
    
}
html{
    height: 100%;
    
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    height: 100%;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    text-align: center;
}

.header h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 8px;
}

.header p {
    color: var(--gray);
    font-size: 1rem;
}

/* Dashboard Cards */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: var(--white);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 10px;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
}

.card-value.positive { color: var(--success); }
.card-value.negative { color: var(--danger); }

/* Section Headings */
h2 {
    margin: 20px 0 10px;
    font-size: 1.4rem;
    color: var(--primary);
}

/* Table Wrapper (Responsive) */
.table-responsive {
    width: 100%;
    overflow-x: auto;                /* Yatay scroll */
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* Table */
table {
    width: 100%;
    min-width: 600px;                /* Çok daralmasını engelle */
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9rem;
    white-space: nowrap;            /* Taşma olursa scroll çıksın */
}

th {
    background: var(--light);
    color: var(--dark);
    font-weight: 600;
}

tr:nth-child(even) {
    background: #fdfdfd;
}

td button {
    background: var(--danger);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
td button:hover { opacity: 0.85; }

/* Buttons */
button {
    padding: 8px 14px;
    margin: 8px 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s;
}
button:hover { opacity: 0.9; }

button[onclick*="openCapitalModal"] { background: var(--primary); color: white; }
button[onclick*="openIncomeModal"]  { background: var(--success); color: white; }
button[onclick*="openExpenseModal"] { background: var(--danger); color: white; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

/* Modal form */
.modal form {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow);
}

.modal h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--primary);
}

.modal form label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.modal form input,
.modal form select,
.modal form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 4px;
    box-sizing: border-box;
}

/* Açıklama textarea */
#product-description {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    margin-top: 6px;
    background: var(--white);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

/* Tabs */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;            /* mobilde yatay kaydırma */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;       /* firefox için */
  }
  
  .nav-tabs::-webkit-scrollbar {
    height: 6px;                 /* scroll yüksekliği */
  }
  .nav-tabs::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
  }
  
  .nav-tab {
    flex: 0 0 auto;              /* sabit genişlik, sıkışmaz */
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    background: var(--light);
    font-weight: 500;
    white-space: nowrap;         /* taşma olursa alt satıra geçmesin */
  }
  
  .nav-tab.active {
    background: var(--primary);
    color: white;
  }
  
  /* Küçük ekranlarda daha küçük padding */
  @media (max-width: 600px) {
    .nav-tab {
      padding: 8px 12px;
      font-size: 0.85rem;
    }
  }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}
.badge-success { background: var(--success); }
.badge-danger { background: var(--danger); }

/* Amount Colors */
.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--danger); font-weight: 600; }

/* Delete Button */
.btn-delete {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}
.btn-delete:hover { opacity: 0.8; }

/* Responsive Yazılar */
@media (max-width: 768px) {
    th, td {
      padding: 8px 10px;
      font-size: 0.8rem;
    }
    h2 { font-size: 1.2rem; }
    button {
      width: 100%;
      margin: 6px 0;
      font-size: 0.85rem;
    }
    .modal form { max-width: 90%; padding: 15px; }
    .modal h3 { font-size: 1rem; }
}

/* Çok küçük ekranlar */
@media (max-width: 480px) {
    th, td {
      font-size: 0.75rem;
      padding: 6px 8px;
    }
    h2 { font-size: 1rem; }
    .card-title { font-size: 0.85rem; }
    .card-value { font-size: 1.3rem; }
}

/* Kritik stok için yanıp sönme animasyonu */
@keyframes blink {
    0%   { background-color: #ff4d4d; color: #fff; }
    50%  { background-color: #fff; color: #ff4d4d; }
    100% { background-color: #ff4d4d; color: #fff; }
  }
  
  .low-stock {
    animation: blink 1s infinite;
    font-weight: bold;
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-block;
  }

  /* Tarih seçici ve buton */
.report-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
  }
  
  .report-filters label {
    font-weight: 500;
    color: var(--primary);
    font-size: 0.9rem;
  }
  
  .report-filters input[type="date"] {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--white);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  }
  
  .report-filters button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
  }
  
  .report-filters button:hover {
    background: var(--secondary);
  }
  
  /* Grafik alanı */
  .chart-container {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
  }
  
  .chart-container canvas {
    width: 100% !important;
    height: 400px !important;
  }
  /* Rapor grid */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 30px;
  }
  
  .report-box {
    background: var(--white);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
  }
  
  /* Karlı ürünler tablosu */
  #profit-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
    font-size: 0.85rem;
  }
  
  #profit-table th,
  #profit-table td {
    padding: 8px 10px;
    border: 1px solid var(--border);
    text-align: left;
  }
  
  #profit-table th {
    background: var(--light);
    font-weight: 600;
  }
