/* =============================================
   finance.beatix.cz – Beatix Design System
   Montserrat · #30adb1 · #000
   ============================================= */

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

/* ---- RESET & VARIABLES ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:      #30adb1;
  --teal-dark: #228a8d;
  --teal-glow: rgba(48, 173, 177, 0.15);
  --purple:    #bd96be;
  --yellow:    #fec770;
  --orange:    #f5945b;
  --black:     #0a0a0a;
  --dark:      #111416;
  --dark2:     #1a1e21;
  --dark3:     #232829;
  --border:    rgba(255,255,255,0.07);
  --text:      #e8eaec;
  --text-muted:#7a8490;
  --bg:        #f0f2f5;
  --white:     #ffffff;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
}

body {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: #1a1e21;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   LAYOUT
   ============================================= */
body:not(.login-page) {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.sidebar-logo {
  padding: 28px 24px 24px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
  flex-shrink: 0;
}

.sidebar ul {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
}

.sidebar ul li a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  margin-bottom: 2px;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar ul li a:hover {
  background: var(--dark3);
  color: var(--text);
}

.sidebar ul li a.active {
  background: var(--teal-glow);
  color: var(--teal);
  font-weight: 600;
}

.sidebar ul li a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--teal);
  border-radius: 0 3px 3px 0;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

.sidebar-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.sidebar-footer a:hover { color: var(--teal); }

/* =============================================
   CONTENT
   ============================================= */
.content {
  padding: 32px 36px;
  overflow-y: auto;
  min-height: 100vh;
}

.page-title {
  margin-bottom: 28px;
}

.page-title h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
}

/* =============================================
   CARDS
   ============================================= */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--purple));
  opacity: 0;
  transition: opacity 0.15s;
}

.card:hover::after { opacity: 1; }

.card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
}

/* =============================================
   TABLES
   ============================================= */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
}

th {
  padding: 12px 16px;
  text-align: left;
  background: #f8f9fb;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: #2a2e33;
}

tr:last-child td { border-bottom: none; }

tr:hover td {
  background: rgba(48, 173, 177, 0.03);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 4px 14px rgba(48,173,177,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f0f2f5;
  color: #3a4048;
  border: 1px solid rgba(0,0,0,0.08);
}

.btn-secondary:hover {
  background: #e4e7eb;
}

.btn-danger {
  background: #fff0f0;
  color: #d63031;
  border: 1px solid rgba(214,48,49,0.15);
}

.btn-danger:hover {
  background: #ffe0e0;
}

/* =============================================
   FORMS
   ============================================= */
label {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #4a5260;
  letter-spacing: 0.02em;
}

input[type=text],
input[type=password],
input[type=date],
input[type=number],
input[type=email],
select,
textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  margin-top: 5px;
  border: 1.5px solid #e2e6ea;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  background: var(--white);
  color: var(--black);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

/* =============================================
   TOOLBAR
   ============================================= */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* =============================================
   MODALS
   ============================================= */
#modal-overlay,
#detail-overlay,
#bulk-overlay,
#journal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  border: 1px solid rgba(0,0,0,0.06);
}

.modal h3 {
  margin-bottom: 24px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black);
}

.modal table th,
.modal table td {
  padding: 9px 12px;
}

.modal input[type=number],
.modal input[type=text],
.modal input[type=date],
.modal select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #e2e6ea;
  border-radius: 7px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12.5px;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--dark);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(48,173,177,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(189,150,190,0.06) 0%, transparent 50%);
}

.login-box {
  background: var(--dark2);
  padding: 48px 44px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}

.login-box h1 {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  text-align: center;
}

.login-box h1 span {
  color: var(--teal);
}

.login-box p {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 32px;
}

.login-box label {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.login-box input {
  background: var(--dark3);
  border-color: var(--border);
  color: var(--text);
}

.login-box input:focus {
  border-color: var(--teal);
  background: var(--dark3);
}

.login-box .btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* =============================================
   MISC
   ============================================= */
.error {
  color: #d63031;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 10px 14px;
  background: #fff0f0;
  border-radius: 8px;
  border: 1px solid rgba(214,48,49,0.15);
}

.success {
  color: #00b894;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 10px 14px;
  background: #f0fff8;
  border-radius: 8px;
  border: 1px solid rgba(0,184,148,0.2);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d5dc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* =============================================
   IKONY V MENU
   ============================================= */
.sidebar ul li a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: stroke 0.15s;
}

.sidebar ul li a {
  gap: 10px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.07em;
  font-weight: 600;
}

/* =============================================
   NADPISY V KAPITÁLKÁCH
   ============================================= */
.page-title h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  margin-bottom: 4px;
}

/* =============================================
   TLAČÍTKA – redesign
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 20px;
  height: 38px;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
}

.btn:hover::after { background: rgba(255,255,255,0.08); }

.btn-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 1px 3px rgba(48,173,177,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 4px 14px rgba(48,173,177,0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(48,173,177,0.3);
}

.btn-secondary {
  background: var(--white);
  color: #4a5260;
  border: 1.5px solid #e0e4e9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--white);
  box-shadow: 0 1px 6px rgba(48,173,177,0.15);
}

.btn-danger {
  background: var(--white);
  color: #d63031;
  border: 1.5px solid rgba(214,48,49,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.btn-danger:hover {
  background: #fff0f0;
  border-color: #d63031;
  box-shadow: 0 1px 6px rgba(214,48,49,0.15);
}

/* Malá tlačítka */
.btn[style*="padding:4px"],
.btn[style*="padding: 4px"] {
  height: 28px;
  padding: 0 12px;
  font-size: 10px;
}

/* Fallback pro button bez třídy */
button:not([class]) {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 20px;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1.5px solid #e0e4e9;
  background: var(--white);
  color: #4a5260;
  transition: all 0.15s;
}

button:not([class]):hover {
  border-color: var(--teal);
  color: var(--teal);
}
