﻿:root {
    --menu-bg: #405066;
    --menu-bg-alt: #431C04;
    --top-bg-color: #0A61A4;
    --top-bg-image: url(bg_top.jpg);
    --body-bg-image: url(bg.jpg);
    --base-font-size: var(--base-font-size);
    --radius: 12px;
    --middle-width: var(--middle-width);
}
/* ===== Global container styles for Job_tpl – Parempoolsed kastid (Job Sidebar) ===== */
.job-template-wrapper {
    display: flex;
    column-gap: 4px;
    max-width: var(--middle-width);  /* Määra sobiv maksimaalne laius */
    margin: 0 auto;    /* Keskenda konteiner horisontaalselt */
}
.job-main {
    flex: 1;
    position: relative;
}
/* Job Sidebar: parempoolne konteiner, mis sisaldab kõiki külgribas olevaid kaste */
.job-sidebar {
    width: 200px;
    padding: 0;
    border: 0 solid #ccc;
    background-color: var(--yellow-bg);
    margin-top: 0px;  /* Lisa 5px altpoolse nihke */
    margin-bottom: 0px; /* alumise osa lühendamiseks 5px võrra */

    /*margin-left: 2%;  lisatud nihutamiseks 2% võrra paremale */
}
  
/* Kastide sisu stiilid parempoolses konteineris */
.sidebar-box {
    border: 0 solid #ccc;
    padding: 0;
    margin-bottom: 0;
    background-color: var(--yellow-bg);
}
.sidebar-box h3 {
    margin: 0;
    text-align: center;
}
.sidebar-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-box li {
    margin-bottom: 0;
    text-align: center;
}
.delete-btn {
    width: 10px;
    height: 10px;
    font-size: 8px;
    line-height: 10px;
    padding: 0;
    border: none;
    background-color: #f66;
    color: #fff;
    text-align: center;
    cursor: pointer;
}
  

/* Failide nimekirja kast; kõrgus tõstetud 5px võrra (455px → 460px) ja kerimine lisatud */
.file-list {
    height: 480px !important;
    overflow-y: auto;
    margin-top: 0;
}

/* Arve konteiner – fikseeritud 250px kõrgus */
.sidebar-box.arve {
  height: 172px;
  overflow-y: auto;
  margin-top: 6px;
}


/* ===== Peida varuosad ja kalkulatsiooni osa vaikimisi ===== */
#partsCalcBlock {
    display: none;
}

/* ===== Allolevad üldised stiilid ===== */

/* ===== Algsed stiilid ===== */
html {
    overflow-y: scroll;
}
body {
    background: #ffffff;
    background-image: var(--body-bg-image);
    margin: 0;
    padding: 0;
    margin-bottom: 60px;
    width: 100%;
    scrollbar-arrow-color: #d3d3d3;
    scrollbar-face-color: #eaeaea;
    scrollbar-track-color: #f1f1f1;
    scrollbar-highlight-color: #ffffff;
    scrollbar-3dlight-color: #c5c5c5;
    scrollbar-shadow-color: #c5c5c5;
    scrollbar-darkshadow-color: #ffffff;
}
input {
    padding: 2px;
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    height: 24px;
    color: #657378;
    font-weight: normal;
    background: #F4F8EC;
    border: 1px solid #D7D7D7;
    border-radius: var(--radius);
}
form, div, checkbox {
    margin: 0;
    padding: 0;
}
table {
    border-width: 0;
    border-collapse: collapse;
    margin: 0;
}
img {
    border: 0;
}
h1 {
    font-family: Verdana, Arial;
    font-size: 20px;
    color: #6398C1;
    font-weight: bold;
    padding-bottom: 12px;
    margin: 0;
}
td {
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    color: #58564f;
}
a:link, a:visited, a:hover {
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    color: #9C2424;
    text-decoration: underline;
}
.f_button {
    font-family: Verdana, Arial;
    font-size: 10px;
    color: #ffffff;
    background: #2184d0;
    padding: 3px 6px;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
}
.f_button:hover {
    background: #2184d0;
}
.but_trans {
    font-family: Verdana, Arial;
    font-size: 10px;
    color: #000;
    font-weight: normal;
    background: var(--yellow-bg);
    border: 0;
}
.box {
    padding: 2px;
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    height: 24px;
    color: #657378;
    background: #F4F8EC;
    border: 1px solid #D7D7D7;
    border-radius: var(--radius);
}

/* ===== Top area ===== */
.d_top {
    height: 75px;
    background-color: var(--top-bg-color);
    background-image: var(--top-bg-image);
    position: relative;
}
.d_top_logo {
    position: absolute;
    left: 130px;
    top: 4px;
}
.d_top_login {
    position: relative;
    width: var(--middle-width);
}
.d_top_username {
    position: absolute;
    left: 0;
    line-height: 43px;
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    color: #fff;
    font-weight: bold;
}
.d_top_logout {
    position: absolute;
    right: 40px;
    line-height: 43px;
}
.d_me_edit {
    position: absolute;
    right: 0;
    top: 6px;
    line-height: 43px;
}
a.logout:link, a.logout:visited, a.logout:hover {
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    color: #fff;
    text-decoration: underline;
}
.d_menu_1 {
    background-color: var(--menu-bg);
    text-align: center;
    margin-top: 0;
    padding-top: 6px;
    padding-bottom: 6px;
    position: relative;
    z-index: 9999;
}
.mobile-menu-toggle{
    display:none;
    position:absolute;
    left:8px;
    top:6px;
    background:transparent;
    border:1px solid rgba(255,255,255,0.45);
    border-radius:6px;
    width:36px;
    height:30px;
    padding:4px 6px;
    z-index:10001;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}
.mobile-menu-toggle .mm-bar{
    display:block;
    height:2px;
    margin:3px 0;
    background:#fff;
    border-radius:2px;
    width:100%;
}
.s_menu_1 {
    width: 1px;
    background-color: #fff;
}
a.menu_1:link, a.menu_1:visited {
    font-family: Verdana, Arial;
    font-size: calc(var(--base-font-size) + 2px);
    color: #fff;
    text-decoration: none;
    z-index: 9990;
}
a.menu_1:hover {
    font-family: Verdana, Arial;
    font-size: calc(var(--base-font-size) + 2px);
    color: #fff;
    text-decoration: underline;
    z-index: 9990;
}
.d_menu_1 td{
    padding-top: 6px;
    padding-bottom: 6px;
}

/* Invoice numeric cell labels */
.cell-number{
    position: relative;
    padding-right: 48px;
}
.cell-number .cell-label-right{
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #666;
    pointer-events: none;
    white-space: nowrap;
    display: none;
}

/* Job sidebar toggle (hide by default, show on mobile) */
.job-sidebar-toggle{
    display: none;
    background: var(--menu-bg);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}
/* Job sidebar edge handle (mobile) */
.job-sidebar-handle{ display:none; }
.job-sidebar-close{ display:none; }
.job-sidebar-overlay{ display:none; }

/* ===== Center area ===== */
.f_small_1 {
    font-size: 10px;
}
.f_error {
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    background-color: #ffdbdd;
    color: #c00000;
    padding: 10px;
    margin-bottom: 4px;
    text-align: center;
    border: 1px solid #9e0039;
    border-radius: var(--radius);
}
.f_success {
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    background-color: #e1efcd;
    color: #598527;
    padding: 10px;
    margin-bottom: 4px;
    text-align: center;
    border: 1px solid #598527;
    border-radius: var(--radius);
}
.d_middle {
    width: var(--middle-width);
    background: #fff;
    text-align: justify;
    padding: 12px;
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    color: #58564f;
    line-height: 15px;
    min-height: 300px;
    margin-top: 12px;
}
.rounded-corners {
    border: 2px solid #D7D7D7;
    border-radius: var(--radius);
}
.worker_time {
    background-color: var(--yellow-bg);
    position: absolute;
    height: 21px;
    width: 500px;
    cursor: pointer;
    opacity: 0.4;
    filter: alpha(opacity=40);
}
.cal_inactive {
    border: 1px solid #D6D3D6;
    background-color: #EFEFEF;
    height: 26px;
    padding-left: 6px;
    font-size: 10px;
}
.cal_active {
    border: 1px solid #DC301E;
    background-color: #FFEFA5;
    height: 26px;
    padding-left: 6px;
    font-size: 10px;
}
.cal2_inactive {
    border: 1px solid #D6D3D6;
    padding: 6px;
}
.cal2_active {
    border: 1px solid #DC301E;
    padding: 6px;
}

/* ===== Edit area ===== */
.t_add_h, .t_add_h2 {
    border: 1px solid #E7D373;
    width: 100%;
    background-color: #FFEFA5;
    height: 29px;
    background-image: url(bg_yellow.png);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0;
    padding: 0;
}
.t_add_i {
    line-height: 29px;
    margin-left: 12px;
}
.d_edit {
    width: 100%;
    background-color: var(--yellow-bg);
    padding-bottom: 16px; /* ← lisatud */
}

/* ===== Header Alignment ===== */
.t_add_h2 table {
    width: 100%;
    height: 29px;
    table-layout: fixed;
    margin: 0;
    padding: 0;
    border-collapse: collapse;
}
.t_add_h2 table tr td {
    vertical-align: middle;
    padding: 0 10px;
}
.t_add_h2 table tr td:nth-child(1) {
    text-align: left;
}
.t_add_h2 table tr td:nth-child(2) {
    text-align: center;
}
.t_add_h2 table tr td:nth-child(3) {
    text-align: right;
}

/* ===== Center table area ===== */
.table_header_1, .table_header_2 {
    font-size: var(--base-font-size);
    background: #E6E4E4;
    height: 24px;
    font-weight: bold;
    text-align: center;
    background-image: url(bg_header.gif);
    cursor: pointer;
}
.table_seek {
    padding: 2px;
    background-color: #F4F4F4;
    text-align: center;
}
.table_1 {
    width: 100%;
}
.td_1 {
    background-color: #fff;
}
.td_2 {
    background-color: #EBEDEF;
}
.td_0 {
    height: 1px;
    background-color: #E6E4E4;
}

/* ===== Page numbers ===== */
a.page_nr:link, a.page_nr:visited {
    margin: 2px;
    border: 1px solid #58564f;
    text-decoration: none;
    background-color: #E2E2DA;
    padding: 1px 4px;
    color: #58564f;
    font-size: var(--base-font-size);
}
a.page_nr:hover {
    margin: 2px;
    border: 1px solid #58564f;
    background-color: #FFE77B;
    padding: 1px 4px;
    color: #58564f;
    font-size: var(--base-font-size);
}
a.page_nr_selected:link, a.page_nr_selected:visited {
    margin: 2px;
    border: 1px solid #2184d0;
    text-decoration: none;
    background-color: #D0DFEA;
    padding: 1px 4px;
    color: #2184d0;
    font-size: var(--base-font-size);
}
a.page_nr_selected:hover {
    margin: 2px;
    border: 1px solid #2184d0;
    background-color: #FFE77B;
    padding: 1px 4px;
    color: #2184d0;
    font-size: var(--base-font-size);
}

/* ===== Padding helper classes ===== */
.pt_3 { padding-top: 3px; }
.pb_3 { padding-bottom: 3px; }
.pr_3 { padding-right: 3px; }
.pl_3 { padding-left: 3px; }
.pr_6 { padding-right: 6px; }
.pl_6 { padding-left: 6px; }
.pt_12 { padding-top: 12px; }
.pb_12 { padding-bottom: 12px; }
.pl_12 { padding-left: 12px; }
.pr_12 { padding-right: 12px; }
.lh_20 { line-height: 20px; }
.p_7 { padding: 7px; }

/* ===== Popup styles ===== */
#tinybox {
    position: absolute;
    display: none;
    padding: 0;
    background: #fff url(preload.gif) no-repeat 50% 50%;
    border: 10px solid #e3e3e3;
    z-index: 2000;
}
#tinymask {
    position: absolute;
    display: none;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: #000;
    z-index: 1500;
}
#tinycontent {
    background: #fff;
}
.popup {
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    color: #58564f;
}

/* ===== By link ===== */
.d_copyright {
    width: 980px;
    text-align: right;
    margin-top: 12px;
    margin-bottom: 12px;
}
a.sky:link, a.sky:visited, a.sky:hover {
    font-family: Verdana, Arial;
    font-size: 10px;
    color: #B2B0B0;
    text-decoration: underline;
}

/* ===== Mobiili print ja lehe paigutus ===== */
@page {
    size: A4 portrait;
    margin: 0.5cm;
    @top-left { content: ""; }
    @top-center { content: ""; }
    @top-right { content: ""; }
    @bottom-left { content: ""; }
    @bottom-center { content: ""; }
    @bottom-right { content: ""; }
}
@media print {
    body {
        margin: 0;
        padding: 0;
    }
    .print_logo_1 {
        position: absolute;
        right: 12px;
        top: 23px;
    }
    .print_logo_2 {
        position: absolute;
        left: 12px;
        top: 26px;
    }
    .print_allkiri {
        float: left;
        padding-right: 60px;
    }
    .print-images-wrapper {
        text-align: center;
        margin-top: 20px;
        page-break-before: avoid;
        page-break-after: avoid;
    }
    .print-image-container {
        page-break-inside: avoid;
        margin: 10px auto;
        width: 100%;
    }
    .print-image-container img {
        width: 100%;
        height: auto;
        max-height: calc(100vh - 2cm);
        object-fit: contain;
        display: block;
        margin: 0 auto;
    }
    
}

/* ===== Lisastiilid töö vormi ja invoice sektsiooni jaoks ===== */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.form-label {
    width: 150px;
    margin-right: 8px;
    text-align: right;
    line-height: 1.2;
}
.form-input {
    flex: 1;
}
.single-line {
    height: 24px;
    font-size: var(--base-font-size);
}
input.box, select.box, textarea.box {
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}
.box {
    background: #F4F8EC;
    border: 1px solid #D7D7D7;
    padding: 4px;
    font-family: Verdana, Arial;
    font-size: 10px;
    color: #657378;
    border-radius: var(--radius);
}
.button-row {
    display: flex;
    align-items: center;
    gap: 0px;
}
.invoice-row button {
    margin-left: 12px;  /* Muuda väärtust vastavalt vajadusele */
}

.invoice-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 12px;
}
.invoice-calc {
    min-width: 180px;
    margin-left: 20px;
    font-size: var(--base-font-size);
    line-height: 1.4;
}
.invoice-calc div {
    margin-top: 8px;
}
.invoice-left table,
.invoice-container table,
.invoice-container table th,
.invoice-container table td {
    font-size: var(--base-font-size);
}
.invoice-left table {
    margin-left: 12px;
}
select.box.single-line {
    height: 24px !important;
    width: 292px !important;
    font-size: 12px !important;
    line-height: 24px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    padding: 0 4px !important;
}
input[type="checkbox"] {
    transform: scale(1.5) !important;
    -webkit-transform: scale(1.5) !important;
    -moz-transform: scale(1.5) !important;
    margin: 5px !important;
}
.checkbox-group {
    display: flex;
    gap: 12px;
    align-items: center;
}
.checkbox-group label {
    font-size: var(--base-font-size);
    white-space: nowrap;
}


/* ===== Job_tpl specific lisastiilid ja originaalsed mõõtmed ===== */
#name {
    width: 400px;
}
#client2 {
    width: 100px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}
#serialnr {
    width: 100px;
}
#hard_user,
#hard_pass {
    width: 100px;
}
#other_info,
#defects {
    width: 400px;
    height: 30px;
}
#complaints {
    width: 400px;
    height: 60px;
    background: #F4F8EC;
    border: 1px solid #D7D7D7;
}
#estimated_cost {
    width: 100px;
}
#worker_name {
    width: 190px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}
#time_cal_date {
    width: 73px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}
#time_cal_time {
    width: 40px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}
#time_cal_duration2 {
    width: 90px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}
#client_id_div {
    display: inline-block;
    vertical-align: middle;
    margin-left: 2px;
    width: 292px
}

#client_id {
    width: 260px;
}
select[name="status"] {
    width: 100px !important;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}
#sms_custom {
    width: 300px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}
#solution,
#parts {
    width: 400px;
    height: 60px;
}
#worktime,
#parts_price,
#service_price,
#total_cost {
    width: 100px;
}
.invoice-container select[name^="invoice[article]"] {
    width: 120px;
}
.invoice-container input[name^="invoice[name]"] {
    width: 200px;
}
.invoice-container input[name^="invoice[quantity]"] {
    width: 60px;
}
.invoice-container input[name^="invoice[price]"] {
    width: 80px;
}

/* ===== Unified JS fields and dropdowns ===== */
#worker_name,
#time_cal_date,
#time_cal_time,
#time_cal_duration2,
#sms_custom,
select[name="status"] {
    height: 24px;
    width: 292px !important;
    line-height: 24px;
    vertical-align: middle;
    display: inline-block;
    margin-right: 2px;
}


select#worker_id {
    height: 24px;
    width: 100px !important;
    line-height: 24px;
    vertical-align: middle;
    display: inline-block;
    margin-right: 2px;
}

/* ===== Printer icon adjustments ===== */
img[alt="trüki tööleht"],
img[title="trüki tööleht"] {
    float: right;
    padding-right: 16px;
    margin-top: 250px;
    cursor: pointer;
}

#uploadedImagesList {
    float: right;
    clear: both;
    margin-top: 20px;
}
#uploadedImagesList .serial-upload-container {
    display: flex;
    align-items: center;
    gap: 8px;
}
#uploadedImagesList {
    display: inline-block;
    width: 200px;
    max-height: 400px;
    overflow-y: auto;
}
#uploadedImagesList ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
#uploadedImagesList li {
    margin-bottom: 4px;
}

.sidebar-section {
    border: 1px solid #ccc;
    margin-bottom: 10px;
    padding: 5px;
}
.ui-autocomplete {
    z-index: 300;
}
/* === 1) Algne reset: lubame body’l scrollida === */
html, body {
    margin: 0;
    padding: 0;
    height: auto;          /* või jäta vaikimisi */
    overflow-y: auto;      /* peamine leht scrollib */
  }
  
  /* === 2) Kui modal on avatud, peidame page-scroll === */
  body.mfp-open,
  html.mfp-open {
    overflow: hidden !important;
  }
  
  /* === 3) Overlay (taustmask) kogu ekraanile === */
  .mfp-bg {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.7) !important;
  }
  
  /* === 4) Wrapper tsentreeb modal’i, ei luba seal page-scroll’i === */
  .mfp-wrap {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
  }
  
  /* === 5) Väline kast 370×520 ja kollane taust === */
  .mfp-container {
    position: relative !important;
    width: 370px !important;
    height: 520px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: var(--yellow-bg) !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  
  /* === 6) Sisu-kast täidab selle ja scroll lisatakse ainult vormi sees === */
  .mfp-content {
    width: 100% !important;
    height: 100% !important;
    background: var(--yellow-bg) !important;
    overflow: hidden !important;
    box-sizing: border-box;
    border-radius: 8px;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .mfp-content .d_edit.popup {
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
  }
  
  /* === 7) Siseste scrollbar’ide peitmine (bar’ideta scroll) === */
  .mfp-content .d_edit.popup::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
  }
  .mfp-content .d_edit.popup {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  
/* =========================================================
   GLOBAL STYLES – CONFLICT-FREE COMBINED  BLOCK  (07 Jul 2025)
   ---------------------------------------------------------
   • The original “incoming-call-modal” stacked cards remain
     exactly as before (small, right-hand stack).
   • A NEW fullscreen overlay variant is introduced under
     .incoming-call-overlay  → does **not** clash with the
     existing stacked cards.
   • Duplicate / conflicting selectors & animations merged
     or renamed; only one definition per class / keyframes.
   ========================================================= */

/* 1) Placeholder appearance  --------------------------------*/
input::placeholder,
textarea::placeholder{
  color:red;
  text-align:center;
  font-weight:bold;
}

/* 2) Generic call controls  --------------------------------*/
.call-controls{
  margin:20px 0;
  padding:20px;
  border:1px solid #ddd;
  border-radius:8px;
  background:#f9f9f9;
}

.button{
  padding:10px 20px;
  margin:5px;
  border:none;
  border-radius:5px;
  cursor:pointer;
  font-size:16px;
  transition:all .3s;
}
.button:disabled{opacity:.6;cursor:not-allowed;}

.btn-initialize{background:#4CAF50;color:#fff;}
.btn-hangup   {background:#f44336;color:#fff;}
.btn-mute     {background:#ff9800;color:#fff;}

/* 3) Status banner (bottom-left) ---------------------------*/
#call-status{
  position:fixed;
  bottom:15px;
  left:15px;
  background:#333;
  color:#fff;
  padding:10px 20px;
  border-radius:5px;
  z-index:9999;
  max-width:200px;
  font:10px/1 monospace;
}

/* 4) Multiple-calls indicator  -----------------------------*/
.multiple-calls-indicator{
  position:fixed;
  top:80px;                 /* room for global hangup btn   */
  right:20px;
  background:#ff6b6b;
  color:#fff;
  padding:10px 20px;
  border-radius:20px;
  font-weight:bold;
  display:none;
  z-index:9999;
  animation:pulse 1s infinite;
}

@keyframes pulse{
  0%,100%{transform:scale(1)}
  50%   {transform:scale(1.05)}
}

/* 5) STACKED SMALL INCOMING CARDS  (unchanged)  ------------*/
#incoming-calls-container{
  position:fixed;
  bottom:80px;
  right:0;
  width:170px;                     /* 2× reduced */
  max-height:calc(100vh - 100px);
  pointer-events:none;
  z-index:9999;
  overflow-y:auto;
  padding:0;
}

/* --- card container --- */
.incoming-call-modal{
  position:relative;               /* keep “stack” behaviour */
  right:0;
  width:160px;
  margin-bottom:10px;
  background:rgba(0,0,0,.05);
  backdrop-filter:blur(2px);
  border-radius:15px;
  pointer-events:all;
  animation:modalSlideIn .3s ease-out;
  z-index:9999;
}

/* --- card contents --- */
.incoming-call-content{
  background:#fff;
  padding:10px;
  border-radius:15px;
  text-align:center;
  box-shadow:0 8px 25px rgba(0,0,0,.15);
  border:2px solid #e9ecef;
  transition:all .3s;
  height:120px;
}
.incoming-call-content:hover{
  transform:translateX(-5px);
  box-shadow:0 12px 35px rgba(0,0,0,.2);
  border-color:#007bff;
}

/* --- per-card elements --- */
.call-count{
  position:absolute;top:-10px;right:-10px;
  background:#ff4444;color:#fff;
  width:20px;height:20px;
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font:bold 10px/1 sans-serif;
}

.call-animation     {font-size:20px;animation:ring 1s infinite;margin-bottom:5px;}
.caller-main        {font-size: var(--base-font-size);font-weight:bold;color:#333;margin-bottom:8px;}
.caller-number      {font-size:10px;color:#666;margin-bottom:8px;}
.caller-client      {font-size:10px;color:#444;margin-bottom:8px;font-weight:bold;}

.btn-answer,.btn-decline{
  padding:6px 12px;margin:0 3px;
  border:none;border-radius:20px;
  font:bold 12px/1 sans-serif;
  cursor:pointer;transition:all .2s;
}
.btn-answer {background:#28a745;color:#fff;}
.btn-decline{background:#dc3545;color:#fff;}
.btn-answer:hover{background:#218838;transform:translateY(-2px);}
.btn-decline:hover{background:#c82333;transform:translateY(-2px);}

/* Stacking depth visual tweak */
.stacked-1{transform:translateY(10px) scale(.95);}
.stacked-2{transform:translateY(20px) scale(.90);}
.stacked-3{transform:translateY(30px) scale(.85);}

/* Slide-in + ring anim for stacked cards */
@keyframes modalSlideIn{from{opacity:0;transform:translateX(100%)} to{opacity:1;transform:none}}
@keyframes ring{0%,100%{transform:rotate(-15deg)} 50%{transform:rotate(15deg)}}

/* 6) FULLSCREEN INCOMING CALL OVERLAY  ---------------------*/
/*  – renamed to avoid clashing with stacked cards           */
.incoming-call-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.80);
  display:flex;align-items:center;justify-content:center;
  animation:fadeIn .3s ease forwards;
  z-index:10000;
}
.incoming-call-overlay .incoming-call-content{
  min-width:300px;
  padding:40px;
  border-radius:20px;
  box-shadow:0 10px 40px rgba(0,0,0,.3);
}
.incoming-call-overlay .call-animation{font-size:60px;margin-bottom:20px;}
.incoming-call-overlay .caller-main{font-size:24px;margin-bottom:10px;color:#333;}
.incoming-call-overlay .btn-answer,
.incoming-call-overlay .btn-decline{padding:12px 30px;font-size:16px;margin:0 10px;}
.incoming-call-overlay .call-count{
  top:-15px;right:-15px;width:40px;height:40px;
  font-size:20px;
}

@keyframes fadeIn  {from{opacity:0} to{opacity:1}}
@keyframes fadeOut {to{opacity:0}}

/* 7) Global hang-up button ---------------------------------*/
.phone-hang{
  position:fixed;top:20px;left:20px;
  background:#dc3545;color:#fff;
  border:none;
  padding:8px 16px;
  border-radius:20px;
  cursor:pointer;font:bold 14px/1 sans-serif;
  display:inline-flex;align-items:center;gap:5px;
  transition:all .3s;
  z-index:10001;
}
.phone-hang:hover   {background:#c82333;transform:scale(1.05);}
.phone-hang.hidden  {display:none !important;}

.phone-transfer{
  position:fixed;top:20px;left:20px;
  background:#6f42c1;color:#fff;
  border:none;
  padding:8px 14px;
  border-radius:20px;
  cursor:pointer;font:bold 12px/1 sans-serif;
  display:inline-flex;align-items:center;gap:5px;
  transition:all .2s;
  z-index:10001;
}
.phone-transfer.secondary{background:#495057;}
.phone-transfer:hover{transform:scale(1.04);}
.phone-transfer.hidden{display:none !important;}

/* 8) Announcement (scrolling bottom banner) ----------------*/
.announcement-ticker{
  position:fixed;left:0;right:0;bottom:0;
  background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);
  color:#fff;height:40px;border-top:2px solid #5a67d8;
  box-shadow:0 -2px 10px rgba(0,0,0,.2);
  display:flex;align-items:center;z-index:1000;
}
.announcement-content{flex:1;overflow:hidden;height:100%;display:flex;align-items:center;}
.scrolling-text{
  white-space:nowrap;display:inline-block;font:500 14px/40px sans-serif;
  animation:scroll-left 25s linear infinite;padding-left:20%;
}
@keyframes scroll-left{
  0%   {transform:translate3d(100%,0,0)}
  100% {transform:translate3d(-100%,0,0)}
}
.announcement-close{
  background:rgba(255,255,255,.2);
  border:none;color:#fff;
  width:30px;height:30px;border-radius:50%;
  cursor:pointer;font:bold 18px/30px sans-serif;
  margin-right:10px;display:flex;align-items:center;justify-content:center;
  transition:all .3s;
}
.announcement-close:hover{background:rgba(255,255,255,.3);transform:scale(1.1);}
.announcement-icon{margin-right:10px;font-size:16px;}

/* body bottom margin to avoid banner overlap */
body{margin-bottom:40px;}

/* 9) Utilities ---------------------------------------------*/
.hidden{display:none !important;}
#hangupBtn{
  position:absolute;inset:0;
  background:#dc3545;color:#fff;border:none;z-index:10;
}
#callWrapper{position:relative;display:inline-block;}
.menu_1.active{font-weight:bold;text-decoration:underline;}
#callTimer{display:inline-block;margin-left:10px;font-weight:bold;}
/* client-modal.css - Kliendi lisamise modaali stiilid */

/* jQuery UI Dialog overrides kliendi modaalile */
.ui-dialog.client-modal-dialog {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.ui-dialog.client-modal-dialog .ui-dialog-titlebar {
    background: var(--yellow-bg);
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    padding: 10px 15px;
}

.ui-dialog.client-modal-dialog .ui-dialog-title {
    font-size: 18px;
    font-weight: 600;
}

.ui-dialog.client-modal-dialog .ui-dialog-content {
    padding: 0 !important;
    overflow: visible !important;
    background: var(--yellow-bg) !important;
}

/* Kliendi modaali põhistiilid */
#add_new2 {
    background: var(--yellow-bg) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    font-family: Verdana, Arial;
}

#add_new2 .add-client-form-container {
    padding: 20px;
    background: var(--yellow-bg);
    position: relative;
}

#add_new2 h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
    text-align: center;
    color: #333;
}

/* Vormi stiilid */
#add_new2 .form-row-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

#add_new2 .form-row {
    flex: 1 1 calc(50% - 5px);
    min-width: 200px;
    margin-bottom: 0;
}

#add_new2 .form-row.full-width {
    flex: 1 1 100%;
}

#add_new2 .form-row label {
    display: block;
    font-size: var(--base-font-size);
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}

#add_new2 .form-row input,
#add_new2 .form-row select,
#add_new2 .form-row textarea {
    width: 100%;
    padding: 6px 8px;
    font-size: var(--base-font-size);
    border: 1px solid #D7D7D7;
    border-radius: 4px;
    background: #F4F8EC;
    color: #657378;
    box-sizing: border-box;
    font-family: Verdana, Arial;
}

#add_new2 .form-row textarea {
    min-height: 50px;
    resize: vertical;
}

/* Error messages */
#add_new2 .form-errors {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

#add_new2 .error-msg {
    color: #dc3545;
    font-size: 11px;
    display: none;
    margin-top: 2px;
}

/* Footer */
#add_new2 .form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

#add_new2 .f_button {
    background: #2184d0;
    color: #ffffff;
    padding: 4px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-family: Verdana, Arial;
}

#add_new2 .f_button:hover {
    background: #1a6db8;
}

#add_new2 .f_button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Close button */
#add_new2 .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#add_new2 .close-btn:hover {
    color: #333;
}
/* LISAGE NEED STIILID OLEMASOLEVA CSS JUURDE */

/* Modaali fikseeritud laius */
/* LISAGE NEED STIILID OLEMASOLEVA CSS JUURDE */
/* Modaali väiksem fikseeritud laius */
.ui-dialog.client-modal-dialog {
    width: 320px !important;
    max-width: 320px !important;
    min-width: 320px !important;
    /* Olemasolevad stiilid jäävad samaks */
}

/* Keela suuruse muutmine */
.ui-dialog.client-modal-dialog .ui-resizable-handle {
    display: none !important;
}

/* Parandatud vormi joondus - asenda olemasolev .form-row */
#add_new2 .form-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px; /* Vähendatud 8px -> 4px */
    min-height: 28px; /* Vähendatud 32px -> 28px */
    gap: 6px; /* Vähendatud gap 8px -> 6px */
}

/* Kõik read täislaiuses */
#add_new2 .form-row.full-width,
#add_new2 .form-row {
    flex: 1 1 100% !important;
    min-width: 100% !important;
}

/* Label'id - väiksem fikseeritud laius, joondus paremale */
#add_new2 .form-row label {
    display: block;
    font-size: 11px; /* Vähendatud 12px -> 11px */
    font-weight: bold;
    color: #333;
    width: 90px; /* Vähendatud 120px -> 90px */
    min-width: 90px;
    max-width: 90px;
    text-align: right;
    margin: 0;
    padding-right: 6px; /* Vähendatud 8px -> 6px */
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Input väljad - ülejäänud ruumi kasutamine */
#add_new2 .form-row input,
#add_new2 .form-row select,
#add_new2 .form-row textarea {
    flex: 1;
    padding: 5px 6px; /* Vähendatud 6px 8px -> 5px 6px */
    font-size: 11px; /* Vähendatud 12px -> 11px */
    border: 1px solid #D7D7D7;
    border-radius: 3px; /* Vähendatud 4px -> 3px */
    background: #F4F8EC;
    color: #657378;
    box-sizing: border-box;
    font-family: Verdana, Arial;
    margin: 0;
}

/* Textarea erisused */
#add_new2 .form-row textarea {
    min-height: 45px; /* Vähendatud 50px -> 45px */
    resize: vertical;
}

/* Kohustuslike väljade märgistus */
#add_new2 .form-row.required label::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Veateated - joonda input väljaga */
#add_new2 .error-msg {
    color: #dc3545;
    font-size: 10px; /* Vähendatud 11px -> 10px */
    display: none;
    margin-top: 1px; /* Vähendatud 2px -> 1px */
    margin-left: 96px; /* 90px + 6px gap */
}

/* Form group - vertikaalne paigutus */
#add_new2 .form-row-group {
    display: flex;
    flex-direction: column;
    gap: 3px; /* Vähendatud 6px -> 3px */
    margin-bottom: 6px; /* Vähendatud 12px -> 6px */
}

/* Spetsiifilised joondused erinevatele väljadele */
#add_new2 .form-row:has(input[name="name"]) label,
#add_new2 .form-row:has(input[name="contact"]) label,
#add_new2 .form-row:has(input[name="phone"]) label,
#add_new2 .form-row:has(input[name="email"]) label,
#add_new2 .form-row:has(input[name="address"]) label,
#add_new2 .form-row:has(textarea[name="notes"]) label,
#add_new2 .form-row:has(select[name="type"]) label {
    text-align: right;
}

/* Focus stiilid */
#add_new2 .form-row input:focus,
#add_new2 .form-row select:focus,
#add_new2 .form-row textarea:focus {
    border-color: #2184d0;
    background: #fff;
    outline: none;
}

/* Responsive - väiksemate ekraanide jaoks */
@media (max-width: 360px) { /* Kohandatud 480px -> 360px */
    #add_new2 .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px; /* Vähendatud 4px -> 3px */
    }
    
    #add_new2 .form-row label {
        width: 100%;
        text-align: left;
        padding-right: 0;
    }
    
    #add_new2 .error-msg {
        margin-left: 0;
    }
}
/* Debug stiilid - eemaldage pärast testimist */
/*
#add_new2 .form-row {
    border: 1px dashed #ccc;
}
#add_new2 .form-row label {
    background: rgba(255,0,0,0.1);
}
#add_new2 .form-row input,
#add_new2 .form-row select,
#add_new2 .form-row textarea {
    background: rgba(0,255,0,0.1);
}
*/
/* Autocomplete dropdown modaali sees */
.ui-autocomplete.client-modal-autocomplete {
    z-index: 10001 !important;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #D7D7D7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
}

.ui-autocomplete.client-modal-autocomplete .ui-menu-item {
    padding: 6px 10px;
    cursor: pointer;
}

.ui-autocomplete.client-modal-autocomplete .ui-state-focus,
.ui-autocomplete.client-modal-autocomplete .ui-state-active {
    background: #007fff;
    color: white;
    margin: 0;
}

/* Loader */
#add_new2 .loader {
    text-align: center;
    padding: 40px;
    color: #666;
}
/* CSS stiilid titlebar'i peitmiseks ja laiuse fikseerimiseks */
.ui-dialog.no-titlebar .ui-dialog-titlebar {
    display: none !important;
}

.ui-dialog.no-titlebar {
    padding: 0 !important;
}

.ui-dialog.no-titlebar .ui-dialog-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Fikseeritud laius modaalile */
.ui-dialog {
    width: 420px !important;
    max-width: 420px !important;
    min-width: 420px !important;
}

/* Eemalda kõik resize handle'id */
.ui-dialog .ui-resizable-handle {
    display: none !important;
}


/* ===== PARANDATUD KÕNE NUPPUDE STIILID ===== */

/* Kõne wrapper - KINDEL KÕRGUS! */
#callWrapper {
    display: inline-block;
    position: relative;
    min-width: 150px;
    height: 32px; /* TÄHTIS: fikseeritud kõrgus */
    vertical-align: middle;
}

/* Kõne alustamise nupp */
#callBtn {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #28a745;
    border: none;
    border-radius: var(--radius);
    color: white;
    font-family: Verdana, Arial;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
    /* FLEXBOX teksti joondamiseks */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

#callBtn:hover:not(:disabled) {
    background: #218838;
}

#callBtn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Kõne lõpetamise nupp - PARANDATUD */
#hangupBtn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: var(--radius);
    z-index: 2;
    cursor: pointer;
    font-family: Verdana, Arial;
    font-size: 10px;
    padding: 0;
    box-sizing: border-box;
    /* FLEXBOX teksti joondamiseks */
    display: none; /* Algselt peidetud */
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    /* Ära lase nupul wrapper'ist välja */
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

#hangupBtn:hover {
    background: #c82333;
}

/* Kõne taimer */
.call-timer {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
    background: var(--yellow-bg);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #d7d7d7;
    color: #333;
    font-family: Verdana, Arial;
    font-size: 10px;
    vertical-align: middle;
    min-height: 20px;
    line-height: 20px;
}

/* Globaalne hangup nupp (kui olemas) */
#globalHangupBtn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 10001;
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    
}

/* Button row parandused */
.button-row {
    display: flex;
    align-items: center;
    gap: 0px;
    flex-wrap: wrap;
}

.button-row .form-input {
    display: flex;
    gap: 0px;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== SIDEBAR PARANDUSED ===== */

/* Delete nuppude parandatud stiil */
.delete-btn {
    width: 18px;
    height: 18px;
    font-size: var(--base-font-size);
    line-height: 16px;
    padding: 0;
    border: none;
    background-color: #dc3545;
    color: #fff;
    text-align: center;
    cursor: pointer;
    border-radius: 50%;
    font-weight: bold;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    min-height: 18px;
}

.delete-btn:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

/* Sidebar list itemite parandused */
.sidebar-box ul {
    list-style: none;
    padding: 5px;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.sidebar-box li {
    margin-bottom: 5px;
    padding: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,0.3);
}

.sidebar-box li:hover {
    background: rgba(255,255,255,0.6);
}

.sidebar-box a {
    color: #333;
    text-decoration: none;
    font-size: 11px;
    word-break: break-all;
}

.sidebar-box a:hover {
    text-decoration: underline;
}

/* ===== FLASH TEADETE STIILID ===== */

.notification-container {
    position: fixed;
    top: 10px;
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    z-index: 20000;
    pointer-events: none;
    padding: 0 10px;
}

.message-box {
    margin: 10px 0;
    clear: both;
    pointer-events: none;
}

#messages-anchor {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
}

.message {
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    font-family: Verdana, Arial;
    font-size: var(--base-font-size);
    font-weight: normal;
    border-width: 1px;
    border-style: solid;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    pointer-events: auto;
    width: 100%;
    box-sizing: border-box;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* ===== KLIENDI TEAVITUSTE BELL + PANEEL ===== */
.d_top_notifications {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}
.notif-bell {
    position: relative;
    border: 1px solid #cfd4da;
    background: #fff;
    border-radius: 999px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.notif-bell:hover {
    background: #f1f3f5;
}
.notif-icon {
    display: inline-block;
}
.notif-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e03131;
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}
.client-activity-panel {
    position: fixed;
    top: 64px;
    right: -360px;
    width: 340px;
    max-width: 90vw;
    height: calc(100vh - 120px);
    background: #fff;
    border: 1px solid #cfd4da;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    z-index: 20050;
    display: flex;
    flex-direction: column;
    transition: right 0.2s ease;
}
.client-activity-panel.open {
    right: 12px;
}
.client-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: bold;
    background: #f8f9fa;
}
.client-activity-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
}
.client-activity-body {
    overflow-y: auto;
    padding: 8px 12px;
    flex: 1;
}
.client-activity-item {
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
}
.client-activity-item:last-child {
    border-bottom: none;
}
.client-activity-line {
    font-size: 12px;
    color: #222;
}
.client-activity-client {
    font-weight: bold;
}
.client-activity-time {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}
.client-activity-empty {
    color: #777;
    font-size: 12px;
    padding: 12px 0;
}
.client-activity-link {
    color: #0a61a4;
    text-decoration: none;
}
.client-activity-link:hover {
    text-decoration: underline;
}



/* ===== VORMI PÕHISTIILID ===== */

/* Form row stiilid */
.form-row {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
}

.form-label {
    width: 120px;
    text-align: right;
    padding-right: 5px;
    padding-top: 5px;
    flex-shrink: 0;
}

.form-input {
    width: 555px; /* Fikseeritud laius, et kõik väljad lõppeksid samal kohal */
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== KLIENDI VALIKU STIILID ===== */

.client-selection-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 292px;
}

#client2 {
    width: 100px;
    flex-shrink: 0;
    font-family: Verdana, Arial;
    font-size: 11px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    height: 24px;
    box-sizing: border-box;
}



#client_id {
    width: 100%;
}

/* Eemaldame vana table stiili */
table.client-selection-row {
    display: none;
}

/* ===== SEERIA NR STIILID ===== */

.serial-wrapper {
    display: flex;
    align-items: left;
    gap: 5px;
    width: 100px;
}

#serialnr {
    flex: 1;
}

input[type="file"].file-upload-compact {
    width: 292px;
    height: 24px;
    padding: 2px;
    border: 1px solid #d7d7d7;
    border-radius: var(--radius);
    background: #f4f8ec;
    font-size: var(--base-font-size);
    box-sizing: border-box;
    cursor: pointer;
    }

    .upload-button {
    margin-top: 8px;
    font-size: var(--base-font-size);
    height: 30px;
    padding: 4px 12px;
    align-self: flex-start;        /* ← VÕTI: joonda vasakule */
    justify-content: flex-start;  /* ← täiendav kindlustus */
    text-align: left;
    }
    .form-input {
    align-items: flex-start !important; /* ← Joondab kõik vasakule, sealhulgas nupu */
    width: 292px !important;
    }

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 5px;
}

#uploadProgress {
    width: 200px;
}

/* ===== ÜHTLASED NUPU STIILID ===== */

.action-button {
    font-family: Verdana, Arial;
    font-size: 11px;
    padding: 4px 10px;
    height: 22px;
    border: 1px solid #ccc;
    background-color: #578bd7;
    cursor: pointer;
    border-radius: 3px;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.action-button:hover {
    background-color: #2184d0;
}

/* Tagasiühilduvus vana f_button klassiga */
.f_button {
    font-family: Verdana, Arial;
    font-size: 11px;
    padding: 4px 10px;
    height: 22px;
    border: 1px solid #ccc;
    background-color: #578bd7;
    cursor: pointer;
    border-radius: 3px;
    white-space: nowrap;
}

/* ===== KASUTAJA/PAROOL STIILID ===== */

.user-pass-inputs {
    display: flex;
    gap: 10px;
}

.user-pass-inputs input {
    width: 150px;
}

/* ===== CHECKBOX STIILID ===== */

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-group label {
    cursor: pointer;
}

        .flash {
    background-color: #e6ffe6;
    transition: background-color 0.5s ease;
}

/* === Ekspertiisiakti plokk === */
.expertise-wrapper {
  background: var(--yellow-bg);
  padding: 0px;
  margin-top: 10px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
}

.expertise-wrapper .form-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
}

.expertise-wrapper .form-label {
    width: 120px;
    text-align: right;
    padding-right: 5px;
    padding-top: 5px;
    flex-shrink: 0;
}

.expertise-wrapper .form-input {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  
}

.expertise-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expertise-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.expertise-checkbox-group input[type="checkbox"] {
  transform: scale(1.3);
  margin: 0;
}

.expertise-extra input[type="text"] {
  width: 400px;
}
/* === Kliendi valik – kõik ühel real === */
.client-inline-inputs {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap; /* vajadusel murrab mobiilivaates */
}

#client2 {
  width: 100px;
  box-sizing: border-box;
}

#client_id_div {
  width: 292px;
}

#client_id_div select {
  width: 100%;
  box-sizing: border-box;
}

#add_client_btn {
  white-space: nowrap;
  flex-shrink: 0;
}
/* Hang-up-nupu ümbris peab ise ka nähtav olema  */
.d_top_btn {
    display: inline-flex;          /* inline-block sobib ka */
    align-items: center;
}

select.box.single-line.status-narrow {
    width: 100px !important;
}
/* custom.css */
.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;  /* kaks võrdselt laia veergu */
    gap: 20px;
    width: 100%;
    background-color: var(--yellow-bg);
}
/* lisa oma stiilifaili – see laaditagu pärast Bootstrap/custom CSS-i */
.button-row .form-input{
    display:flex;          /* flex on juba sees */
    gap:0px;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;   /* ⬅️ vasakjoondus */
}

/* kui .f_button või .save-button annab automaatselt margin-eid, nulli need */
.save-button{
    margin:0;              /* pole vasakut padist ega marginit */
}

/* ToDo ridade eristamine (desktop + mobiil) */
.todo-table tr.todo-row{
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.todo-table tr.todo-unassigned{
    border-left: 4px solid #cc6b6b;
    background: #fff2f2;
}



@media(max-width: 767px) {            /* mobiil: virnastab */
    .two-cols { grid-template-columns: 1fr; }
}




/* ===== MOBIILI STIILID (max-width: 1179px) ===== */
@media only screen and (max-width: 480px) {
    .invoice-table{
        table-layout: auto !important;
        width: 100% !important;
    }
    .invoice-table td{
        overflow: visible;
    }
    .cell-number{
        padding-right: 160px;
    }
    .invoice-table td.cell-number{
        width: auto !important;
        min-width: 300px;
    }
    .row-qty,
    .row-price,
    .row-cost,
    .row-paid{
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }

    /* Job sidebar swipe panel */
    .job-sidebar{
        position: fixed;
        top: 0;
        right: 0;
        width: 85vw;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        overflow-y: auto;
        z-index: 10001;
        box-shadow: -3px 0 12px rgba(0,0,0,0.2);
        transform: translateX(100%);
        transition: transform .24s ease;
        will-change: transform;
        display: block;
        pointer-events: auto;
        touch-action: pan-y;
    }
    .job-sidebar.open{
        transform: translateX(0);
    }
    .job-sidebar.dragging{
        transition: none;
    }
    .job-sidebar-handle{
        display: block;
        position: fixed;
        right: 0;
        top: 0;
        width: 22px;
        height: 100vh;
        z-index: 10020;
        background: transparent;
        border: 0;
        touch-action: pan-y;
        pointer-events: auto;
    }
    .job-sidebar-overlay{
        display: none;
        position: fixed;
        inset: 0;
        z-index: 10000;
        background: rgba(0,0,0,0.14);
        pointer-events: none;
    }
    .job-sidebar-overlay.open{
        display: block;
        pointer-events: auto;
    }
    .job-sidebar-close{
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 22px;
        height: 100vh;
        background: transparent;
        border: 0;
        z-index: 10002;
    }
    .cell-number .cell-label-right{
        display: block;
    }
    
    /* ===== PÕHILINE PAIGUTUS JA VIEWPORT ===== */
    * {
        box-sizing: border-box;
    }
    
    body, html {
        overflow-x: hidden;
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    .container, .main-content {
        max-width: 100%;
        padding: 8px;
        margin: 0;
    }

    /* ===== MENÜÜ HORISONTAALNE SCROLL ===== */
    .d_menu_1 {
        display: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        background: var(--menu-bg);
        padding: 6px 8px;
        position: fixed;
        top: 44px;
        left: 8px;
        width: 33vw;
        max-width: 320px;
        min-width: 200px;
        height: auto;
        max-height: 70vh;
        overflow-y: auto;
        z-index: 10000;
        text-align: left;
        box-shadow: 3px 0 12px rgba(0,0,0,0.2);
        border-radius: 10px;
    }
    .mobile-menu-toggle{display:inline-flex;}
    body.menu-open .d_menu_1 { display: block; }
    .mobile-menu-toggle{
        display:inline-flex;
        align-items:center;
        justify-content:center;
        width:36px;
        height:30px;
        margin:0;
        border:1px solid rgba(0,0,0,0.65);
        background:transparent;
        color:#000;
        border-radius:6px;
        font-size:18px;
        position: fixed;
        top: 8px;
        left: 8px;
        z-index: 10002;
    }
    .mobile-menu-toggle .mm-bar{
        background:#000;
    }
    .d_menu_1 center {
        display: block;
        min-width: max-content;
        width: 100%;
        text-align: left;
    }
    .d_menu_1 table {
        min-width: max-content;
        white-space: nowrap;
        margin: 0;
    }
    .d_menu_1 td,
    .d_menu_1 a {
        white-space: nowrap;
    }
    .d_menu_1 a { color:#fff; }
    .d_menu_1 table,
    .d_menu_1 tr,
    .d_menu_1 td{
        background: var(--menu-bg) !important;
        border-radius: 0 !important;
    }
    .d_menu_1 center{
        background: var(--menu-bg) !important;
        border-radius: 0 !important;
    }
    .d_top_notifications{
        position: fixed;
        right: 10px;
        bottom: 10px;
        z-index: 10002;
    }

    .d_top_username{
        left: 0;
        right: 0;
        top: auto;
        bottom: 4px;
        text-align: center;
        line-height: 1.2;
    }

    .phone-hang,
    .phone-transfer{
        top: auto !important;
        left: 10px !important;
        bottom: 10px !important;
    }
    .phone-transfer{
        bottom: 54px !important;
    }

    /* ===== TABELI READ STACKIMISEKS ===== */
    .table-striped,
    .mobile-stack-table {
        width: 100%;
        display: block;
    }
    .table-striped thead,
    .mobile-stack-table thead {
        display: none;
    }
    .table-striped tbody,
    .mobile-stack-table tbody {
        display: block;
        width: 100%;
    }
    .table-striped tr,
    .mobile-stack-table tr {
        display: block;
        width: 100%;
        border-bottom: 1px solid #e5e5e5;
        padding: 8px 0;
    }
    .table-striped td,
    .mobile-stack-table td {
        display: block;
        width: 100%;
    }
    .table-striped td::before,
    .mobile-stack-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: bold;
        color: #666;
        margin-bottom: 4px;
        pointer-events: none;
    }
    .mobile-stack-table td::before { display:none !important; }
    .mobile-stack-table tr.stack-labels td::before { display:none !important; }
    .table-striped td[data-label=""]::before,
    .mobile-stack-table td[data-label=""]::before {
        content: "";
        margin-bottom: 0;
    }
    .mobile-stack-table td{
        font-size: 14px;
        font-weight: 600;
        text-align: center;
    }
    .mobile-stack-table tr{
        border:1px solid rgba(0,0,0,0.08);
        border-radius:10px;
        padding:10px 10px 36px 10px;
        margin-bottom:10px;
        position:relative;
        background: var(--yellow-bg);
    }
    .mobile-stack-table tr.td_0{display:none !important;}
    .mobile-stack-table td.stack-primary a{
        font-weight:700;
    }
    .jobs-table.mobile-stack-table td:last-child{
        position:absolute;
        left:10px;
        bottom:8px;
        width:auto;
    }
    .jobs-table.mobile-stack-table td:last-child img{
        display:block;
    }

    /* Mobile menu area */
    .d_menu_1{margin-top:0;}
    .d_menu_1 table{min-width:max-content;}
    .d_menu_1 td{background:transparent;}

    /* ToDo mobile cards */
    .todo-table.mobile-stack-table tr{
        background: var(--yellow-bg);
        border-color: var(--yellow-bg);
    }
    .todo-table tr.todo-row{
        border-bottom: 2px solid rgba(0,0,0,0.08);
    }
    .todo-table tr.todo-unassigned{
        border-left: 4px solid #cc6b6b;
        background: #fff2f2;
    }
    .todo-section{
        border:1px solid #d0d0d0;
        border-radius:10px;
        padding:8px;
        background:rgba(255,255,255,0.6);
        margin-bottom:12px;
    }

    /* Table_1 (headers + filters) stay in columns */
    .table_1 {
        width: 100%;
    }
    .mobile-filter-grid{
        display:block;
        width:100%;
        margin-bottom:8px;
        background: transparent;
        border: 0;
        border-radius: 0;
        padding: 0;
    }
    .mobile-filter-row{
        display:grid;
        grid-template-columns: 1fr 1fr;
        gap:6px;
        margin-bottom:6px;
        align-items:center;
    }
    .mobile-filter-label{
        font-weight:bold;
        font-size:12px;
        color:#666;
        display:flex;
        align-items:center;
    }
    .mobile-filter-label img{
        vertical-align: middle;
    }
    .mobile-filter-field input,
    .mobile-filter-field select{
        width:100%;
    }
    
    /* ===== SIDEBAR SWIPE FUNKTSIOON ===== */
    .sidebar {
        position: fixed;
        top: 0;
        right: -280px; /* Peidetud paremal */
        width: 280px;
        height: 100vh;
        background: #fff;
        box-shadow: -3px 0 10px rgba(0,0,0,0.3);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        padding: 16px;
    }
    
    .sidebar.open {
        right: 0;
    }
    
    /* Sidebar overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Sidebar toggle nupp */
    .sidebar-toggle {
        position: fixed;
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        background: #007cba;
        color: white;
        border: none;
        border-radius: var(--radius);
        z-index: 1001;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    
    /* ===== ÜLDISED PAIGUTUSE REEGLID ===== */
    .form-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 12px;
        width: 100%;
    }
    
    .horizontal-row {
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    /* Nuppude grupp */
    .button-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
        width: 100%;
    }
    
    .button-group .f_button,
    .button-group .action-button {
        flex: 0 0 auto; /* Ei kasva ega kahane */
        min-width: 100px;
        max-width: 48%; /* Mahub kaks nuppu rea peale */
    }
    
    /* ===== SILDID JA SISESTUSVÄLJAD ===== */
    .form-label {
        width: 100%;
        text-align: left;
        font-size: 16px;
        font-weight: 500;
        margin-bottom: 4px;
        padding: 0;
        display: block;
    }
    
    .form-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    textarea,
    select {
        width: 100%;
        height: 44px;
        font-size: 16px;
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: var(--radius);
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
        max-width: 100%;
    }
    
    /* Textarea erisused */
    textarea {
        height: auto;
        min-height: 80px;
        resize: vertical;
        line-height: 1.4;
    }

    .expertise-wrapper .form-label {
        width: 120px;
        padding-right: 5px;
        font-weight: bold;
        text-align: right;
        line-height: 1.4em;
        }
    
    /* Üherea sisestusväljad */
    .single-line {
        height: 44px !important;
        font-size: 16px !important;
        line-height: 1.2 !important;
    }
    
    /* ===== NUPUD ===== */
    .f_button,
    .action-button,
    button {
        font-size: 16px !important;
        height: 44px !important;
        padding: 8px 16px !important;
        min-height: 44px !important;
        min-width: 100px;
        max-width: 200px; /* Vältib liiga laiasid nuppe */
        border-radius: var(--radius);
        border: none;
        cursor: pointer;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 0;
    }
    
    /* Spetsiaalsed nupud, mis ei tohiks olla täislaiuses */
    button[type="submit"],
    .submit-btn,
    .add-btn,
    .upload-btn {
        width: auto !important;
        flex: 0 0 auto;
    }
    
    /* Väike nupp */
    .delete-btn,
    .small-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        min-width: 32px;
        min-height: 32px;
        max-width: 32px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* ===== KÕNE FUNKTSIOONID ===== */
    #callWrapper {
        min-width: 200px;
        height: 44px;
        display: flex;
        align-items: center;
        gap: 8px;
        max-width: 100%;
    }
    
    #callBtn, #hangupBtn {
        font-size: 16px;
        height: 44px;
        flex: 1;
        min-width: 80px;
    }
    
    .call-timer {
        font-size: 16px;
        padding: 12px;
        min-height: 20px;
        line-height: 20px;
        border-radius: 4px;
        white-space: nowrap;
    }
    
    /* ===== KLIENDI VALIK ===== */
    .client-selection-wrapper,
    .serial-wrapper {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    #client2,
    #client_id,
    #serialnr {
        width: 100% !important;
        height: 44px !important;
        font-size: 16px !important;
        padding: 12px !important;
        margin-bottom: 0;
        max-width: 100%;
    }
    
    /* Spetsiaalne select stiil */
    select.box.single-line {
        height: 44px !important;
        width: 100% !important;
        font-size: 16px !important;
        line-height: 1.2 !important;
        padding: 12px !important;
    }
    
    select[name="status"] {
        height: 44px !important;
        font-size: 16px !important;
        line-height: 1.2 !important;
        padding: 12px !important;
        width: 100%;
    }
    
    /* ===== PEALKIRJAD ===== */
    .t_add_h, .t_add_h2 {
        font-size: 20px !important;
        line-height: 1.3 !important;
        margin: 16px 0 !important;
        text-align: left;
        word-wrap: break-word;
    }
    
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* ===== SÕNUMID ===== */
    .message {
        font-size: 16px;
        padding: 12px 16px;
        line-height: 1.4;
        border-radius: var(--radius);
        margin-bottom: 8px;
        word-wrap: break-word;
        max-width: 100%;
    }
    
    /* ===== KÜLGRIBA SISU ===== */
    .sidebar-box {
        margin-bottom: 16px;
    }
    
    .sidebar-box a {
        font-size: 16px;
        padding: 12px 16px;
        display: block;
        text-decoration: none;
        border-radius: 4px;
        margin-bottom: 2px;
        word-wrap: break-word;
    }
    
    /* ===== ARVERIDADE JA KALKULATSIOONI PLOKK ===== */
    .invoice-rows-container {
        width: 100%;
        margin-bottom: 16px;
    }
    
    .invoice-calculation-block {
        width: 100%;
        background: #f8f9fa;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 16px;
        margin-top: 16px;
        order: 2; /* Paigutub arveridade järele */
    }
    
    .invoice-container {
        width: 100%;
        overflow-x: auto;
        display: flex;
        flex-direction: column;
    }
    
    .invoice-container .invoice-rows {
        order: 1;
        width: 100%;
        overflow-x: auto;
    }
    
    .invoice-container table {
        width: 100%;
        min-width: 600px; /* Minimaalne laius scrollimiseks */
        border-collapse: collapse;
    }
    
    .invoice-container table th,
    .invoice-container table td {
        font-size: 14px !important;
        padding: 8px !important;
        text-align: left;
        border-bottom: 1px solid #eee;
        white-space: nowrap;
    }
    
    /* ===== FAILIDE HALDUS ===== */
    .file-input-wrapper {
        width: 100%;
        margin: 0px 0;
        padding: 0px;
        height: 100%;
    }
    
    input[type="file"] {
        font-size: 16px;
        width: 100%;
        max-width: 100%;
        padding: 12px;
        border: 2px dashed #ddd;
        border-radius: var(--radius);
        background: #f9f9f9;
        word-break: break-all;
    }
    
    #uploadProgress {
        width: 100%;
        height: 12px;
        margin: 12px 0;
        max-width: 100%;
    }
    .serial-wrapper {
        display: flex;
        align-items: left;
        gap: 8px;
        width: 100%;
        margin-bottom: 6px;
        }

        .file-input-wrapper {
        width: 100%;
        margin-bottom: 10px;
        }

        input[type="file"].file-upload-compact {
        width: 100%;
        height: 43px;
        padding: 2px;
        border: 1px solid #d7d7d7;
        border-radius: var(--radius);
        background: #f4f8ec;
        font-size: 24px;
        box-sizing: border-box;
        cursor: pointer;
        }

        .upload-button {
        margin-top: 8px;
        font-size: var(--base-font-size);
        height: 28px;
        padding: 4px 12px;
        align-self: flex-start;        /* ← VÕTI: joonda vasakule */
        justify-content: flex-start;  /* ← täiendav kindlustus */
        text-align: left;
        }
        .form-input {
        align-items: flex-start !important; /* ← Joondab kõik vasakule, sealhulgas nupu */
        }

    .file-list {
        width: 100%;
        max-width: 100%;
    }
    
    .file-list li {
        margin-bottom: 4px;
        word-wrap: break-word;
    }
    
    .file-list li a {
        display: inline-block;
        max-width: calc(100% - 40px); /* Ruumi kustutamise nupule */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 14px;
        padding: 4px 8px;
        background: #f0f0f0;
        border-radius: 4px;
        text-decoration: none;
        margin: 2px;
    }
    
    /* ===== KASUTAJA PAROOLI SISESTUSED ===== */
    .user-pass-inputs {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .user-pass-inputs input {
        width: 100% !important;
        height: 44px;
        font-size: 16px;
        padding: 12px;
        max-width: 100%;
    }
    
    /* ===== VORMIDE SPETSIIFILISED PARANDUSED ===== */
    .form-container {
        width: 100%;
        max-width: 100%;
        padding: 8px;
    }
    
    .form-section {
        margin-bottom: 20px;
        padding: 12px;
        border: 2px solid #ffffff;
        border-radius: var(--radius);
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    /* Valge ümbritsev raam */
    .main-wrapper,
    .content-wrapper,
    .page-wrapper {
        background: #ffffff;
        border: 2px solid #ffffff;
        border-radius: var(--radius);
        padding: 16px;
        margin: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    .d_middle {
        width: 1179px;
        background: #fff;
        text-align: justify;
        padding: 2px;
        font-family: Verdana, Arial;
        font-size: var(--base-font-size);
        color: #58564f;
        line-height: 20px;
        min-height: 300px;
        margin-top: 5px;
    }
    .rounded-corners {
        border: 1px solid #D7D7D7;
        border-radius: 4px;
    }
    
    /* ===== PRINTERI NUPP LEHE LÕPPU ===== */
    .print-button-container {
        width: 100%;
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 999;
        padding: 0 16px;
        box-sizing: border-box;
    }
    
    .print-button,
    button[onclick*="print"],
    .btn-print {
        width: 100%;
        max-width: 300px;
        height: 50px;
        font-size: 18px !important;
        font-weight: bold;
        background: #28a745;
        color: white;
        border: none;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin: 0 auto;
        position: relative;
    }
    
    .print-button:before,
    button[onclick*="print"]:before,
    .btn-print:before {
        content: "🖨️";
        font-size: 20px;
    }
    
    /* Tagab, et lehe sisu ei jää printeri nupu alla */
    .page-content {
        padding-bottom: 80px;
    }
    
    /* ===== TABELID ===== */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    
    /* ===== NAVIGEERIMINE ===== */
    .nav-container {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding: 8px 0;
    }
    
    .nav-item {
        display: inline-block;
        margin-right: 8px;
        white-space: nowrap;
    }
    
    .modal {
        position: fixed;                  /* Paiguta fikseeritult */
        bottom: 10px;                     /* Alumine äär */
        right: 10px;                      /* Parempoolne äär */
        width: 95%;
        max-width: 400px;
        max-height: 80vh;                /* Teeme kõrgemaks */
        overflow-y: auto;
        background: #ffffff;
        border: 2px solid #ffffff;
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        z-index: 9999;
    }
        .incoming-call-modal {
        position: relative; /* Muudetud fixed -> relative stacki jaoks */
        right: 0;
        width: 160px; /* Vähendatud 2 korda: 320px -> 160px */
        height: 180px;
        background: rgba(0, 0, 0, 0.05);
        backdrop-filter: blur(2px);
        border-radius: 15px;
        pointer-events: all;
        animation: modalSlideIn 0.3s ease-out;
        z-index: 9999;
        margin-bottom: 10px; /* 10px ülekate stackis */
    }
    
    /* ===== LIGIPÄÄSETAVUS JA TOUCH ===== */
    /* Suurendab klikkimise ala */
    a, button, input[type="submit"], input[type="button"], .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Parandab kontrastsust */
    input:focus, select:focus, textarea:focus, button:focus {
        outline: 2px solid #007cba;
        outline-offset: 2px;
    }
    
    /* Touch scrolling */
    .scrollable {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
    
    /* ===== PARANDUSED SPETSIIFILISTELE ELEMENTIDELE ===== */
    
    /* Tagab, et pikad tekstid ei lähe üle ääre */
    p, span, div, td, th {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    /* Pildid */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Videod */
    video {
        max-width: 100%;
        height: auto;
    }
    
    /* ===== ANIMATSIOONID JA ÜLEMINEKUD ===== */
    .smooth-transition {
        transition: all 0.3s ease;
    }
    
    /* Hover efektid ainult desktop'is */
    @media (hover: hover) {
        button:hover, .f_button:hover, .action-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
    }
    
    /* ===== UTILITY KLASSID ===== */
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-visible {
        display: block !important;
    }
    
    .full-width-mobile {
        width: 100% !important;
    }
    
    .no-wrap {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .break-word {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    /* ===== Printer icon adjustments ===== */
    img[alt="trüki tööleht"],
    img[title="trüki tööleht"] {
        float: right;
        padding-right: 5px;
        margin-top: 5px;
        cursor: pointer;
    }
        #incoming-calls-container {
        position: fixed;
        bottom: 30px;
        right: 0;
        width: 210px; /* Vähendatud 2 korda: 330px -> 200px */
        max-height: 220px
        pointer-events: none;
        z-index: 9999;
        overflow-y: auto;
        padding: 0;
    }


}
/* Mobile responsiveness */
@media (max-width: 768px) {
    .ui-dialog.client-modal-dialog {
        width: 95% !important;
        max-width: 95% !important;
    }
    
    #add_new2 .form-row {
        flex: 1 1 100%;
    }
    
    #add_new2 .form-row input,
    #add_new2 .form-row select,
    #add_new2 .form-row textarea {
        font-size: 16px;
        padding: 10px;
    }
}

/* Eelnevad tööd nupu stiilid */
#previous_jobs_btn {
    background-color: #17a2b8 !important;
    transition: background-color 0.3s ease;
    position: relative !important;
    padding-right: 25px !important; /* Lisa ruumi badge jaoks */
}

#previous_jobs_btn:hover {
    background-color: #138496 !important;
}

/* Badge (punane mullike) stiilid */
#jobs_count_badge {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background-color: #dc3545 !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    min-width: 18px !important;
    text-align: center !important;
    font-weight: bold !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    z-index: 10 !important;
    line-height: 1.2 !important;
    border: 2px solid white !important;
}

/* Badge hover efekt */
#previous_jobs_btn:hover #jobs_count_badge {
    transform: scale(1.1);
}

/* Animatsioon uute tööde korral */
@keyframes pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    50% { 
        transform: scale(1.15);
        box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
}

.pulse-animation {
    animation: pulse 0.5s ease-in-out;
}


/* Eelnevad tööd nupu stiilid */
#previous_jobs_btn {
    background-color: #17a2b8 !important;
    transition: background-color 0.3s ease;
    position: relative !important;
    padding-right: 25px !important; /* Lisa ruumi badge jaoks */
}

#previous_jobs_btn:hover {
    background-color: #138496 !important;
}

/* Badge (punane mullike) stiilid */
#jobs_count_badge {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background-color: #dc3545 !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    min-width: 18px !important;
    text-align: center !important;
    font-weight: bold !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    z-index: 10 !important;
    line-height: 1.2 !important;
    border: 2px solid white !important;
}

/* Badge hover efekt */
#previous_jobs_btn:hover #jobs_count_badge {
    transform: scale(1.1);
}

/* Animatsioon uute tööde korral */
@keyframes pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    50% { 
        transform: scale(1.15);
        box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
}

.pulse-animation {
    animation: pulse 0.5s ease-in-out;
}





/* ===== JAVASCRIPT LISAMISE JUHISED ===== */
/*
Sidebar swipe funktsiooniks lisada järgmine JavaScript:

// Sidebar toggle
document.addEventListener('DOMContentLoaded', function() {
    const sidebarToggle = document.createElement('button');
    sidebarToggle.className = 'sidebar-toggle';
    sidebarToggle.innerHTML = '☰';
    document.body.appendChild(sidebarToggle);
    
    const sidebar = document.querySelector('.sidebar') || document.createElement('div');
    sidebar.className = 'sidebar';
    
    const overlay = document.createElement('div');
    overlay.className = 'sidebar-overlay';
    document.body.appendChild(overlay);
    
    function toggleSidebar() {
        sidebar.classList.toggle('open');
        overlay.classList.toggle('active');
    }
    
    sidebarToggle.addEventListener('click', toggleSidebar);
    overlay.addEventListener('click', toggleSidebar);
    
    // Swipe gesture
    let startX = 0;
    let currentX = 0;
    let isMoving = false;
    
    document.addEventListener('touchstart', function(e) {
        startX = e.touches[0].clientX;
        isMoving = true;
    });
    
    document.addEventListener('touchmove', function(e) {
        if (!isMoving) return;
        currentX = e.touches[0].clientX;
    });
    
    document.addEventListener('touchend', function(e) {
        if (!isMoving) return;
        isMoving = false;
        
        const diffX = startX - currentX;
        const threshold = 50;
        
        // Swipe vasakult paremale (sulgeb sidebar)
        if (diffX < -threshold && sidebar.classList.contains('open')) {
            toggleSidebar();
        }
        // Swipe paremalt vasakule (avab sidebar)
        else if (diffX > threshold && !sidebar.classList.contains('open')) {
            toggleSidebar();
        }
    });
});
*/




