:root {
    --bs-primary: #0d6efd;
    --bs-dark: #0d1117;
}

body {
    background: #eef0f4;
    font-size: .9rem;
}

.navbar-brand {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img {
    border-radius: 4px;
}

.card {
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    border-color: #d0d4da;
}

.card-header {
    font-weight: 600;
    background: #1c2128;
    color: #fff;
    border-bottom: 0;
}

.card-body {
    background: #fff;
}

.table tbody tr:hover,
table.dataTable tbody tr:hover,
table.dataTable tbody tr.odd:hover,
table.dataTable tbody tr.even:hover {
    background: #b8c5d6 !important;
}

.table th {
    font-weight: 600;
    background: #f0f2f5;
    color: #1c2128;
}

.tab-content {
    background: #e8ecf1;
    border-color: #c8ccd2 !important;
}

.nav-tabs .nav-link {
    font-weight: 600;
    color: #495057;
    border: 1px solid transparent;
}

.nav-tabs .nav-link:hover {
    border-color: #d0d4da #d0d4da transparent;
    isolation: isolate;
}

.nav-tabs .nav-link.active {
    color: #1c2128;
    font-weight: 700;
    background: #e8ecf1;
    border-color: #c8ccd2 #c8ccd2 #e8ecf1;
}

.form-label {
    font-size: .82rem;
    margin-bottom: .2rem;
    color: #1c2128;
}

.form-control, .form-select {
    border-color: #c0c5cc;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(13,110,253,.15);
}

hr {
    border-color: #d0d4da;
    opacity: .6;
}

.badge-pending {
    background: #ffc107;
    color: #000;
}

.badge-active {
    background: #198754;
    color: #fff;
}

.badge-inactive {
    background: #6c757d;
    color: #fff;
}

.badge-rejected {
    background: #dc3545;
    color: #fff;
}

.badge-archived {
    background: #adb5bd;
    color: #fff;
}

.kiosk-btn {
    min-height: 120px;
    font-size: 1.5rem;
    border-radius: 12px;
}

.clock-in-btn {
    background: #198754;
    color: #fff;
}

.clock-out-btn {
    background: #dc3545;
    color: #fff;
}

.dataTables_wrapper {
    font-size: .875rem;
}

.notes-section .card {
    border-left: 3px solid var(--bs-primary);
}

/* ── MYKEL Assistant ───────────────────────────── */

.mykel-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1c2128;
    color: #7BC980;
    border: 2px solid #7BC980;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    transition: transform .15s, box-shadow .15s;
}

.mykel-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0,0,0,.35);
}

.mykel-bubble-icon {
    line-height: 1;
}

.mykel-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    background: #0d1117;
    border-left: 1px solid #2d333b;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: right .25s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,.4);
    color: #e6edf3;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .85rem;
}

.mykel-panel.mykel-open {
    right: 0;
}

.mykel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #161b22;
    border-bottom: 1px solid #2d333b;
    flex-shrink: 0;
}

.mykel-title {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mykel-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
}

.mykel-indicator.mykel-online {
    background: #7BC980;
    box-shadow: 0 0 6px #7BC980;
}

.mykel-indicator.mykel-offline {
    background: #d29922;
    box-shadow: 0 0 6px #d29922;
}

.mykel-subtitle {
    font-size: .75rem;
    color: #8b949e;
    margin-left: 4px;
}

.mykel-header .btn-close {
    margin-left: auto;
    opacity: .6;
}

.mykel-header .btn-close:hover {
    opacity: 1;
}

.mykel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mykel-msg {
    display: flex;
    gap: 8px;
    line-height: 1.5;
}

.mykel-msg-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    color: #7BC980;
    font-weight: 700;
    padding-top: 2px;
}

.mykel-msg-user .mykel-msg-icon {
    color: #58a6ff;
}

.mykel-msg-error .mykel-msg-icon {
    color: #f85149;
}

.mykel-msg-system .mykel-msg-icon {
    color: #8b949e;
}

.mykel-msg-boot .mykel-msg-icon {
    width: 0;
    padding: 0;
}

.mykel-msg-body {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

.mykel-pre {
    background: #161b22;
    border: 1px solid #2d333b;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 4px 0;
    font-size: .82rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    color: #e6edf3;
}

.mykel-suggestions {
    display: block;
    margin-top: 8px;
}

.mykel-example {
    display: inline-block;
    color: #58a6ff;
    text-decoration: none;
    background: #161b22;
    border: 1px solid #2d333b;
    border-radius: 4px;
    padding: 3px 8px;
    margin: 3px 4px 3px 0;
    font-size: .78rem;
    cursor: pointer;
    transition: background .15s;
}

.mykel-example:hover {
    background: #1c2128;
    color: #7BC980;
    border-color: #7BC980;
}

.mykel-input-area {
    padding: 12px 16px;
    border-top: 1px solid #2d333b;
    flex-shrink: 0;
}

.mykel-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #161b22;
    border: 1px solid #2d333b;
    border-radius: 6px;
    padding: 6px 10px;
}

.mykel-input-row:focus-within {
    border-color: #7BC980;
    box-shadow: 0 0 0 1px rgba(123, 201, 128, .15);
}

.mykel-prompt {
    color: #7BC980;
    font-weight: 700;
    flex-shrink: 0;
}

.mykel-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e6edf3;
    font-family: inherit;
    font-size: inherit;
}

.mykel-input::placeholder {
    color: #8b949e;
}

.mykel-send {
    background: transparent;
    border: none;
    color: #7BC980;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
    line-height: 1;
}

.mykel-send:disabled {
    color: #484f58;
    cursor: default;
}

.mykel-status {
    font-size: .72rem;
    color: #8b949e;
    margin-top: 4px;
    min-height: 1.2em;
    transition: color .2s;
}

.mykel-status-thinking {
    color: #7BC980 !important;
    font-weight: 700;
    font-size: .78rem !important;
    letter-spacing: .02em;
}

@keyframes mykel-throb {
    0%, 100% { opacity: 1; text-shadow: 0 0 4px rgba(123, 201, 128, .3); }
    50% { opacity: .85; text-shadow: 0 0 10px rgba(123, 201, 128, .6); }
}

.mykel-status-thinking {
    animation: mykel-throb 1.2s ease-in-out infinite;
}

.mykel-status-dot {
    display: inline-block;
    animation: mykel-bounce 1.4s ease-in-out infinite;
}

.mykel-status-dot:nth-child(2) { animation-delay: .2s; }
.mykel-status-dot:nth-child(3) { animation-delay: .4s; }

@keyframes mykel-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
}

.mykel-thinking .mykel-msg:last-child .mykel-msg-body::after {
    content: ' ▍';
    animation: mykel-cursor 1s step-end infinite;
}

@keyframes mykel-cursor {
    50% { opacity: 0; }
}

@keyframes mykel-blink {
    50% { opacity: 0; }
}

/* Scrollbar styling */
.mykel-messages::-webkit-scrollbar {
    width: 6px;
}

.mykel-messages::-webkit-scrollbar-track {
    background: transparent;
}

.mykel-messages::-webkit-scrollbar-thumb {
    background: #2d333b;
    border-radius: 3px;
}

/* Bootstrap radio button enhancement for dark theme */
.form-check-input[type="radio"] {
    border: 2px solid #6c757d;
    background-color: transparent;
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.15em;
    cursor: pointer;
}
.form-check-input[type="radio"]:checked {
    border-color: #0d6efd;
    background-color: #0d6efd;
}

/* Responsive: full-width on small screens */
@media (max-width: 480px) {
    .mykel-panel {
        width: 100vw;
        right: -100vw;
    }
}
