:root {
    --bg-color: #121212;
    --surface-color: #1E1E1E;
    --primary-green: #5A7256; 
    --primary-hover: #6B8567;
    --text-main: #FFFFFF;
    --text-secondary: #A0A0A0;
    --input-bg: #2A2A2A;
    --border-color: #333333;
    --error-color: #FF5252;
    --disabled-btn: #4D4D4D; 
    --disabled-text: #999999;
    /* Logo ↔ card ↔ language row (login / registration-details) */
    --master-auth-stack-gap: 24px;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Inter', sans-serif; 
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* For Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.lang-switcher { position: absolute; top: 20px; right: 20px; display: flex; gap: 8px; }
/* Master login: languages under the card (see login.blade.php) */
.lang-switcher--below-form {
    position: static;
    margin-top: var(--master-auth-stack-gap);
    justify-content: center;
    flex-wrap: wrap;
}
.lang-btn {
    background: none; border: 1px solid var(--border-color);
    color: var(--text-secondary); padding: 6px 12px; border-radius: 6px;
    cursor: pointer; font-size: 11px; transition: 0.3s; font-weight: 600;
}
.lang-btn.active { border-color: var(--primary-green); color: var(--text-main); background: rgba(90, 114, 86, 0.1); }

.login-container { width: 100%; max-width: 400px; padding: 20px; text-align: center; }
/* fit-content + horizontal auto: true center vs full-width block + text-align (letter-spacing + trailing narrow "i" looked off-center) */
.logo {
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 6px;
    color: var(--primary-green);
    margin-bottom: var(--master-auth-stack-gap);
    margin-left: auto;
    margin-right: auto;
    text-transform: none;
    text-align: center;
    width: fit-content;
    max-width: 100%;
    /* Positive = shift right (negative was wrong direction for your eye) */
    transform: translateX(0.1em);
}
.card { background-color: var(--surface-color); padding: 32px; border-radius: 20px; border: 1px solid var(--border-color); min-height: 420px; display: flex; flex-direction: column; }

h1 { font-size: 22px; font-weight: 500; margin-bottom: 8px; letter-spacing: -0.5px; }
.subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 30px; }

.form-group { text-align: left; margin-bottom: 24px; }
/* .label-row удален из HTML, стили можно оставить или удалить - они не мешают */
.label-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
label { font-size: 11px; color: var(--text-secondary); text-transform: none; letter-spacing: 1px; }

.input-wrapper {
    display: flex; align-items: center; background-color: var(--input-bg);
    border: 1px solid var(--border-color); border-radius: 12px;
    padding: 16px; transition: 0.3s;
}
.input-wrapper:focus-within { border-color: var(--primary-green); }

input {
    background: transparent; border: none; color: var(--text-main);
    font-size: 18px; width: 100%; outline: none; letter-spacing: 1px;
    font-weight: 500;
}

.prefix { color: var(--text-main); margin-right: 12px; font-weight: 600; border-right: 1px solid var(--border-color); padding-right: 12px; }

.consent-wrapper { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; text-align: left; cursor: pointer; }
.custom-checkbox {
    width: 20px; height: 20px; border: 2px solid var(--border-color);
    border-radius: 6px; flex-shrink: 0; position: relative; transition: 0.2s; margin-top: 2px;
}
#consent-check { display: none; }
#consent-check:checked + .custom-checkbox { background-color: var(--primary-green); border-color: var(--primary-green); }
#consent-check:checked + .custom-checkbox::after { content: '✓'; position: absolute; color: white; font-size: 14px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.consent-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.consent-text a { color: var(--primary-green); text-decoration: none; font-weight: 500; }

.main-btn {
    width: 100%; padding: 18px; background-color: var(--primary-green);
    border: none; border-radius: 12px; color: white;
    font-size: 16px; font-weight: 600; cursor: pointer; 
    transition: transform 0.2s ease, background-color 0.3s ease;
}
.main-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: scale(1.02);
}
.main-btn:active:not(:disabled) {
    transform: scale(0.98);
}
.main-btn:disabled { background-color: var(--disabled-btn); color: var(--disabled-text); cursor: not-allowed; }

#otp-section { display: none; }
.otp-input { text-align: center; letter-spacing: 15px; font-size: 24px; font-weight: 700; color: var(--primary-green); }

.otp-center-group { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 15px; 
    margin-top: 15px; 
}

.timer-text { font-size: 13px; color: var(--text-secondary); }

#otp-error { 
    color: var(--error-color); font-size: 13px; 
    text-align: center; display: none; width: 100%; 
}

.footer-links { margin-top: auto; padding-top: 24px; font-size: 14px; color: var(--text-secondary); }
.footer-links a { color: var(--primary-green); text-decoration: none; font-weight: 600; }

/* Master login only: registration block — vertical rhythm; link stays text, not a button */
body.auth-login-page .login-container .card {
    padding-top: 32px;
    padding-bottom: 32px;
}

body.auth-login-page .login-container .footer-links {
    margin-top: 28px;
    padding-top: 28px;
    padding-bottom: 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

body.auth-login-page .login-container .footer-links #no-profile {
    display: block;
    line-height: 1.45;
    margin: 0;
}

body.auth-login-page .login-container .footer-links #register-link {
    display: inline;
    width: auto;
    padding: 0;
    margin: 4px 0 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    min-height: 0;
    color: var(--primary-green);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

body.auth-login-page .login-container .footer-links #register-link:hover {
    color: #c8e6c0;
}

.error-msg a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
}
.error-msg a:hover {
    text-decoration: underline;
}
/* --- DASHBOARD EXTENSIONS --- */

/* Новое поведение для страниц личного кабинета */
.dashboard-body {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: stretch;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar { width: 260px; background-color: var(--surface-color); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; padding: 24px 24px 15px 24px; flex-shrink: 0; transition: width 0.3s ease, transform 0.3s ease; position: relative; z-index: 1100; }

body.sidebar-is-collapsed .sidebar,
html.sidebar-is-collapsed .sidebar,
.sidebar.collapsed { width: 70px; padding: 24px 10px; }
.sidebar-logo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; white-space: nowrap; flex-shrink: 0; min-height: 40px; width: 100%; position: relative; gap: 10px; }

.logo-text-wrapper {
    transition: 0.3s;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.logo-text {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 4px;
    color: var(--primary-green);
    text-transform: none;
    white-space: nowrap;
}

.sidebar-logo img {
    max-height: 40px;
    max-width: 100%;
}

.hamburger-btn { background: #252525; border: 1px solid #333; color: #fff; border-radius: 8px; width: 32px; height: 32px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; flex-shrink: 0; position: static; }
.hamburger-btn:hover { background: #333; }

.close-sidebar-btn { display: none; background: transparent; border: none; color: #888; font-size: 20px; cursor: pointer; transition: 0.2s; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 8px; position: static; }
.close-sidebar-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }

html.sidebar-is-collapsed .sidebar .logo-text-wrapper,
body.sidebar-is-collapsed .sidebar .logo-text-wrapper,
.sidebar.collapsed .logo-text-wrapper { opacity: 0; width: 0; pointer-events: none; flex-grow: 0; }

html.sidebar-is-collapsed .sidebar .sidebar-logo,
body.sidebar-is-collapsed .sidebar .sidebar-logo,
.sidebar.collapsed .sidebar-logo { justify-content: center; margin-bottom: 24px; gap: 0; }

html.sidebar-is-collapsed .sidebar .sidebar-nav,
body.sidebar-is-collapsed .sidebar .sidebar-nav,
.sidebar.collapsed .sidebar-nav { overflow: visible; }

html.sidebar-is-collapsed .sidebar .hamburger-btn,
body.sidebar-is-collapsed .sidebar .hamburger-btn,
.sidebar.collapsed .hamburger-btn { position: static; margin: 0; }

.sidebar-nav { flex-grow: 1; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }

.nav-group { margin-bottom: 8px; }
.nav-header { 
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase; 
    letter-spacing: 2px; 
    margin: 18px 0 6px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    white-space: nowrap;
}
.nav-header::before,
.nav-header::after {
    content: '';
    height: 1px;
    background: #333;
    flex: 1;
    opacity: 0.6;
}

html.sidebar-is-collapsed .sidebar .nav-header,
body.sidebar-is-collapsed .sidebar .nav-header,
.sidebar.collapsed .nav-header { opacity: 0; height: 0; margin: 0; overflow: hidden; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: 0.3s;
    white-space: nowrap;
    border-radius: 10px;
    margin-bottom: 4px;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(90, 114, 86, 0.1);
    color: var(--text-main);
}

.nav-item.active {
    color: var(--primary-green);
    font-weight: 600;
}

.nav-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}
.nav-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor; /* Inherits text color */
}
.nav-text { transition: opacity 0.2s; white-space: nowrap; }

html.sidebar-is-collapsed .sidebar .nav-text,
body.sidebar-is-collapsed .sidebar .nav-text,
.sidebar.collapsed .nav-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }

html.sidebar-is-collapsed .sidebar .nav-item,
body.sidebar-is-collapsed .sidebar .nav-item,
.sidebar.collapsed .nav-item { padding: 12px 0; justify-content: center; gap: 0; position: relative; }

html.sidebar-is-collapsed .sidebar .nav-item:hover::after,
body.sidebar-is-collapsed .sidebar .nav-item:hover::after,
.sidebar.collapsed .nav-item:hover::after {
    content: attr(data-sidebar-tooltip);
    position: absolute;
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.1s ease forwards;
}
@keyframes tooltipFadeIn {
    to { opacity: 1; left: calc(100% + 15px); }
}

/* Sidebar Badge */
.sidebar-badge {
    margin-left: auto;
    background-color: var(--error-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}
html.sidebar-is-collapsed .sidebar .sidebar-badge,
body.sidebar-is-collapsed .sidebar .sidebar-badge,
.sidebar.collapsed .sidebar-badge { display: none !important; }

.sidebar-footer { padding: 20px 0 0 0; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; transition: 0.3s; margin-top: auto; }

html.sidebar-is-collapsed .sidebar .sidebar-footer,
body.sidebar-is-collapsed .sidebar .sidebar-footer,
.sidebar.collapsed .sidebar-footer { opacity: 0; pointer-events: none; padding: 0; height: 0; overflow: hidden; border: none; }
.sidebar-plan-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 15px; width: 100%; margin-bottom: 20px; }
.plan-info { display: flex; justify-content: space-between; font-size: 12px; color: #ccc; margin-bottom: 8px; }
.progress-bar { height: 4px; background: #333; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; width: 80%; background: var(--primary-green); }

.lang-switcher-sidebar { display: flex; justify-content: center; gap: 8px; margin-bottom: 15px; }
.lang-switcher-sidebar .lang-btn { background: none; border: 1px solid var(--border-color); color: var(--text-secondary); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 11px; transition: 0.3s; font-weight: 600; }
.lang-switcher-sidebar .lang-btn.active { border-color: var(--primary-green); color: var(--text-main); background: rgba(90, 114, 86, 0.1); }

/* Logout in sidebar: text by default, button-like on hover (like in local) */
#txt-logout {
    background: none;
    transition: background-color 0.2s ease, border-radius 0.2s ease;
    border-radius: 10px;
}
#txt-logout:hover {
    background-color: rgba(255, 82, 82, 0.12);
}

.menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1050; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(2px); }
.menu-overlay.active { opacity: 1; visibility: visible; }

/* Main Content Area */
.main-content { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; overflow-y: auto; }

.mobile-center-titles { display: none !important; }

/* Responsive Data Tables for Mobile (Card Layout) */
@media (max-width: 992px) {
    .mobile-center-titles { display: flex !important; }
    .page-title:not(.mobile-header-title), #page-subtitle { display: none !important; }
    /*
     * Mobile: keep #mobile-page-subtitle in DOM for JS sync, but out of flex flow
     * (display:none is fine for layout too; absolute guarantees no gap/min-height quirks
     * and no second flex line affecting vertical centering of .mobile-page-title).
     */
    .mobile-page-subtitle {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 1px !important;
        height: 1px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
        border: 0 !important;
        pointer-events: none !important;
    }
    
    .data-table thead { display: none; }
    .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr {
        margin-bottom: 15px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 10px 15px;
    }
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 8px 0;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    }
    .data-table td:last-child {
        border-bottom: none;
    }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-secondary);
        font-size: 13px;
        text-align: left;
        margin-right: 10px;
    }
    
    /* Make pagination controls more flexible */
    .table-footer { position: relative; padding-top: 62px; display: flex; justify-content: center; padding-bottom: 0; margin-top: 15px; }
    .total-count { position: absolute; top: 15px; left: 0; display: flex; align-items: center; gap: 5px; height: 32px; padding-top: 0; }
    .pagination-controls { width: 100%; display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 0; padding-top: 0; }
    .pagination-controls > div:first-child { position: absolute; top: 15px; right: 0; display: flex; align-items: center; height: 32px; margin: 0; padding-top: 0; }
    .pagination-controls > div:nth-child(2) { display: none; }
    .pagination-controls > #btn-prev { margin: 0; }
    .pagination-controls > .jumper-box { margin: 0 5px; }
    .pagination-controls > #btn-next { margin: 0; }
}

/* Mobile Menu & Responsive */
@media (max-width: 992px) {
    .app-layout { flex-direction: column; }
    .sidebar { position: fixed; top: 0; left: -280px; width: 260px; height: 100vh; box-shadow: 5px 0 15px rgba(0,0,0,0.5); z-index: 1100; transition: transform 0.3s ease; }
    .sidebar.active { transform: translateX(280px); }
    .sidebar .hamburger-btn { display: none; }
    .sidebar .sidebar-logo { justify-content: space-between; }
    .close-sidebar-btn { display: flex; }
    .main-content { padding: 0; overflow-x: hidden; }
}

/* Header Alert (Trial) */
.trial-banner {
    background: rgba(90, 114, 86, 0.1);
    border-bottom: 1px solid rgba(90, 114, 86, 0.3);
    color: #fff;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.trial-banner button {
    background-color: var(--primary-green);
    color: #fff;
    border: 1px solid var(--primary-green);
    box-shadow: 0 0 15px rgba(90, 114, 86, 0.5);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.trial-banner button:hover {
    box-shadow: 0 0 25px rgba(90, 114, 86, 0.7);
    background-color: #6B8567;
    transform: translateY(-1px);
}

/* Dashboard Grid */
.dashboard-grid {
    padding: 32px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
}

/* Timeline */
.timeline-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.timeline-item {
    display: flex;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.time-col { width: 50px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.event-col { 
    flex-grow: 1; 
    background: var(--input-bg); 
    padding: 12px 16px; 
    border-radius: 12px; 
    border-left: 3px solid var(--primary-green);
}
/* --- UI IMPROVEMENTS --- */
.timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot {
    display: flex;
    gap: 20px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: 0.2s;
    cursor: pointer;
}

.slot.free {
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
}

.slot.free:hover {
    border-color: var(--primary-green);
    background: rgba(90, 114, 86, 0.05);
}

.slot.busy {
    background: var(--input-bg);
    border-left: 4px solid var(--primary-green);
}

.slot-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: 0.2s;
}

.slot.busy:hover .slot-actions { opacity: 1; }

.action-btn {
    background: var(--border-color);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.action-btn.cancel { background: var(--error-color); }

/* Кнопка добавления */
.add-record-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Анимация кнопок действий в слотах */
.action-btn {
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.action-btn:hover {
    transform: scale(1.1);
}
/* Специфические цвета при наведении */
.btn-confirm:hover { background-color: #6B8567 !important; } /* primary-hover */
.btn-edit:hover { background-color: #555 !important; }
.btn-cancel:hover { background-color: #ff3333 !important; }

.btn-danger {
    background: #e74c3c; color: #fff; border: none;
    padding: 10px 20px; border-radius: 10px; font-weight: 600;
    cursor: pointer; transition: 0.2s;
}
.btn-danger:hover { background: #c0392b; }

/* --- BOTTOM SHEET MODAL (MOBILE) --- */
.bottom-sheet-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    display: flex;
    align-items: flex-end;
}
.bottom-sheet-overlay.active {
    opacity: 1; visibility: visible;
}

.bottom-sheet-content {
    background: #1e1e1e;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    padding-bottom: env(safe-area-inset-bottom, 20px);
}
.bottom-sheet-overlay.active .bottom-sheet-content {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px; height: 5px;
    background: #444; border-radius: 3px;
    margin: 0 auto 20px auto;
}

.sheet-menu-item {
    display: flex; align-items: center; gap: 15px;
    padding: 15px; border-radius: 12px;
    margin-bottom: 10px; background: #252525;
    cursor: pointer; transition: 0.2s;
    font-size: 16px; color: #fff; font-weight: 500;
}
.sheet-menu-item:hover { background: #333; transform: scale(1.02); }
.sheet-menu-item:active { transform: scale(0.98); }
.sheet-menu-icon { font-size: 20px; }

/* --- GENERIC CONFIRMATION MODAL (Standardized across Lababook) --- */
.confirm-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4500;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.confirm-modal-box {
    background: #1e1e1e; /* Master theme dark background */
    border: 1px solid var(--border-color);
    width: 85%;
    max-width: 380px;
    border-radius: 16px;
    padding: 0;
    text-align: left;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.confirm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.confirm-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.confirm-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}
.confirm-modal-close:hover {
    color: var(--text-main);
}

.confirm-modal-body {
    padding: 20px;
}

.confirm-modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.confirm-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
}

.btn-confirm-no, .btn-confirm-yes {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-confirm-no {
    background: var(--input-bg);
    color: var(--text-main);
}

.btn-confirm-no:hover {
    background: #3a3a3a;
}

.btn-confirm-yes {
    background: #e74c3c;
    color: white;
}

.btn-confirm-yes:hover {
    background: #b03a2e; /* Much darker red for better visibility */
}
.toast-container { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    z-index: 9999; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.toast { 
    background: #1a1a1a; 
    border: 1px solid var(--primary-green); 
    border-left: 6px solid var(--primary-green); 
    color: #fff; 
    padding: 16px 20px; 
    border-radius: 8px; 
    width: 340px; 
    box-shadow: 0 0 15px rgba(90, 114, 86, 0.4); 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    animation: slideInRight 0.3s ease; 
    position: relative;
    height: auto;
    min-height: 60px;
}

.toast.warning {
    border: 1px solid #f39c12;
    border-left: 6px solid #f39c12;
    background: #2a200a; /* Dark yellow background */
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.4);
}
.toast.warning .toast-title { color: #f39c12; }

@keyframes slideInRight { 
    from { transform: translateX(100%); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}

.toast-content { 
    flex-grow: 1; 
    margin-right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px; 
}

.toast-title { 
    font-weight: 700; 
    font-size: 15px; 
    margin-bottom: 2px; 
    color: var(--primary-green); 
}

.toast-msg { 
    font-size: 14px; 
    color: #ddd; 
    line-height: 1.5;
    white-space: pre-wrap; /* Allows multiline */
    word-wrap: break-word; 
}

.toast-close-btn { 
    background: transparent; 
    border: none; 
    color: #888; 
    font-size: 20px; 
    cursor: pointer; 
    line-height: 1; 
    padding: 2px; 
    margin: -4px -4px 0 0; 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 24px; 
    height: 24px; 
    border-radius: 4px; 
    flex-shrink: 0; 
}

.toast-close-btn:hover { 
    color: #fff; 
    background: rgba(255, 255, 255, 0.1); 
}

.toast.error {
    border: 1px solid var(--error-color); 
    border-left: 6px solid var(--error-color);
    background: #2c0b0e; 
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4); 
}
.toast.error .toast-title { color: var(--error-color); }

/* --- PROFILE TAB STYLES --- */
.profile-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: 0.3s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary-green);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-green);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Tooltips (Global) */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; top: 120%; background: #333; color: #fff; padding: 5px 10px; border-radius: 4px; font-size: 12px; white-space: nowrap; z-index: 1000; border: 1px solid #444; box-shadow: 0 4px 10px rgba(0,0,0,0.5); pointer-events: none; opacity: 1; }
.notif-bell-btn[data-tooltip]:hover::after { right: 0; left: auto; transform: none; }
.conflict-badge[data-tooltip]:hover::after { left: 0; transform: none; white-space: nowrap; width: auto; min-width: auto; font-weight: 400; }
[data-tooltip]:not(.notif-bell-btn):not(.conflict-badge):hover::after { left: 50%; transform: translateX(-50%); }

/* --- SINGLE PROFILE CARD LAYOUT --- */
.single-profile-card {
    display: flex;
    background-color: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    overflow: hidden; /* Ensures child backgrounds don't bleed */
}

.profile-left-col {
    width: 280px;
    flex-shrink: 0;
    padding: 40px 30px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02); /* Subtle contrast */
}

.profile-right-col {
    flex-grow: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--border-color);
    opacity: 0.5;
}

.form-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Schedule Tab - Equal Height Cards */
.schedule-grid {
    display: flex;
    gap: 30px;
    align-items: stretch; /* Ensures equal height */
}

.schedule-grid .settings-card {
    flex: 1; /* Each card takes 50% width */
    display: flex;
    flex-direction: column;
    min-height: 500px; /* Minimum height for consistency */
}

.schedule-list, .mini-calendar-grid {
    flex-grow: 1; /* Pushes content to fill space */
}

.save-btn-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 992px) {
    .single-profile-card {
        flex-direction: column;
    }
    .profile-left-col {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 30px;
    }
    .profile-right-col {
        padding: 30px;
    }
    .form-grid-row, .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .schedule-grid {
        flex-direction: column;
    }
    .schedule-grid .settings-card {
        min-height: auto;
    }
}

/* --- GLOBAL PRELOADER --- */
#global-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #121212;
    z-index: 9999999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#global-preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-glow-ring {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: relative;
    animation: preloader-spin 1s linear infinite;
}

.preloader-glow-ring::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary-green);
    border-right-color: var(--primary-green);
    box-shadow: 0 0 15px var(--primary-green);
    animation: preloader-pulse 1.5s ease-in-out infinite;
}

.preloader-text {
    margin-top: 15px;
    color: var(--primary-green);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 4px;
    animation: preloader-text-pulse 1.5s ease-in-out infinite;
}

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

@keyframes preloader-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(182, 230, 172, 0.4), inset 0 0 5px rgba(182, 230, 172, 0.2); }
    50% { box-shadow: 0 0 20px rgba(182, 230, 172, 0.8), inset 0 0 10px rgba(182, 230, 172, 0.4); }
}

@keyframes preloader-text-pulse {
    0%, 100% { opacity: 0.6; text-shadow: none; }
    50% { opacity: 1; text-shadow: 0 0 12px var(--primary-green); }
}

/* Login page only (master login.blade.php): no document scroll on narrow viewports */
@media (max-width: 992px) {
    html.auth-login-page {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    html.auth-login-page body.auth-login-page {
        min-height: unset;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
    }
}
