/* Magshop ERP v5.0  */

/* CSS VARIABLES */
:root {
  --primary: #2c3e50;
  --success: #27ae60;
  --danger: #e74c3c;
  --accent: #3498db;
  --warning: #f39c12;
  --gold: #C49543;
  --bg-body: #eef2f3;
  --bg-card: #ffffff;
  --text-main: #333;
  --border-color: #eee;
}

/* DARK MODE VARIABLES */
body.dark-mode {
  --bg-body: #000000;
  --bg-card: #0a0a0a;
  --text-main: #e0e0e0;
  --accent: #C49543;
  --border-color: #C49543;
  --input-bg: #1a1a1a;
  --search-bg: #0a0a0a;
  --primary: #121212;
}



body.dark-mode .search-bar {
  background: var(--search-bg);
  border: 1px solid var(--gold);
}

body.dark-mode .search-bar input {
  background: var(--input-bg);
  color:var(--text-main);
}

body.dark-mode .form-row input, 
body.dark-mode .form-row select, 
body.dark-mode .entry-form input,
body.dark-mode .entry-form select {
  background:var(--input-bg);
  color: var(--text-main);
  border-color: #333;
}

body.dark-mode .entry-form {
    background: var(--bg-card);
    border: 1px solid rgba(196, 149, 67, 0.3);
}

body.dark-mode input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(196, 149, 67, 0.2);
}

/* Dark Mode Table Styling (Prototype Match) */
body.dark-mode .table-container {
    background: var(--bg-card);
    border: 1px solid var(--gold);
}

body.dark-mode th {
    background: #0a0a0a;
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
}

body.dark-mode td {
    border-bottom: 1px solid #1a1a1a;
}

body.dark-mode tr:hover {
    background: rgba(196, 149, 67, 0.05);
}

body.dark-mode .nav-btn.active {
    background: var(--gold);
    color: black;
}

body.dark-mode .edit-panel {
    background: var(--bg-card);
    border-top: 4px solid var(--gold);
    box-shadow: 0 -5px 25px rgba(196, 149, 67, 0.15);
}

body.dark-mode .btn--outline {
    border: 1px solid var(--gold);
    color: var(--gold);
    background: transparent;
}



/* BODY */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-body);
  color: var(--text-main);
  min-width: 1280px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/*SIDEBAR DASHBOARD */
.sidebar {
  position: fixed;
  top: 0;
  left:0;
  width: 250px;
  height: 100vh;
  background:var(--primary);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 4px 0 15px rgba(0,0,0,0.1);
  z-index: 1000;
}

.sidebar-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: relative;
}

.theme-toggle-mini {
  position: absolute;
  top: -15px;
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  padding: 8px;
  transition: transform 0.3s ease;
}

.theme-toggle-mini:hover {
  transform: scale(1.2) rotate(15deg);
  background: rgba(255,255,255,0.1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top:20px;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 15px 0;
}

.sidebar-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-left: 20px;
}

.backup-controls {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-footer:hover .backup-controls {
  max-height: 400px;
  opacity: 1;
  margin-bottom: 20px;
}

.sidebar-logo {
  width: 200px;
  height: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-btn {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-size: 16px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  transform: translateX(5px);
}

.nav-btn.active {
  background-color: var(--accent);
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transform: translateX(5px);
}



/* MAIN CONTENT */
.main-wrapper {
  margin-left: 250px;
  padding: 30px 50px;
  min-height: 100vh;
  background: var(--bg-body);
}

/* SEARCH BAR */
.search-bar {
  display: flex;
  gap: 16px;
  padding: 16px 32px;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 0 0 24px 0;
}

.search-bar input {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
}

.search-bar__btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* STATS */
.stats-grid {
  display: flex;
  justify-content: space-around;
  gap: 24px;
  margin: 32px 0;
}

.stats-card {
  flex: 1;
  padding: 32px;
  border-radius: 12px;
  color: white;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  min-width: 200px;
}

.stats-grid--income { background: linear-gradient(135deg, var(--success), #2ecc71); }
.stats-grid--expense { background: linear-gradient(135deg, var(--danger), #c0392b); }
.stats-grid--balance { background: linear-gradient(135deg, #3498db, #5dade2); }

.stats-value { font-size: 32px; font-weight: 700; }

.stats-card--active {
  transform:  translateY(-4px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.25);
  outline: 3px solid var(--accent);
}

/* ΤΑΜΕΙΟ FORM */
.entry-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  margin: 24px 0px;
}

.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.form-row input,
.form-row select {
  flex: 1;
  padding: 10px 8px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  min-width: 0;
  transition: border-color 0.2s ease;
}

.form-row input:focus,
.form-row select:focus {
  border-color: var(--accent);
  outline: none;
}

.form-row #product {
  flex: 2; /* Περιγραφή μεγαλύτερη */
}

.form-row #notes {
  flex: 2; /*Σημειώσεις μεγαλύτερες */
}


.btn--success {
  background: var(--success);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn--danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* HOVER ANIMATIONS FOR MAIN BUTTONS */
.btn--success:hover, .btn--danger:hover, .search-bar__btn:hover, .btn--outline:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.btn--success:active, .btn--danger:active, .search-bar__btn:active, .btn--outline:active {
    transform: translateY(-1px);
}

/* ΠΑΡΑΓΓΕΛΙΕΣ FORM */
#section-paraggelies .entry-form {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 16px 20px;
}

#section-paraggelies .entry-form input,
#section-paraggelies .entry-form select {
  padding: 10px 8px;
  font-size: 13px;
  min-width: 0;
  flex: 1;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.2s ease;
}

#section-paraggelies .entry-form input:focus,
#section-paraggelies .entry-form select:focus {
  border-color: var(--accent);
  outline: none;
}




#section-paraggelies #orderDesc {
  flex:2; /* Περιγραφή μεγαλύτερη */
}



/* TABS ΕΣΟΔΑ/ΕΞΟΔΑ */
.tabs-container {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: left;
}

.tab-btn.active {
  color:white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#tab-income.active, #tab-income:hover {
  background: linear-gradient(135deg, var(--success), #2ecc71);
  border-color: var(--success);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52,152,219,0.3);
}

#tab-expense.active, #tab-expense:hover {
  background: linear-gradient(135deg, var(--danger), #e74c3c);
  border-color: var(--danger);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52,152,219,0.3);
}

.tab-btn {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: 8px;;
  border: 2px solid var(--border-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* TABLE */
.table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  overflow-x: auto;
  margin: 32px 0;
}

table { 
  width: 100%; 
  border-collapse: collapse; }

th {
  background: #f8f9fa;
  padding: 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

td { 
  padding: 16px; 
  border-bottom: 1px solid var(--border-color); 
}

td small {
  color: var(--success);
  font-size: 0.85rem;
}

td .downpayment-info {color: var(--warning);}
td .remaining-info { color: var(--danger);}

tr:hover { background: rgba(52,152,219,0.04); }

/* Status & actions */
.action-btn {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.15s ease, opacity 0.15s ease;  /* πιο subtle */
}

.action-btn:hover {
  opacity: 0.85;        /* αντί για scale */
  background: var(--danger);
  color: white;
}

.action-btn.status-btn:hover {
  background: var(--success);  
}

.action-btn.delete-btn:hover {
  background: var(--danger);   
}

.action-btn.edit-btn:hover {
  background: #3498db;
}
/* SECTIONS */
.app-section { display: none; }
.app-section.active { display: block; }

/* EDIT PANEL STYLES */

.edit-overlay {
  position:fixed;
  top:0;
  left:0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: none;
  backdrop-filter: blur(2px);
}

.edit-overlay.active{
  display: block;
}

.edit-panel {
  position: fixed;
  bottom: -100%;
  left: 250px;
  width: calc(100% - 250px);
  background: white;
  padding: 30px 50px;
  box-sizing: border-box;
  box-shadow: 0 -5px 25px rgba(0,0,0,0.2);
  border-top: 4px solid var(--warning);
  transition: bottom 0.4s cubic-bezier(0.16, 1 , 0.3, 1);
  z-index: 2001;
}

.edit-panel.active {
  bottom:0;
}
.edit-panel h3 {
  color: var(--warning);
  margin-bottom: 20px;
}