/* =========================================
   RESET
========================================= */

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

html{
  scroll-behavior:smooth;
}

body{
  font-family:Inter,sans-serif;
  background:#050505;
  color:#fff;
  overflow-x:hidden;
}

/* =========================================
   APP
========================================= */

.app{
  display:flex;
  min-height:100vh;
}

/* =========================================
   CONTROL PANEL
========================================= */

.control-panel{
  width:410px;
  min-width:410px;

  height:100vh;
  overflow-y:auto;

  padding:24px;

  background:
  linear-gradient(
    180deg,
    #101010 0%,
    #050505 100%
  );

  border-right:
  1px solid rgba(255,255,255,0.05);
}

.control-panel::-webkit-scrollbar{
  width:4px;
}

.control-panel::-webkit-scrollbar-thumb{
  background:#262626;
  border-radius:999px;
}

/* =========================================
   PANEL HEADER
========================================= */

.panel-header{
  margin-bottom:20px;
}

.panel-header h1{
  font-size:26px;
  font-weight:700;

  letter-spacing:-1px;

  margin-bottom:4px;
}

.panel-header p{
  font-size:11px;
  line-height:1.5;
  color:#868686;
}

/* =========================================
   PANEL SECTION
========================================= */

.panel-section{
  background:
  linear-gradient(
    180deg,
    rgba(255,255,255,0.03),
    rgba(255,255,255,0.01)
  );

  border:
  1px solid rgba(255,255,255,0.05);

  border-radius:24px;

  padding:18px;

  margin-bottom:16px;

  backdrop-filter:blur(10px);
}

.panel-section h2{
  font-size:14px;
  font-weight:600;

  margin-bottom:14px;
}

.section-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;

  gap:10px;

  margin-bottom:12px;
}

/* =========================================
   FORM
========================================= */

label{
  display:flex;
  flex-direction:column;

  gap:6px;

  margin-bottom:12px;

  font-size:11px;
  color:#bdbdbd;
}

input,
textarea,
select{
  width:100%;

  background:#050505;

  border:
  1px solid rgba(255,255,255,0.06);

  border-radius:14px;

  padding:12px 14px;

  color:#fff;

  outline:none;
  resize:none;

  font-size:12px;

  transition:0.25s ease;
}



input:focus,
textarea:focus,
select:focus{
  border-color:#555;
  background:#0a0a0a;
}

textarea{
  line-height:1.4;
}

input[type="file"]{
  padding:8px;
  cursor:pointer;
}

.checkbox-label{
  flex-direction:row;
  align-items:center;
  gap:8px;
}

.checkbox-label input{
  width:auto;
}

.mini-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

/* =========================================
   BUTTONS
========================================= */

button{
  border:none;
  outline:none;
  cursor:pointer;

  font-family:inherit;

  transition:0.25s ease;
}

.primary-btn{
  background:#fff;
  color:#000;

  padding:12px 14px;

  border-radius:14px;

  font-size:12px;
  font-weight:600;
}

.primary-btn:hover{
  transform:translateY(-2px);
}

.secondary-btn{
  background:#151515;
  color:#fff;

  padding:12px 14px;

  border-radius:14px;

  border:
  1px solid rgba(255,255,255,0.05);

  font-size:12px;
}

.secondary-btn:hover{
  background:#1e1e1e;
}

.small-btn{
  padding:9px 12px;
  font-size:11px;
}

#addProductBtn,
#addExpenseBtn{
  background:#fff;
  color:#000;

  padding:9px 12px;

  border-radius:10px;

  font-size:11px;
  font-weight:600;
}

.remove-product-btn,
.remove-expense-btn{
  background:#1b1b1b;
  color:#fff;

  padding:7px 10px;

  border-radius:9px;

  font-size:10px;
}

/* =========================================
   FORM CARD
========================================= */

.form-card{
  background:#080808;

  border:
  1px solid rgba(255,255,255,0.05);

  border-radius:20px;

  padding:14px;

  margin-bottom:12px;
}

.form-card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;

  margin-bottom:12px;
}

/* =========================================
   PANEL ACTIONS
========================================= */

.panel-actions{
  display:flex;
  gap:8px;

  margin-top:16px;
}

/* =========================================
   PREVIEW AREA
========================================= */

.preview-area{
  flex:1;

  overflow:auto;

  padding:24px;
}

.preview-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;

  margin-bottom:14px;
}

.preview-topbar strong{
  display:block;

  font-size:16px;

  margin-bottom:2px;
}

.preview-topbar span{
  font-size:11px;
  color:#888;
}

/* =========================================
   A4
========================================= */

.invoice-preview{
  display:flex;
  flex-direction:column;
  gap:24px;
}

.invoice-page{
    width:210mm;
    min-height:auto;

    margin:auto;

    background:#fff;
    color:#111;

    padding:11mm 12mm;

    position:relative;

    border-radius:4px;

    box-shadow:
    0 20px 100px rgba(0,0,0,0.45);
}

/* =========================================
   HEADER FINAL PREMIUM
========================================= */

.invoice-header{
  display:grid;

  grid-template-columns:
  1.5fr
  .7fr;

  align-items:center;

  gap:28px;

  margin-bottom:12px;
}

.brand-area{
  display:flex;
  align-items:center;

  gap:16px;

  min-width:0;
}

.logo-placeholder{
  width:120px;
  min-width:120px;

  height:74px;

  border:
  1px dashed #d8d8d8;

  border-radius:16px;

  overflow:hidden;

  display:flex;
  align-items:center;
  justify-content:center;

  padding:8px;

  background:#fff;

  flex-shrink:0;
}

.logo-placeholder img{
  max-width:100%;
  max-height:100%;

  width:auto;
  height:auto;

  object-fit:contain;
  display:block;
  margin:auto;
}

.brand-area > div{
  flex:1;

  display:flex;
  flex-direction:column;
  justify-content:center;

  min-width:0;
}

.brand-area p{
  display:inline-block;

  background:#f5f5f5;

  border:1px solid #ececec;

  padding:4px 10px;

  border-radius:999px;

  margin-top:8px;
}

.info-box h3{
  position:relative;
  padding-left:14px;
}

.info-box h3::before{
  content:"";
  position:absolute;

  left:0;
  top:0;

  width:4px;
  height:100%;

  background:#111;
  border-radius:99px;
}



.brand-area h2{
  font-size:28px;

  line-height:.86;

  letter-spacing:-1.7px;

  font-weight:800;

  margin:0;
}

.brand-area p{
  font-size:10px;

  color:#777;

  margin-top:6px;

  line-height:1.3;
}



.invoice-meta{
  display:flex;
  flex-direction:column;

  gap:10px;

  align-items:flex-start;
  justify-content:center;

  min-width:170px;
}

.invoice-meta div{
  display:flex;
  flex-direction:column;

  gap:2px;
}

.invoice-meta span{
  font-size:9px;

  color:#777;

  line-height:1;
}

.invoice-meta strong{
  font-size:13px;

  line-height:1.15;

  font-weight:700;
}

/* =========================================
   PARTY GRID
========================================= */

.party-grid{
  display:grid;
  grid-template-columns:1fr 1fr;

  gap:8px;

  margin-bottom:10px;
}

.party-card{
  border:
  1px solid #efefef;

  border-radius:18px;

  padding:12px 14px;

  background:#fcfcfc;
}

.party-card h3{
  font-size:12px;

  margin-bottom:4px;

  line-height:1;
}

.party-card p{
  font-size:10px;

  line-height:1.45;

  color:#444;

  white-space:pre-line;

  overflow-wrap:break-word;
  word-break:break-word;
}

/* =========================================
   TABLE
========================================= */

.product-table-wrap{
  margin-bottom:10px;
}

.product-table-head{
  display:grid;
  grid-template-columns:3fr 1fr 1fr .7fr .9fr .9fr;

  gap:8px;

  background:#050505;
  color:#fff;

  border-radius:14px;

  padding:11px 14px;

  font-size:10px;
  font-weight:600;
}

.product-table-body{
  display:flex;
  flex-direction:column;

  gap:6px;

  margin-top:6px;
}

.product-row{
  display:grid;
  grid-template-columns:3fr 1fr 1fr .7fr .9fr .9fr;

  gap:8px;

  border:
  1px solid #efefef;

  border-radius:18px;

  padding:10px;

  background:#fff;

  align-items:flex-start;
}

.product-info{
  display:flex;

  gap:10px;

  min-width:0;
}

.product-image{
  width:100px;
  height:100px;

  border-radius:8px;

  overflow:hidden;

  background:#f3f3f3;

  flex-shrink:0;
}

.product-image img{
  width:100%;
  height:100%;

  object-fit:cover;
}

.product-text{
  min-width:0;
}

.product-text h4{
  font-size:12px;

  margin-bottom:2px;

  line-height:1.1;
}

.product-text p{
  font-size:9px;

  line-height:1.28;

  color:#666;

  overflow-wrap:break-word;
  word-break:break-word;

  white-space:pre-line;
}

.product-cell{
  font-size:11px;
  font-weight:600;

  padding-top:2px;
}

/* =========================================
   NOTE TOTAL
========================================= */

.note-total-grid{
  display:grid;
  grid-template-columns:1.4fr .6fr;

  gap:8px;

  margin-bottom:10px;
}

.note-box,
.total-box{
  border:
  1px solid #efefef;

  border-radius:18px;

  padding:14px;

  background:#fcfcfc;
}

.note-box h3,
.info-box h3{
  font-size:12px;

  margin-bottom:6px;

  line-height:1;
}

.note-box p,
.info-box p{
  font-size:10px;

  line-height:1.45;

  color:#555;

  white-space:pre-line;

  overflow-wrap:break-word;
  word-break:break-word;
}

.total-box{
  display:flex;
  flex-direction:column;

  gap:8px;
}

.total-row{
  display:flex;
  align-items:center;
  justify-content:space-between;

  gap:8px;

  font-size:11px;
}

.grand-total{
  border-top:
  1px solid #ececec;

  padding-top:8px;
  margin-top:2px;

  font-size:14px;
}

/* =========================================
   BANK AREA
========================================= */

.info-bank-grid{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.info-box{
  border:
  1px solid #efefef;

  border-radius:18px;

  padding:14px;

  background:#fcfcfc;
}

/* =========================================
   BANK PREVIEW FINAL GRID
========================================= */

.bank-preview-box{
  display:flex;
  flex-direction:column;
}

.bank-grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);

  gap:10px;

  margin-top:6px;
}


.bank-card{
  border:
  1px solid #ececec;

  border-radius:14px;

  padding:10px 12px;

  background:#fff;

  min-height:45px;

  display:flex;
  flex-direction:column;
  justify-content:center;
}

.bank-grid .bank-card:nth-child(1),
.bank-grid .bank-card:nth-child(2),
.bank-grid .bank-card:nth-child(3),
.bank-grid .bank-card:nth-child(4){
  grid-column:span 3;
}

.bank-grid .bank-card:nth-child(5),
.bank-grid .bank-card:nth-child(6),
.bank-grid .bank-card:nth-child(7){
  grid-column:span 4;
}

.bank-card-top{
  display:flex;
  align-items:center;

  gap:8px;

  margin-bottom:7px;
}

.bank-preview-icon{
  display:none;
}

.bank-card strong{
  font-size:11px;
  font-weight:700;

  line-height:1;
}

.bank-card p{
  font-size:10px;

  line-height:1.45;

  color:#555;

  overflow-wrap:break-word;
  word-break:break-word;
}

/* =========================================
   FOOTER
========================================= */

.invoice-footer{
  position:absolute;

  bottom:7mm;
  left:12mm;
  right:12mm;

  display:flex;
  align-items:center;
  justify-content:space-between;

  font-size:9px;
  color:#777;
}
.footer-site{
    font-weight:700;
}
/* =========================================
   PDF FIX
========================================= */

.product-row,
.note-total-grid,
.party-grid,
.note-box,
.total-box,
.info-box{
  break-inside:avoid;
  page-break-inside:avoid;
}

/* =========================================
   RESPONSIVE
========================================= */

@media(max-width:1400px){

  .app{
    flex-direction:column;
  }

  .control-panel{
    width:100%;
    min-width:100%;
    height:auto;
  }

  .preview-area{
    padding:14px;
  }

  .invoice-page{
    width:100%;
    min-height:auto;

    padding:24px 16px;
  }

}

@media(max-width:900px){

  .invoice-header{
    grid-template-columns:1fr;
  }

  .brand-area{
    flex-direction:column;
    align-items:flex-start;
  }

  .party-grid,
  .note-total-grid,
  .info-bank-grid,
  .bank-grid{
    grid-template-columns:1fr;
  }

  .bank-card-full{
    grid-column:auto;
  }

  .product-table-head{
    display:none;
  }

  .product-row{
    grid-template-columns:1fr;
  }

  .panel-actions{
    flex-direction:column;
  }

}
.auth-screen{
  position:fixed;
  inset:0;
  background:#f5f5f5;
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:99999;
}

.auth-box{
  width:380px;
  background:#fff;
  padding:30px;
  border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.1);
}

.auth-box h2{
  margin-bottom:10px;
}

.auth-box p{
  margin-bottom:20px;
}

.auth-box input{
  width:100%;
  padding:12px;
  margin-bottom:10px;
}

.auth-box button{
  width:100%;
  padding:12px;
  margin-top:10px;
  cursor:pointer;
}

#authMessage{
  display:block;
  margin-top:15px;
}
.user-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 20px;
  background:#fff;
  border-bottom:1px solid #e5e5e5;
}

.user-bar div{
  display:flex;
  flex-direction:column;
}

#userEmail{
  font-size:14px;
  color:#111;
  font-weight:600;
}

#licenseStatus{
  font-size:12px;
  color:#16a34a;
}

#logoutBtn{
  padding:10px 16px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  background:#111;
  color:#fff;
}
.account-btn{
  position:fixed;
  bottom:20px;
  right:20px;
  z-index:9999;

  border:none;
  border-radius:12px;

  padding:12px 18px;

  background:#111;
  color:#fff;

  cursor:pointer;

  font-size:14px;
  font-weight:600;

  box-shadow:0 10px 25px rgba(0,0,0,.15);
}
.account-panel{
  position:fixed;
  right:20px;
  bottom:80px;

  width:300px;

  background:#ffffff;
  backdrop-filter: blur(10px);

  border-radius:16px;

  padding:20px;

  box-shadow:0 20px 60px rgba(0,0,0,.2);

  z-index:9999;

  display:none;

  transform: translateY(20px);
  transition: all .25s ease;
}

.account-panel h3{
  margin-bottom:15px;
}

#panelEmail{
  color:#111;
  word-break:break-word;
  margin-bottom:15px;
}

.license-badge{
  background:#ecfdf5;
  color:#16a34a;
  padding:10px;
  border-radius:10px;
  margin-bottom:15px;
}
.account-panel,
.account-panel h3,
#panelEmail,
.license-badge{
  color:#111 !important;
}
button{
  appearance:none;
  border:none;
  outline:none;

  padding:12px 16px;
  border-radius:12px;

  font-size:14px;
  font-weight:600;

  cursor:pointer;

  transition: all .2s ease;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  gap:8px;
}
.btn-primary,
#loginBtn,
#registerBtn{
  background: linear-gradient(135deg,#111827,#0b0f1a);
  color:#fff;

  box-shadow:0 10px 25px rgba(0,0,0,.3);
}

.btn-primary:hover,
#loginBtn:hover,
#registerBtn:hover{
  transform: translateY(-2px);
  box-shadow:0 15px 35px rgba(0,0,0,.4);
}
.btn-secondary{
  background:#f3f4f6;
  color:#111;

  border:1px solid #e5e7eb;
}

.btn-secondary:hover{
  background:#e5e7eb;
}
.btn-danger{
  background:transparent;
  color:#fff;
  border:1px solid rgba(255,255,255,0.2);
}

.btn-danger:hover{
  background:#dc2626;
  border-color:#dc2626;
  color:#fff;

  box-shadow:0 0 20px rgba(220,38,38,0.4);
}
button:active{
  transform: scale(0.96);
}
button, input{
  transition:.2s ease;
}
#resetBtn:active{
  transform: scale(0.96);
}
.auth-box{
  color:#111;
}

.auth-box h2,
.auth-box p{
  color:#111;
}
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 14px;

  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;

  animation: spin 0.8s linear infinite;
  transform: translateY(-50%);
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}
.fade-out{
  opacity:0;
  transform: scale(0.98);
  transition: all .4s ease;
  pointer-events:none;
}

.fade-in{
  opacity:1;
  transform: scale(1);
  transition: all .5s ease;
}
.general-info-list{
  display:flex;
  flex-direction:column;
}

.general-info-item{
  padding:8px 0;
  border-bottom:1px dashed #e5e7eb;

  font-size:10px;
  line-height:1.5;
  color:#555;
}

.general-info-item:last-child{
  border-bottom:none;
}

/* Sağ üst proforma bilgi kartı */

.invoice-meta{
  background:#fcfcfc;
  border:1px solid #ececec;
  border-radius:16px;
  padding:12px 14px;
  gap:0;
  min-width:155px;
}

.invoice-meta div{
  padding:8px 0;
  border-bottom:1px dashed #dddddd;
}

.invoice-meta div:first-child{
  padding-top:0;
}

.invoice-meta div:last-child{
  border-bottom:none;
  padding-bottom:0;
}

.invoice-meta span{
  font-size:8px;
  text-transform:uppercase;
  letter-spacing:.4px;
  color:#777;
}

.invoice-meta strong{
  font-size:13px;
  font-weight:800;
  color:#111;
}
.signature-box{
    margin-top:20px;
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:15px;

    font-size:11px;
}

.signature-title,
.signature-name,
.signature-label{
    margin:0;
}

.signature-title{
    color:#666;
    font-weight:600;
}

.signature-name{
    font-weight:700;
}

.signature-line{
    width:120px;
    border-top:1px solid #222;
    margin:0;
}