
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Poppins:wght@400;500;600&display=swap');

:root {
    --sidebar-bg: #fff;
    --main-bg: #f8f9fa;
    --header-bg: #ffffff;
    --dark-blue: #202124;
    --text-color: #5f6368;
    --border-color: #e0e0e0;
    --header-height: 60px;
    --sidebar-width: 250px;
    --primary-blue: #1a73e8;
    --danger-red: #d93025;
    --neon-green: #88FF72;
    --update-green: #28a745;
}

/* Dark mode variables */
[data-theme="dark"] {
    --sidebar-bg: rgb(25,28,43);
    --main-bg: rgb(25,28,43);
    --header-bg: rgb(25,28,40);
    --text-color: rgb(210,217,228);
    --border-color: rgb(37,40,45);
    --icon-color: rgb(109,128,134);
    --sidebar-folder-color: rgb(129,182,198);
    --dashboard-icon-color: rgb(136,192,208);
    --section-title-color: rgb(134,134,134);
    --tool-bg-color: rgb(55,55,61);
    --search-bg: rgb(19,21,32);
    --modal-bg: rgb(25,28,43);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Hind Siliguri', sans-serif;
}

body {
    background-color: var(--main-bg);
    color: var(--text-color);
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* ================== Top Header Bar ================== */
.main-header {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 0 75px;
    background: var(--header-bg);
    width: 100%;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    border-bottom: 1px solid transparent; /* Hide static border for animation */
    background-clip: padding-box;
}
/* Header Animated Border */
.main-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px; /* Position perfectly at the bottom */
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
    background-size: 200% 100%;
    animation: left-to-right-wipe 8s linear infinite;
    transition: background 0.3s ease;
}
/* Green flash for new updates */
.main-header.update-incoming::after {
    background: linear-gradient(90deg, transparent, var(--update-green), transparent);
    animation-duration: 0.5s; /* Faster flash */
}
[data-theme="dark"] .main-header::after {
    background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
}
[data-theme="dark"] .main-header.update-incoming::after {
    background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 10px;
}
.header-logo { 
    height: 35px; 
    width: auto; 
}
#menu-toggle { 
    position: relative;
    color: var(--text-color); 
    font-size: 0.9rem; 
    display: none; 
    padding: 5px;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
}
.header-center { display: flex; justify-content: center; }
.header-search { 
    display: flex; 
    align-items: center; 
    background-color: #f1f3f4; 
    padding: 10px 15px; 
    border-radius: 8px; 
    width: 100%; 
    max-width: 720px; 
    border: 1px solid transparent; 
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
/* Search Bar Animated Border */
.header-search::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
    background-size: 200% 100%;
    background-position: 100% 0; /* Start hidden */
    transition: background-position 0s 2s; /* Delay hiding */
}
.header-search:focus-within {
    border-color: transparent;
    box-shadow: none;
}
.header-search:focus-within::after {
    animation: left-to-right-wipe 2.5s linear infinite;
    transition-delay: 0s;
}

[data-theme="dark"] .header-search {
    background-color: var(--search-bg);
}
.header-search i { color: var(--text-color); margin-right: 15px; }
.header-search input { 
    border: none; 
    outline: none; 
    background: transparent; 
    width: 100%; 
    font-size: 0.95rem; 
    color: var(--dark-blue); 
}
[data-theme="dark"] .header-search input {
    color: var(--text-color);
}
.header-right { display: flex; align-items: center; gap: 15px; }

@keyframes left-to-right-wipe {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

/* Dark Mode Toggle Switch */
.theme-toggle { background: none; border: none; padding: 0; cursor: pointer; margin: 0 10px; }
.switch { width: 50px; height: 30px; background-color: rgb(237, 242, 250); border-radius: 20px; position: relative; transition: background-color 0.3s; }
[data-theme="dark"] .switch { background-color: #183048; }
.switch-body { width: 100%; height: 100%; position: relative; overflow: hidden; }
.handle { width: 24px; height: 24px; background-color: #ffeb7b; border-radius: 50%; position: absolute; left: 3px; top: 3px; transition: transform 0.3s, background-color 0.3s; }
[data-theme="dark"] .handle { background-color: #c7c7c7; transform: translateX(20px); }
.crater { background-color: #e8d061; border-radius: 50%; position: absolute; opacity: 0; transition: opacity 0.3s; }
[data-theme="dark"] .crater { opacity: 1; }
.crater-1 { width: 8px; height: 8px; top: 5px; left: 5px; }
.crater-2 { width: 6px; height: 6px; top: 12px; left: 12px; }
.crater-3 { width: 5px; height: 5px; top: 3px; left: 15px; }
.star { background-color: white; position: absolute; border-radius: 50%; width: 2px; height: 2px; opacity: 0; transition: opacity 0.3s ease-in-out; }
[data-theme="dark"] .star { opacity: 1; }
.star-1 { top: 8px; left: 35px; } .star-2 { top: 15px; left: 28px; } .star-3 { top: 20px; left: 40px; } .star-4 { top: 5px; left: 45px; } .star-5 { top: 18px; left: 35px; } .star-6 { top: 12px; left: 42px; }
.header-action-image { height: 38px; width: auto; display: block; border-radius: 4px; transition: filter 0.2s ease; object-fit: contain; }
.dropdown-btn:hover .header-action-image { filter: brightness(1.1); }
.dropdown-container { position: relative; display: inline-block; }
.dropdown-btn { background: none; border: none; padding: 0; cursor: pointer; line-height: 0; }
.dropdown-content { display: none; position: absolute; background-color: #ffffff; min-width: 220px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1); z-index: 1010; border-radius: 5px; overflow: hidden; border: 1px solid var(--border-color); right: 0; }
.dropdown-content.show { display: block; }
.dropdown-content a { color: var(--dark-blue); padding: 12px 16px; text-decoration: none; display: block; }
.dropdown-content a:hover { background-color: #f1f1f1; }

/* ================== Main Body & Sidebar ================== */
.dashboard-body { display: flex; padding-top: var(--header-height); }
.sidebar { width: var(--sidebar-width); background-color: var(--sidebar-bg); border-right: 1px solid var(--border-color); height: calc(100vh - var(--header-height)); position: fixed; top: var(--header-height); left: 0; display: flex; flex-direction: column; transition: transform 0.3s ease, margin-left 0.3s ease; z-index: 1002; }
.sidebar-sticky-top { flex-shrink: 0; }
.sidebar-header { padding: 12px 20px; display: flex; justify-content: center; align-items: center; position: relative; transition: all 0.3s ease; }
.sidebar-header h3 { font-size: 1rem; color: var(--dark-blue); transition: all 0.3s ease; margin: 0; }
body.edit-mode .sidebar-header { justify-content: space-between; }
body.edit-mode .sidebar-header h3 { color: var(--neon-green); font-weight: 600; }
.sidebar-header h3 { color: rgb(14, 60, 229); font-weight: 600; }
.quick-actions { display: flex; justify-content: space-around; padding: 10px 20px; border-bottom: 1px solid var(--border-color); }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-color); transition: color 0.2s; }
.icon-btn:hover { color: var(--primary-blue); }
.scrollable-nav { flex-grow: 1; overflow-y: auto; }
.main-nav ul { list-style: none; padding: 10px; }
.main-nav li a { display: flex; align-items: center; padding: 8px 12px; text-decoration: none; color: var(--text-color); font-weight: 500; border-radius: 4px; margin-bottom: 1px; font-size: 0.75rem; transition: background-color 0.2s, color 0.2s; position: relative; line-height: 1.2; }
.main-nav li.active a { background: #e8f0fe; color: var(--primary-blue); font-weight: 600; }
[data-theme="dark"] .main-nav li.active a { background: var(--search-bg); }
.main-nav li.active a i { color: var(--primary-blue); }
.main-nav li:not(.active) a:hover { background: #f1f3f4; color: var(--dark-blue); }
[data-theme="dark"] .main-nav li:not(.active) a:hover { background: var(--search-bg); color: var(--text-color); }
.main-nav i { font-size: 0.9rem; margin-right: 12px; width: 16px; text-align: center; color: var(--text-color); transition: color 0.2s; }

/* ================== Main Content Area ================== */
.main-wrapper { flex-grow: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.content-area { padding: 25px; flex-grow: 1; }
.sidebar.toggled + .main-wrapper .content-area { pointer-events: none; opacity: 0.6; }
.content-section { 
    margin-bottom: 25px; 
    border-radius: 12px; 
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
}
.content-section-header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    border-bottom: 1px solid var(--border-color);
    padding: 15px;
}
.content-section-header h4 { 
    font-size: 1rem; 
    color: var(--dark-blue); 
    font-weight: 600; 
    margin-bottom: 0; 
}
[data-theme="dark"] .content-section-header h4 { color: var(--section-title-color); }
.tool-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; padding: 15px; } 
.tool-card { background-color: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--dark-blue); transition: all 0.2s ease-in-out; position: relative; width: 250px; height: 80px; }
[data-theme="dark"] .tool-card { background-color: var(--tool-bg-color); border-color: var(--border-color); }
.tool-card:hover { border-color: #d2e3fc; background-color: #f8fbff; box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); }
.tool-icon-wrapper { font-size: 1.2rem; color: var(--primary-blue); flex-shrink: 0; width: 24px; text-align: center; }
.tool-text { display: flex; flex-direction: column; }
.tool-title { font-weight: 600; font-size: 0.85rem; color: var(--dark-blue); }
[data-theme="dark"] .tool-title { color: #ffffff; }
.tool-description { font-size: 0.75rem; color: var(--text-color); }
[data-theme="dark"] .tool-description { color: #b0bec5; }
.text-content-container { min-height: 20px; padding: 15px; }
.text-content-container p, .text-content-container div, .text-content-container ul, .text-content-container ol, .text-content-container blockquote { margin-bottom: 1em; }
.text-content-container a { color: var(--primary-blue); text-decoration: none; font-weight: 500; }
.text-content-container a:hover { text-decoration: underline; }

/* ================== Edit Mode Styles ================== */
.logout-btn { background: none; border: 1px solid var(--border-color); color: var(--text-color); font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; cursor: pointer; transition: all 0.3s ease; }
.logout-btn:hover { background: #f1f3f4; border-color: #ccc; }
body.edit-mode .logout-btn { border-color: var(--danger-red); color: var(--danger-red); }
body.edit-mode .logout-btn:hover { background: var(--danger-red); color: white; }
.add-item-wrapper, #logout-btn { display: none; }
body.edit-mode .add-item-wrapper, body.edit-mode #logout-btn { display: flex; }
body.edit-mode .tool-card, body.edit-mode .content-section, body.edit-mode .main-nav li a { cursor: pointer; }
body.edit-mode .tool-card:hover, body.edit-mode .main-nav li a:hover { transform: scale(1.02); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.add-item-wrapper { flex-direction: column; gap: 10px; padding: 15px; margin-top: 10px; border-top: 1px solid var(--border-color); }
.add-item-btn { width: 100%; padding: 10px; border: 1px dashed var(--border-color); border-radius: 8px; background-color: transparent; color: var(--text-color); cursor: pointer; transition: all 0.2s; }
.add-item-btn:hover { background-color: #e8f0fe; color: var(--primary-blue); border-color: var(--primary-blue); }
body.edit-mode .global-add-section-wrapper { display: flex; }

/* Drag and Drop Styles */
.tool-card.dragging { opacity: 0.4; border-style: dashed; }
.drag-over-marker { height: 100%; width: 4px; background: var(--primary-blue); border-radius: 2px; margin: 0 8px; }

/* ================== Modal Styles ================== */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1050; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease; }
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal { background-color: #fff; border-radius: 16px; width: 90%; max-width: 500px; box-shadow: 0 5px 15px rgba(0,0,0,.1); display: flex; flex-direction: column; transform: translateY(-50px); transition: transform 0.3s ease; }
[data-theme="dark"] .modal { background-color: var(--modal-bg); border: 1px solid var(--border-color); }
.modal-overlay.visible .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { font-size: 1.1rem; color: var(--dark-blue); }
.modal-close-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-color); }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 5px; }
.form-group input[type="text"], .form-group input[type="url"], .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 4px; font-size: 0.9rem; }
.form-group input:focus { border-color: var(--primary-blue); outline: none; box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 20px; border-top: 1px solid var(--border-color); }
.btn-primary, .btn-secondary, .btn-danger { padding: 8px 16px; border-radius: 4px; border: none; font-weight: 500; cursor: pointer; }
.btn-primary { background-color: var(--primary-blue); color: #fff; }
.btn-secondary { background-color: var(--text-color); color: #fff; }
.btn-danger { background-color: var(--danger-red); color: #fff; }
.color-picker-wrapper, .slider-wrapper { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.color-picker-wrapper input[type="color"] { width: 40px; height: 40px; border: none; padding: 0; border-radius: 4px; cursor: pointer; }
.slider-wrapper label { flex-shrink: 0; }
.slider-wrapper input[type="range"] { flex-grow: 1; }
.slider-wrapper span { font-weight: 600; min-width: 45px; text-align: right; }

/* Choice Modal for Billing & Sales */
.choice-modal { max-width: 450px !important; }
.choice-modal .modal-body { text-align: center; }
.choice-modal .modal-body p { margin-bottom: 20px; font-size: 1rem; }
.choice-buttons { display: flex; gap: 15px; justify-content: center; }
.btn-choice {
    flex: 1;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark-blue);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.btn-choice i {
    font-size: 2rem;
    color: var(--primary-blue);
}
.btn-choice:hover {
    background-color: #e8f0fe;
    border-color: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
[data-theme="dark"] .btn-choice {
    color: var(--text-color);
    background-color: var(--tool-bg-color);
}
[data-theme="dark"] .btn-choice:hover {
    background-color: var(--search-bg);
    border-color: var(--primary-blue);
}

/* Icon Picker Styles */
#icon-picker-modal .modal-body { max-height: 400px; overflow-y: auto; }
.icon-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 10px; }
.icon-picker-item { display: flex; align-items: center; justify-content: center; padding: 10px; border-radius: 4px; border: 1px solid var(--border-color); cursor: pointer; transition: background-color 0.2s, color 0.2s; font-size: 1.5rem; }
.icon-picker-item:hover { background-color: #e8f0fe; color: var(--primary-blue); }
#icon-choice-wrapper { display: flex; align-items: center; gap: 15px; }
#choose-icon-btn { padding: 8px 12px; background-color: #f1f3f4; border: 1px solid var(--border-color); border-radius: 4px; cursor: pointer; }
#icon-preview { font-size: 1.5rem; width: 30px; text-align: center; }

/* ================== INLINE RICH TEXT EDITOR STYLES ================== */
.inline-editor-wrapper { background: white; width: 100%; min-height: 297mm; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); position: relative; margin: 10px 0; border: 1px solid var(--border-color); display: flex; flex-direction: column; }
.inline-editor-wrapper .ribbon { background: linear-gradient(to bottom, #ffffff, #f8f9fa); border-bottom: 1px solid #d1d1d1; padding: 8px 16px 6px 16px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11px; position: sticky; top: calc(var(--header-height) - 1px); z-index: 100; }
.inline-editor-wrapper .ribbon-group { display: flex; gap: 2px; align-items: center; padding: 2px 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.5); border: 1px solid transparent; }
.inline-editor-wrapper .ribbon-group:hover { background: rgba(0, 120, 215, 0.1); border: 1px solid rgba(0, 120, 215, 0.3); }
.inline-editor-wrapper .btn { padding: 4px 6px; border: none; border-radius: 2px; background: transparent; color: #323130; cursor: pointer; font-size: 11px; font-weight: 400; transition: all 0.2s ease; min-width: 24px; height: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.inline-editor-wrapper .btn:hover { background: rgba(0, 120, 215, 0.1); border: 1px solid rgba(0, 120, 215, 0.3); }
.inline-editor-wrapper .btn.active { background: rgba(0, 120, 215, 0.2); border: 1px solid rgba(0, 120, 215, 0.5); }
.inline-editor-wrapper .btn-icon { font-size: 9px; margin-bottom: 1px; }
.inline-editor-wrapper .btn-label { font-size: 8px; color: #605e5c; }
.inline-editor-wrapper select, .inline-editor-wrapper input[type="number"] { padding: 2px 4px; border: 1px solid #d1d1d1; border-radius: 2px; font-size: 11px; background: white; height: 22px; min-width: 60px; }
.inline-editor-wrapper select:focus, .inline-editor-wrapper input:focus { outline: none; border-color: #0078d4; box-shadow: 0 0 0 1px #0078d4; }
.inline-editor-wrapper .color-input { width: 24px; height: 22px; border: 1px solid #d1d1d1; border-radius: 2px; cursor: pointer; padding: 0; }
.inline-editor-wrapper .editor { flex-grow: 1; padding: 40px 30px; border: none; outline: none; font-size: 11pt; line-height: 1.15; font-family: 'Calibri', Arial, sans-serif; background: white; }
.inline-editor-wrapper .editor:focus { box-shadow: inset 0 0 0 2px var(--primary-blue); }
.inline-editor-wrapper .editor:empty::before { content: 'Type here...'; color: #a19f9d; position: absolute; top: 90px; left: 30px; pointer-events: none; font-style: italic; }
.inline-editor-wrapper .separator { width: 1px; height: 20px; background: #d1d1d1; margin: 0 4px; }
.inline-editor-wrapper .link-dialog { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 20px; border-radius: 4px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); z-index: 1060; border: 1px solid #d1d1d1; min-width: 320px; }
.inline-editor-wrapper .link-dialog h3 { font-size: 14px; margin-bottom: 12px; color: #323130; }
.inline-editor-wrapper .link-dialog input { width: 100%; margin: 6px 0; padding: 8px; border: 1px solid #d1d1d1; border-radius: 2px; font-size: 11px; }
.inline-editor-wrapper .link-dialog .btn-group { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }
.inline-editor-wrapper .link-dialog .btn { padding: 6px 12px; height: auto; min-width: auto; background: #0078d4; color: white; border-radius: 2px; }
.inline-editor-wrapper .link-dialog .btn.cancel { background: #a19f9d; }
.inline-editor-wrapper .overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); z-index: 1055; }
.inline-editor-wrapper .status-bar { background: #f3f2f1; padding: 4px 16px; border-top: 1px solid #d1d1d1; font-size: 10px; color: #605e5c; }
[data-theme="dark"] .inline-editor-wrapper, [data-theme="dark"] .inline-editor-wrapper .ribbon, [data-theme="dark"] .inline-editor-wrapper .editor, [data-theme="dark"] .inline-editor-wrapper .link-dialog, [data-theme="dark"] .inline-editor-wrapper .status-bar { background: var(--tool-bg-color); color: var(--text-color); }
[data-theme="dark"] .inline-editor-wrapper .btn, [data-theme="dark"] .inline-editor-wrapper .link-dialog h3 { color: var(--text-color); }

/* ================== LOGIN MODAL STYLES ================== */
.login-modal { max-width: 400px !important; width: 90% !important; border-radius: 20px; overflow: hidden; }
.login-modal .modal-header h3 { display: flex; align-items: center; gap: 8px; color: var(--dark-blue); }
[data-theme="dark"] .login-modal .modal-header h3, [data-theme="dark"] .login-modal .form-group label { color: var(--text-color); }
.login-modal .modal-header h3 i { color: var(--primary-blue); }
.login-modal .form-group label { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--dark-blue); }
.login-modal .form-group label i { color: var(--primary-blue); font-size: 0.9rem; }
.password-input-wrapper { position: relative; display: flex; align-items: center; }
.password-input-wrapper input { padding-right: 40px; }
.password-toggle { position: absolute; right: 10px; background: none; border: none; color: var(--text-color); cursor: pointer; padding: 5px; border-radius: 3px; transition: color 0.2s; }
.password-toggle:hover { color: var(--primary-blue); }
.checkbox-group { margin-top: 20px; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; color: var(--text-color); }
.checkbox-label input[type="checkbox"] { display: none; }
.checkmark { width: 18px; height: 18px; border: 2px solid var(--border-color); border-radius: 3px; position: relative; transition: all 0.2s; }
.checkbox-label input[type="checkbox"]:checked + .checkmark { background-color: var(--primary-blue); border-color: var(--primary-blue); }
.checkbox-label input[type="checkbox"]:checked + .checkmark::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 0.7rem; }
.login-modal .btn-primary { width: 100%; padding: 12px; font-size: 1rem; display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, var(--primary-blue), #1557b0); transition: all 0.3s ease; }
.login-modal .btn-primary:hover { background: linear-gradient(135deg, #1557b0, var(--primary-blue)); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3); }

/* ================== Responsive Styles ================== */
.mobile-only { display: none !important; }

@media (max-width: 992px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; align-items: center; justify-content: center; }

    .main-header .header-center {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--header-bg);
        padding: 10px 15px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        transform: translateY(-20px) scaleY(0.9);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.2s ease-out, opacity 0.2s ease-out;
        z-index: 1000;
    }
    .main-header.search-active .header-center {
        transform: translateY(0) scaleY(1);
        opacity: 1;
        pointer-events: auto;
    }
    .dashboard-body {
        padding-top: var(--header-height);
    }
    .sidebar { margin-left: calc(-1 * var(--sidebar-width)); transform: translateX(0); }
    .sidebar.toggled { transform: translateX(var(--sidebar-width)); box-shadow: 0 0 15px rgba(0,0,0,0.2); }
    .main-wrapper { margin-left: 0; }
    #menu-toggle { display: flex; }
    .header-right { gap: 10px; }
    .theme-toggle { margin: 0 5px; }
}

@media (max-width: 768px) {
    .main-header { grid-template-columns: auto 1fr; padding: 0 10px; }
    .header-right { justify-self: end; }
    .header-logo { height: 32px; }
    #menu-toggle { padding-left: 2px; }
    .content-area { padding: 15px; }
    .tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .tool-card { 
        display: flex;
        flex-direction: column; 
        text-align: center; 
        padding: 12px 8px; 
        gap: 8px; 
        min-height: 80px; 
        justify-content: center; 
        width: auto !important; 
        height: auto; /* Allow grid to control height */
    }
    .tool-icon-wrapper { margin: 0; font-size: 1.8rem; margin-bottom: 4px; }
    .tool-text { gap: 4px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
    .tool-title { font-size: 0.75rem; line-height: 1.2; font-weight: 600; margin-bottom: 2px; }
    .tool-description { display: block; font-size: 0.65rem; line-height: 1.1; opacity: 0.8; }
    body.edit-mode * { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
    body.edit-mode .tool-card:active, body.edit-mode .content-section:active, body.edit-mode .main-nav li a:active { transform: scale(0.98); transition: transform 0.1s ease; }
    .modal { width: 95%; max-width: none; margin: 20px auto; max-height: 90vh; overflow-y: auto; }
    .modal-body { max-height: 60vh; overflow-y: auto; }
    .modal-footer { flex-direction: column; gap: 8px; }
    .modal-footer button { width: 100%; }
    .inline-editor-wrapper .editor { padding: 20px 15px; }
}

@media (max-width: 400px) {
    .tool-grid { grid-template-columns: repeat(2, 1fr); }
}