/* ==========================================================================
   KIRA NEW LAYOUT - nebenbei Style (white cards, light theme)
   Replaces the slide-content centered layout.
   ========================================================================== */


.KIRA {
    background-color: rgb(0, 139, 151);
    color: white !important;
    font-weight: bold !important;
}
/* ---------- Layout Structure ---------- */

.content-wrapper {
    display: flex;
    width: 100%;
    height: calc(100vh - 45px);
    overflow: hidden;
}

.header-logo {
    width: 120px;
    /*border-radius: 50%; */
    /*border: solid white 3px; */
    margin: 10px;
    /*box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);*/
}

/* --- Left Sidebar (empty, reserved) --- */
.sidebar {
    width: 220px;
    min-width: 220px;
    overflow-y: auto;
    position: relative;
    top: 0;
    z-index: 9;
}

/* --- Center Content (empty, reserved) --- */
.content-main {
    min-width: 0;
    flex: 2;
    padding: 0px 0 0 0;
    background-color: rgba(255, 255, 255, 0.6);
    background-size: cover;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

/* --- Center Content: Nextcloud Panel --- */
.content-nextcloud {
    min-width: 0;
    flex: 2;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.6);
    align-items: center;
    justify-content: center;
}

.nextcloud-cards {
    display: flex;
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
    padding: 20px;
    margin: auto;
}

.nextcloud-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    border-radius: 16px;
    background: white;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 250px;
}

.nextcloud-card:hover {
    box-shadow: 0 4px 16px rgba(0, 121, 107, 0.15);
    border-color: #00796b;
    transform: translateY(-2px);
}

.nextcloud-card-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.nextcloud-card-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #00796b;
}

.nextcloud-card-desc {
    font-size: 14px;
    color: #666;
}

/* --- Right Panel (sessions list) --- */
.right-panel {
    width: 320px;
    min-width: 280px;
    overflow-y: auto;
    padding: 0 10px;
    background: #f5f5f5;
    border-left: 1px solid #ddd;
}

.right-panel-header {
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

.right-panel-header h3 {
    margin: 0;
    font-size: 14px;
    color: #505261;
}

/* --- Session List (styled with nebenbei kpi cards) --- */
.new-session-btn {
    display: inline-block;
    text-align: center;
    width: 60%;
    padding: 8px 24px;
    background-color: white;
    color: rgb(0, 139, 151);
    box-shadow: 3px 3px 5px rgba(0,0,0,0.4);
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    text-decoration: none;
}

.new-session-btn:hover {
    background-color: rgba(0, 139, 151, 0.1);
}

.kpi {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    border-radius: 10px;
    text-align: left;
    width: 96%;
    margin: 8px 0;
    padding: 8px 24px;
    max-width: unset;
    background-color: #fff;
    box-shadow: 3px 3px 5px rgba(0,0,0,0.4);
}

.kpi:hover {
    background-color: rgba(0, 139, 151, 0.1);
}

.kpi.active {
    background-color: rgba(0, 139, 151, 0.15);
}

.kpi.active .kpiDet {
    box-shadow: -1px -1px 5px rgba(0, 139, 151, 0.3), 5px 5px 5px rgba(0,0,0,0.1);
}

.kpiDet {
    position: absolute;
    top: 12px;
    left: 10px;
    width: unset;
    height: 16px;
    width: 16px;
    padding: 4px;
    align-items: center;
    border-radius: 50%;
    box-shadow: -1px -1px 5px rgba(255,255,255,0.1), 5px 5px 5px rgba(0,0,0,0.1);
}

.kpiTask {
    position: absolute;
    text-align: center;
    bottom: 5px;
    left: 18px;
    height: 34px;
    width: 34px;
    padding: 0px;
    border-radius: 50%;
    box-shadow: -1px -1px 5px rgba(255,255,255,0.1), 5px 5px 5px rgba(0,0,0,0.1);
    background: rgb(255, 0, 0);
}

.kpiDet.red {
    background: rgba(133, 16, 16, 0.8);
}

.kpiDet.green {
    background: rgba(0, 139, 151, 0.8);
}

.kpiDet.yellow {
    background: rgba(146, 130, 26, 0.8);
}

.kpiDet.teal {
    background: rgb(0, 139, 151);
}

.kpiDet.purple {
    background: #9b59b6;
}

.switch {
    width: 30px;
    height: 30px;
    position: relative;
}

.switch label {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    background: #eaeaea;
    box-shadow: 
        0 3px 5px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -5px 5px rgba(100,100,100,0.1),
        inset 0 5px 5px rgba(255,255,255,0.3);
}

.switch label:after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -8%; 
    right: -8%; 
    bottom: -8%; 
    left: -8%;
    border-radius: inherit;
    background: #ddd; /* Fallback */
    background: linear-gradient(#ccc, #fff);
    box-shadow: 
        inset 0 2px 1px rgba(0,0,0,0.15),
        0 2px 5px rgba(200,200,200,0.1);
}

.switch label:before {
    content: "";
    position: absolute;
    width: 50%;
    height: 50%; 
    left: 25%;
    top: 25%;
    border-radius: inherit;
    background: #969696; /* Fallback */
    background: radial-gradient(40% 35%, #ccc, #969696 60%);
    box-shadow:
        inset 0 2px 4px 1px rgba(0,0,0,0.3),
        0 1px 0 rgba(255,255,255,1),
        inset 0 1px 0 white;
}

.switch input {
    visibility: hidden;
    display: none;
}

.switch input:checked ~ label { /* Button */
	background: #e5e5e5; /* Fallback */
    background: linear-gradient(#dedede, #fdfdfd);
}

.switch input:checked ~ label:before { /* LED */
    background: #25d025; /* Fallback */
    background: radial-gradient(40% 35%, #5aef5a, #25d025 60%);
    box-shadow:
        inset 0 3px 5px 1px rgba(0,0,0,0.1),
        0 1px 0 rgba(255,255,255,0.4),
        0 0 10px 2px rgba(0, 210, 0, 0.5);
}


.switch-wrapper {
    padding:5px;
    margin: 2px 5px;
}

.switch-wrapper .input {
    visibility: hidden;
    display: none;
}

.switch-wrapper .toggle {
    position: relative;
    display: block;
    width: 38.4px;
    height: 19.2px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transform: translate3d(0, 0, 0);
}

.switch-wrapper .toggle:before {
    content: "";
    position: relative;
    top: 2.9px;
    left: 2.9px;
    width: 32.6px;
    height: 13.4px;
    display: block;
    background: #9A9999;
    border-radius: 7.7px;
    transition: background 0.2s ease;
}

.switch-wrapper .toggle span {
    position: absolute;
    top: 0;
    left: 0;
    width: 19.2px;
    height: 19.2px;
    display: block;
    background: white;
    border-radius: 9.6px;
    box-shadow: 0 3px 8px rgba(0, 139, 151, 0.5);
    transition: all 0.2s ease;
}

.switch-wrapper .toggle span:before {
    content: "";
    position: absolute;
    display: block;
    margin: -17.3px;
    width: 53.8px;
    height: 53.8px;
    background: rgba(0, 139, 151, 0.5);
    border-radius: 50%;
    transform: scale(0);
    opacity: 1;
    pointer-events: none;
}

.switch-wrapper .input:checked + .toggle:before {
    background: rgba(0, 139, 151, 0.7);
}

.switch-wrapper .input:checked + .toggle span {
    background: rgb(0, 139, 151);
    transform: translateX(22.4px);
    transition: all 0.2s cubic-bezier(0.8, 0.4, 0.3, 1.25), background 0.15s ease;
    box-shadow: 0 3px 8px rgba(0, 139, 151,0.2);
}

.switch-wrapper .input:checked + .toggle span:before {
    transform: scale(1);
    opacity: 0;
    transition: all 0.4s ease;
}

.single_entry_main {
    position: relative;
    max-width: 100%;
    float: left;
    margin: 5px;
    padding: 10px;
}

.ff10 {
    font-size: 10px;
    font-weight: bold;
}

.ff12 {
    font-size: 12px;
    font-weight: bold;
}

.ff14 {
    font-size: 14px;
    font-weight: bold;
}

.ff16 {
    font-size: 16px;
    font-weight: bold;
    color: #505261;
}

.ff18 {
    font-size: 18px;
    font-weight: bold;
    color: #008B97;
}

.fn10 {
    font-size: 10px;
    font-weight: normal;
    color: #777;
}

.fn12 {
    font-size: 12px;
    font-weight: normal;
}

.nebenbeiCol {
    color: #008B97;
}

/* Session list items */
.session-list {
    padding: 10px 5px 20px 0;
}

.session-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #505261;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 3px 3px 5px rgba(0,0,0,0.1);
    background-color: #fff;
    border-radius: 5px;
    margin: 2px 8px;
    cursor: pointer;
}

.session-item:hover {
    background-color: rgba(0, 139, 151, 0.05);
}

.session-del {
    margin-left: auto;
    color: #999;
    font-size: 11px;
    text-decoration: none;
}

.session-del:hover {
    color: #ff0000;
}

.delete-link {
    color: #999;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
}

.delete-link:hover {
    color: #ff0000;
}

/* --- Wizard Menu (tab buttons) --- */
.wizard-menu {
    position: relative;
    display: flex;
    width: auto;
    margin: 20px 0 0 0;
    padding: 0 8px;
}

.wizard {
    display: inline-block;
    vertical-align: middle;
    margin: 5px 5px;
}

.wizard button {
    background-color: transparent;
    text-align: right;
    border: none;
    border-radius: 2px;
    padding: 8px 15px 8px 5px;
    width: auto;
    height: auto;
    font-size: 13px;
    color: #505261;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wizard button.active {
    font-weight: bold;
    border-bottom: rgb(0, 139, 151) solid 3px;
    color: rgb(0, 139, 151);
}

.wizard button:hover {
    font-weight: bold;
    background-color: rgba(0,0,0,0.05);
}

.wizard button img.mobile {
    width: 20px;
    margin-right: 5px;
}

/* --- Tab Content Placeholder --- */
.pageTabContent {
    display: none;
    padding: 10px 5px;
    margin: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
    border-top: none;
}

.pageTabContent.active {
    display: block;
    height: auto;
}

#output {
    padding: 10px 5px;
    margin: 0 8px;
    min-height: 200px;
    color: #ccc;
    text-align: center;
    font-size: 12px;
}

/* --- Header Styles ---------- */

.button_menu {
    position: fixed;
    width: 100%;
    top: -2px;
    left: 0px;
    color: #505261;
    border-bottom: none;
    z-index: 120;
    background: transparent;
    box-shadow: unset;
}

.button_menu .Logo {
    display: flex;
    align-items: center;
    /*justify-content: space-between;*/
    height: 47px;
    background-color: rgba(255, 255, 255, 0.8);
}

.button_menu .nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 0 0 10px;
}

.button_menu .nav li a {
    position: relative;
    display: block;
    cursor: pointer;
    padding: 5px 15px !important;
    font-size: 12px;
    color: #505261;
    background: transparent;
    font-weight: 300 !important;
    text-decoration: none !important;
}

.button_menu .nav li a:hover {
    background: rgba(0, 139, 151, 0.08);
    font-weight: bold !important;
    color: #008B97;
}

.button_menu .nav li a.active {
    border-bottom: 2px #008B97 solid;
    border-radius: 0;
    font-weight: bold !important;
    background: rgba(0, 139, 151, 0.05);
    color: #008B97;
}

.button_start {
    position: fixed;
    width: 100%;
    top: 47px;
    color: #505261;
    z-index: 80;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    box-shadow: -1px -1px 5px rgba(255,255,255,0.1), 5px 5px 5px rgba(0,0,0,0.1);
}

.headline {
    position: fixed;
    font-size: 14px;
    text-align: right;
    letter-spacing: 0;
    right: 20px;
    top: 0px;
    z-index: 100;
    padding-top: 3px;
}

/* ---------- Loader ---------- */

#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    display: none;
}

#loader {
    display: block;
    position: relative;
    left: 50%;
    top: 50%;
    width: 150px;
    height: 150px;
    margin: -75px 0 0 -75px;
    border: 3px solid transparent;
    border-top-color: #008B97;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-section {
    position: absolute;
    width: 50%;
    height: 100%;
    top: 0;
    background-color: #fff;
    z-index: -1;
}

.loader-section.section-left {
    left: 0;
}

.loader-section.section-right {
    right: 0;
}

/* ---------- Utility ---------- */

.rFloat {
    float: right;
}

.noMarge {
    margin: 0;
}

.noWrap {
    white-space: nowrap;
}

.center {
    text-align: center;
    vertical-align: middle;
}

/* ---------- Message ---------- */

.message {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 48px;
    font-size: 14px;
    letter-spacing: 0;
    padding: 0px 10px;
    top: 0;
    z-index: 120;
    color: white;
    box-shadow: -1px -1px 5px rgba(255,255,255,0.1), 5px 5px 5px rgba(0,0,0,0.1);
}

.message-success {
    background: rgb(0, 139, 151);
}

.message-warning {
    background: rgb(225, 160, 9);
}

.message-error {
    background: rgb(255, 0, 0);
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    .right-panel {
        width: 100%;
        min-width: unset;
        border-left: none;
        border-top: 1px solid #ddd;
        max-height: 50vh;
    }
    .sidebar {
        display: none;
    }
    .button_start {
        left: 0;
        width: 100%;
    }
    .content-main {
        height: auto;
        overflow-y: auto;
    }
}

/* --- Session Inline Layout --- */

.session-layout {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    min-height: 0;
    border-radius: 10px;
}

.dialog-content {
    display: flex;
    height: calc(100% - 70px);
}

.diktat-content {
    display: flex;
    height: calc(100% - 70px);
}

.chat-panel {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    padding: 0;
    max-height: calc(100vh - 50px);
    background: #fff;
    border-right: 1px solid #eee;
    position: relative;
}

.chat-panel-header {
    flex: 0 0 auto;
    padding: 0 15px 0 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
    font-size: 16px;
    font-weight: bold;
    color: #505261;
    background: white; /*rgba(0, 139, 151, 0.2);*/
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-panel-header .session-id {
    font-size: 12px;
    color: #008b97;
    font-weight: normal;
}

.chat-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.chat-close {
    cursor: pointer;
    color: white;
    font-size: 18px;
    padding: 0 4px;
    transition: color 0.2s;
}

.chat-close:hover {
    color: #ff0000;
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    height: calc(100vh - 162px);
    padding: 15px;
    min-height: 0;
}

.message-line {
    padding: 10px 14px;
    margin: 8px 0;
    border-radius: 8px;
    max-width: 90%;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
    overflow-y: auto;
}

.message-agent {
    background: #f5f5f5;
    align-self: flex-start;
    margin-right: auto;
    border: 1px solid #eee;
}

.message-user {
    background: rgba(0, 139, 151, 0.08);
    align-self: flex-end;
    margin-left: auto;
    text-align: right;
    border: 1px solid rgba(0, 139, 151, 0.2);
}

.message-role {
    font-size: 11px;
    font-weight: bold;
    color: #008B97;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-role .agent-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 139, 151, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #008B97;
}

.message-role .user-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 139, 151, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #008B97;
}

.message-empty {
    color: #ccc;
    text-align: center;
    font-size: 12px;
    padding: 40px;
}

/* File Panel */
.file-panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ===== DETAILS-PANEL ===== */
#panel-wrapper {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

#details-panel {
    flex: 0 0 40%;
    overflow-y: auto;
    border-bottom: 1px solid #eee;
}

.details-panel-header {
    padding: 8px 12px;
    background: #f5f5f5;
    font-weight: bold;
    font-size: 13px;
    color: #555;
}

.details-table {
    display: grid;
    grid-template-columns: 120px 1fr;
    padding: 4px 12px;
}

.details-table .row {
    display: contents;
    line-height: 1.5em;
}

.details-table .row .label {
    font-weight: bold;
    font-size: 0.7em;
    color: #008B97;
    text-align: right;
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
}

.details-table .row > span:nth-child(2) {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
}

.section-title {
    padding: 12px 12px 4px;
    font-weight: bold;
    font-size: 12px;
    color: #008B97;
}

.details-empty {
    color: #999;
    text-align: center;
    padding: 30px;
    font-size: 13px;
}

.details-error {
    color: #cc3333;
    text-align: center;
    padding: 30px;
    font-size: 13px;
}

.loading {
    color: #999;
    text-align: center;
    padding: 30px;
    font-size: 13px;
}

.file-panel-header {
    font-size: 13px;
    font-weight: bold;
    color: #505261;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-panel-header .folder-icon {
    font-size: 15px;
}

.breadcrumb {
    padding: 6px 0;
    margin-bottom: 8px;
    font-size: 12px;
    color: #008B97;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb .breadcrumb-item {
    cursor: pointer;
    color: #008B97;
    text-decoration: none;
    white-space: nowrap;
}

.breadcrumb .breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: #ccc;
    margin: 0 4px;
    user-select: none;
}

.search-box {
    width: calc(100% - 20px);
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    margin: 8px 0;
    background: #fff;
    transition: border-color 0.2s;
}

.search-box:focus {
    outline: none;
    border-color: #008B97;
}

.file-tree {
    list-style: none;
    overflow-y: auto;
    padding-left: 0;
    font-size: 12px;
}

.file-tree ul {
    list-style: none;
    padding-left: 16px;
    display: none;
}

.file-tree ul.expanded {
    display: block;
}

.file-item {
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    transition: background-color 0.15s;
}

.file-item:hover {
    background: rgba(0,139,151,0.08);
}

.file-item.folder {
    color: #505261;
    font-weight: bold;
}

.file-item.folder::before {
    content: "📁 ";
    margin-right: 4px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.file-item.folder.expanded::before {
    content: "📂 ";
}

.file-item.file {
    color: #777;
}

.file-item.file::before {
    content: "📄 ";
    margin-right: 4px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.file-item.file a {
    color: inherit;
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item.file a:hover {
    color: #008B97;
    text-decoration: underline;
}

.file-item .file-size {
    color: #aaa;
    font-size: 10px;
    margin-left: 8px;
    flex-shrink: 0;
    margin-right: 4px;
}

.file-item .file-modified {
    color: #aaa;
    font-size: 10px;
    margin-left: 8px;
    flex-shrink: 0;
}

.file-item .toggle-icon {
    color: #ccc;
    font-size: 10px;
    margin-right: 2px;
    flex-shrink: 0;
    transition: transform 0.15s;
    width: 12px;
    text-align: center;
}

.file-item .toggle-icon.expanded {
    transform: rotate(90deg);
}

.file-item .toggle-icon:hover {
    color: #008B97;
}

.file-panel-empty {
    color: #ccc;
    text-align: center;
    font-size: 12px;
    padding: 30px;
}

/* ===== Chat Input ===== */
.chat-input-container {
    flex: 0 0 auto;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background: #fff;
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.chat-input-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(0, 139, 151, 0.3);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #008B97;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #008B97;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: #006d76;
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ===== Akten Popup ===== */
.akten-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.akten-popup-overlay-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.akten-popup-modal {
    position: relative;
    z-index: 1001;
    width: 90vw;
    max-width: 900px;
    max-height: 90vh;
    height: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.akten-popup-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.akten-popup-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.akten-popup-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.akten-popup-close:hover {
    color: #333;
    background: #f0f0f0;
}

.akten-popup-search {
    padding: 20px 24px;
    flex-shrink: 0;
}

.akten-search-form {
    width: 100%;
}

.akten-search-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.akten-search-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.akten-search-field input,
.akten-search-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.akten-search-field input:focus,
.akten-search-field select:focus {
    border-color: #008B97;
}

.akten-search-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-bottom: 4px;
}

.akten-search-empty {
    display: none;
}

/* Ergebnis-Tabelle */
.akten-popup-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
    min-height: 0;
    max-height: 40%;
}

.akten-results-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.akten-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.akten-results-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.akten-results-table th {
    background: #f8f8f8;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #eee;
}

.akten-results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.akten-results-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.akten-results-table tbody tr:hover {
    background: #f8fafb;
}

.akten-results-table tbody tr.selected {
    background: rgba(0, 139, 151, 0.08);
    border-left: 3px solid #008B97;
}

.akten-results-table td:first-child {
    width: 40px;
    text-align: center;
}

.akten-results-table td:nth-child(2) {
    font-weight: 600;
    color: #008B97;
}

.akten-results-table td:nth-child(4) {
    color: #999;
    font-size: 13px;
}

.akten-results-table td:nth-child(5) {
    color: #999;
    font-size: 13px;
}

/* Akten Footer */
.akten-popup-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.akten-selected-info {
    font-size: 14px;
    color: #555;
}

/* Akten Buttons */
.akten-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.akten-btn-primary {
    background: #008B97;
    color: white;
}

.akten-btn-primary:hover {
    background: #006d76;
}

.akten-btn-reset {
    background: #f0f0f0;
    color: #555;
}

.akten-btn-reset:hover {
    background: #e0e0e0;
}

.akten-btn-success:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
}

.akten-btn-success {
    background: #28a745;
    color: white;
}

.akten-btn-success:hover:not(:disabled) {
    background: #218838;
}


    .chat-views {
        margin: 0;
        display: inline-flex;
        gap: 0;
    }
    .view-btn {
        padding: 10px 5px;
        width: 200px;
        font-size: 14px;
        font-weight: bold;
        border: 0.5px solid #008B97;
        background: transparent;
        color: #008B97;
        cursor: pointer;
        margin: 0;
        border-radius: 5px 5px 0 0;
    }

    .view-btn.active {
        background: rgba(0, 139, 151, 0.7) !important;
        color: #fff !important;
    }
    .view-btn:hover {
        background: rgba(0, 139, 151, 0.15);
    }
    .view-btn.active:hover {
        background: rgba(0, 139, 151, 0.3);
    }
    .chat-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow: hidden;
        background: transparent;
    }
    .dictat-container {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow: hidden;
        border: 1px solid #333;
        background: rgba(0, 139, 151, 0.1);
        margin: 3px;
        border-radius: 6px;
    }

    .dictat-content {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 36px;
        overflow-y: auto;
        height: calc(10% - 130px);  
        overflow-y: auto;
        padding: 12px 16px; 
        color: #505261;
        font-size: 12px;
        font-weight: normal;
        line-height: 1.6;
    }
    .dictat-status {
        position: absolute;
        left: 0;
        right: 0;
        bottom: -4px;
        height: 36px;
        line-height: 36px;
        padding: 0 5px;
        font-size: 10px;
        color: rgba(0, 139, 151, 1);
        background: rgba(0, 139, 151, 0.3);
    }
    .dictat-content .error {
        color: #ff6b6b;
    }

.dictat-panel {
    width:65%;
    min-width:280px;
    
    border-left:1px solid #eee;
    display:flex;
    flex-direction:column;
    flex:none
}

/* --- New DictatView layout overrides --- */
#diktat-view .dictat-container {
    display: block;
    position: relative;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

#diktat-view #dictat-content {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
}

#diktat-view .dictat-status {
    position: relative;
}

/* ===== Task Module ===== */
.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    background-color: white;
}

.view-btn[data-view="newtask"] {
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(0, 139, 151, 0.2);
    border: none;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
}

.view-btn[data-view="filter"] {
    font-size: 12px;
    width: 140px;
    margin: auto;
}

.tasks {
    overflow-y: auto;
    height: calc(100vh - 150px); 
    position: relative
}

.calendar {
    overflow-y: auto;
    height: calc(100vh - 150px); 
    position: relative
}

.cal-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 3px;
    background-color: rgba(0, 139, 151, 0.2);
    transition: box-shadow 0.2s;

}

.talk_input {
    background-color: white;
    width: 100%;
    color:rgba(0, 139, 151, 1);
    font-size: 12px !important;
    line-height: 2em;
    border-radius: 10px;
    padding: 5px 12px;
}

.cal-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    padding: 10px 15px;
}

.cal-datum {
    font-weight: 600;
    font-size: 0.8em;
    color: #505261;
}

.cal-title {
    font-weight: 400;
    font-size: 1em;
    color: rgba(0, 139, 151, 0.9);
}

.cal-memo {
    font-weight: 400;
    font-size: 0.7em;
    color: #505261;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex:1;
    overflow-y:auto;
    height:100%
}

.task-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 3px;
    background-color: transparent;
    transition: box-shadow 0.2s;
}

.task-item-manual {
    background-color: rgba(0, 139, 151, 0.15);
    border-color: rgba(0, 139, 151, 0.3);
    opacity: 0.7;
}

.task-item-manual:hover {
    box-shadow: 0 2px 6px rgba(0, 139, 151, 0.2);
}

.task-itemm-mark {
   padding: 42px 14px;
   display:flex;
   flex-direction:column;
   gap:2px;
   text-align: center;
}

.task-send-column {
    padding:4px;
    font-size:10px;
    /* white-space:pre-wrap; */
    min-width:120px;
    max-height:150px;
    align-self:stretch;
}

.task-sign-column {
    /*border-right:2px solid rgba(0,139,151,0.3);*/
    padding: 5px 8px;
    font-size:12px;
    /* white-space:pre-wrap; */
    min-width:120px;
    max-height:350px;
    overflow-y:auto;
    align-self:stretch;
}

.task-header {
    display:grid;
    grid-template-columns:1fr 4fr;
    gap:4px;
    align-items:stretch;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.task-header:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.task-header.red{
    background-color: rgba(133, 16, 16, 0.8);
}

.task-header.green {
    background-color: rgba(0, 139, 151, 0.8);
}

.task-header.yellow {
    background-color: rgba(148, 135, 51, 0.8);
}

.task-title {
    font-weight: 600;
    font-size: 1em;
    color: white;
}

.task-badges {
    display: grid;
    gap: 6px;
}

.btn.btn-link.adv {
    border: 2px solid #008B97;
    border-radius: 50%;
    background-color: white;
    transition: 0.2s;
}

.btn.btn-link.adv:hover {
    border: 2px solid #008B97;
    border-radius: 50%;
    background-color: rgba(0, 139, 151, 0.8);

}

.btn.btn-link.adv img {
    width: 24px;
    height: 24px;
    padding: 3px;
}

.btn.btn-link.adv img:hover {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #333;
    background: rgba(0, 139, 151, 0.25);
    border: 1px solid rgba(0, 139, 151, 0.4);
    cursor: pointer;
    transition: background 0.2s;
}

.action-badge:hover {
    color: #fff;
    background: rgba(0, 139, 151, 0.45);
}

.diktat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    background: rgba(133, 16, 16, 0.8);
    border: 1px solid rgba(133, 16, 16, 0.9);
    cursor: pointer;
    transition: background 0.2s;
}

.diktat-badge:hover {
    color: #333;
    background: rgba(133, 16, 16, 0.45);
}

.diktat-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    cursor: pointer;
}

.task-body {
    display:grid;
    grid-template-columns:10fr 2fr;
    gap:4px;
    align-items:stretch;
}

.task-row {
    font-size: 12px;
    color: #444;
}

.task-label {
    font-weight: 600;
    color: #666;
    white-space: nowrap;
    margin-right: 4px;
}

.task-status-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 11px;
    background: rgba(0, 139, 151, 0.1);
    color: #008B97;
}

.task-replik {
    border: 1px solid #008B97;
    border-radius: 5px;
}

.taskAction label{
    text-align: center; 
    padding: 3px; 
    width: 32px; 
    height:32px; 
    border-radius: 50%; 
    cursor: pointer;
}
/* Dialog Style  */

.dialogArea {
    padding: 10px;
    border-radius: 12px;
    /*background-color: #f4f4f4;*/
    margin: 0;
    width: 100%;
    min-height: 240px;
    height: 80vh;
    overflow-y:  auto;
}

.dialogResponse {
    position: relative;
    margin: 25px 5px 0 5px;
    padding: 5px;

}
.dialog textarea {
    background-color: white;
    width:100%;
    border-radius: 10px;
    border: 1px solid #999999;
    padding: 10px 40px 10px 10px;
    overflow-y: auto;
    resize: none;
    box-shadow: -1px -1px 5px rgba(255,255,255,0.1), 5px 5px 5px rgba(0,0,0,0.1);
}
.dialog .button {
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 12px;
    /*height: 100%;*/
    margin: auto;
}

.dialog .mailInit {
    width: 95%;
    padding:10px;
    float: right;
    background-color: rgba(133, 16, 16, 0.1);
    border: #999999 1px solid;
    border-radius: 0;
    margin: 0 0 0 5%;
}

.dialog .income {
    width: 90%;
    padding:10px 10px 15px 10px;
    float: left;
    background-color: white;
    border: #999999 1px solid;
    border-radius: 0 20px 20px 20px;
    margin: 0 0 10px 0;
}

.dialog .response {
    width: 90%;
    padding:10px 10px 15px 10px;
    float: right;
    color: inherit;
    background: rgba(0, 139, 151, 0.3);
    border-radius: 20px 0 20px 20px;
    border: #999999 1px solid;
    margin: 0 0 10px 0;
}

.dialog .attach {
    margin: 10px 0;
}

.dialog .timestamp {
    clear: left;
    float: right;
    font-size: 10px;
    margin: 0 5px 10px 0;
}
tr.clickable {
    cursor: pointer;
}
tr.clickable:hover {
    background-color: rgba(0, 139, 151, 0.1);
}
