/* =========================================================
   Clean Premium Light Theme - Compact Version
   Enhanced UI with modern colors, refined shadows, and transitions
========================================================= */

html[data-theme='light'] {
    /* Modern Indigo & Slate Palette */
    --primary-color: #4f46e5;       /* Vibrant Indigo */
    --primary-hover-color: #4338ca; /* Deep Indigo */
    --focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.15);
    
    /* Backgrounds */
    --page-bg: #f3f4f6;             /* Cool Slate Gray */
    --surface-bg: #ffffff;
    --surface-soft: #f9fafb;
    --surface-hover: #f3f4f6;
    --selected-bg: #e0e7ff;         /* Very Light Indigo */
    
    /* Borders */
    --border-color: #e5e7eb;
    --border-strong: #d1d5db;
    
    /* Typography */
    --text-color: #111827;          /* Near Black */
    --text-muted-color: #6b7280;    /* Medium Gray */
    
    /* Layered Modern Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    /* Global Transitions */
    --transition-fast: 0.15s ease-in-out;
}

/* Page */
html[data-theme='light'] body,
html[data-theme='light'] .page-container,
html[data-theme='light'] .desk-container,
html[data-theme='light'] .desk-page {
    background: var(--page-bg);
    color: var(--text-color);
}

/* Navbar */
html[data-theme='light'] .navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    min-height: 54px;
}

html[data-theme='light'] #navbar-search {
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

html[data-theme='light'] #navbar-search:focus-within {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

/* Main layout spacing */
html[data-theme='light'] .desk-page,
html[data-theme='light'] .layout-main-section {
    padding: 6px !important;
}

html[data-theme='light'] .layout-side-section {
    padding: 6px 4px !important;
}

/* Sidebar */
html[data-theme='light'] .desk-sidebar {
    padding: 4px !important;
}

html[data-theme='light'] .desk-sidebar .standard-sidebar-label {
    margin-bottom: 4px;
    padding-left: 4px;
    color: var(--text-muted-color);
    font-weight: 500;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

html[data-theme='light'] .desk-sidebar .standard-sidebar-item {
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    color: var(--text-color);
}

html[data-theme='light'] .desk-sidebar .standard-sidebar-item:hover {
    background: var(--surface-soft);
    border-color: var(--border-color);
}

html[data-theme='light'] .desk-sidebar .standard-sidebar-item.selected {
    background: var(--selected-bg);
    border-color: rgba(79, 70, 229, 0.2);
    color: var(--primary-hover-color);
    font-weight: 500;
}

/* Workspace & Widgets */
html[data-theme='light'] .desk-page .workspace .card-container,
html[data-theme='light'] .workspace .widget,
html[data-theme='light'] .widget,
html[data-theme='light'] .shortcut-widget-box {
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

html[data-theme='light'] .workspace .widget:hover,
html[data-theme='light'] .widget:hover {
    box-shadow: var(--shadow-md);
}

/* Reduce large outer spacing */
html[data-theme='light'] .desk-page .workspace .card-container {
    padding: 10px;
    gap: 8px;
    margin-top: 6px;
}

/* Section headings */
html[data-theme='light'] .desk-page .workspace .section-heading,
html[data-theme='light'] .widget-head .widget-title,
html[data-theme='light'] .widget-title {
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Widget inner padding */
html[data-theme='light'] .widget.links-widget-box,
html[data-theme='light'] .widget.shortcut-widget-box,
html[data-theme='light'] .workspace-widget {
    padding: 8px;
}

html[data-theme='light'] .widget-head {
    padding: 6px 8px 4px 8px !important;
    margin-bottom: 2px !important;
}

html[data-theme='light'] .widget-body {
    padding: 4px 8px 8px 8px !important;
}

/* Link items */
html[data-theme='light'] .widget.links-widget-box .link-item {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition-fast);
}

html[data-theme='light'] .widget.links-widget-box .link-item:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

html[data-theme='light'] .widget.links-widget-box .link-item:last-child {
    margin-bottom: 0;
}

/* Shortcuts */
html[data-theme='light'] .desk-page .workspace .shortcut,
html[data-theme='light'] .quick-access .shortcut {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 8px 10px;
    margin: 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-bg);
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition-fast);
}

html[data-theme='light'] .desk-page .workspace .shortcut:hover,
html[data-theme='light'] .quick-access .shortcut:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    box-shadow: var(--shadow-sm);
}

html[data-theme='light'] .quick-access .shortcut.active,
html[data-theme='light'] .widget.shortcut-widget-box {
    background: var(--surface-bg);
    border-color: var(--border-color);
}

/* Cards / report blocks */
html[data-theme='light'] .card,
html[data-theme='light'] .frappe-card,
html[data-theme='light'] .widget-group,
html[data-theme='light'] .number-card,
html[data-theme='light'] .dashboard-graph,
html[data-theme='light'] .list-row-head,
html[data-theme='light'] .grid-heading-row,
html[data-theme='light'] .grid-row,
html[data-theme='light'] .form-grid,
html[data-theme='light'] .result,
html[data-theme='light'] .report-wrapper {
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* Buttons */
html[data-theme='light'] .btn-default,
html[data-theme='light'] .btn-secondary {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 6px 12px;
    color: var(--text-color);
    font-weight: 500;
    transition: all var(--transition-fast);
}

html[data-theme='light'] .btn-default:hover,
html[data-theme='light'] .btn-secondary:hover {
    background: var(--surface-soft);
    border-color: var(--text-muted-color);
}

html[data-theme='light'] .btn-primary {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    color: #ffffff;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    padding: 6px 12px;
    transition: all var(--transition-fast);
}

html[data-theme='light'] .btn-primary:hover {
    background: var(--primary-hover-color);
    border-color: var(--primary-hover-color);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

html[data-theme='light'] .btn-primary:focus,
html[data-theme='light'] .btn-default:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Inputs */
html[data-theme='light'] .form-control,
html[data-theme='light'] .input-with-feedback,
html[data-theme='light'] .control-input input:not([type="checkbox"]):not([type="radio"]),
html[data-theme='light'] .control-input textarea,
html[data-theme='light'] .control-input select {
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--surface-bg);
    color: var(--text-color);
    transition: all var(--transition-fast);
}

html[data-theme='light'] .form-control:focus,
html[data-theme='light'] .control-input input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
    outline: none;
}

/* Ensure checkboxes/radios always render their tick visibly (fixes invisible checked state) */
html[data-theme='light'] .control-input input[type="checkbox"],
html[data-theme='light'] .like-disabled-input input[type="checkbox"],
html[data-theme='light'] input[type="checkbox"],
html[data-theme='light'] input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 14px !important;
    height: 14px !important;
    margin: 0 6px 0 0;
    border: 1px solid #c0c6cc;
    border-radius: 4px;
    background-color: #ffffff;
    box-sizing: border-box;
    cursor: pointer;
    vertical-align: text-bottom;
}

html[data-theme='light'] input[type="checkbox"]:checked {
    background-color: var(--primary) !important;
    background-image: url("data:image/svg+xml,<svg viewBox='0 0 8 7' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M1 4.00001L2.66667 5.80001L7 1.20001' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 57%;
    border: none;
    box-shadow: none;
}

html[data-theme='light'] input[type="radio"]:checked {
    background-color: var(--primary) !important;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 2px var(--primary);
}

/* List-view Check field columns render as disabled "disabled-selected" (not :checked) */
html[data-theme='light'] input[type="checkbox"].disabled-selected {
    background-color: var(--gray-500, #74808b) !important;
    background-image: url("data:image/svg+xml,<svg viewBox='0 0 8 7' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M1 4.00001L2.66667 5.80001L7 1.20001' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 57% !important;
    border: none;
}

html[data-theme='light'] input[type="checkbox"].disabled-deselected {
    background-color: var(--disabled-control-bg, #f4f5f6) !important;
}

/* Remove extra bottom gaps */
html[data-theme='light'] .workspace .widget-group,
html[data-theme='light'] .workspace .widget,
html[data-theme='light'] .widget-group {
    margin-bottom: 8px !important;
}

/* Reduce column gaps */
html[data-theme='light'] .row {
    margin-left: -6px;
    margin-right: -6px;
}

html[data-theme='light'] .row > div {
    padding-left: 6px;
    padding-right: 6px;
}

/* Scrollbar */
html[data-theme='light'] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html[data-theme='light'] ::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 20px;
}

html[data-theme='light'] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted-color);
}

html[data-theme='light'] ::-webkit-scrollbar-track {
    background: var(--surface-soft);
}

/* Mobile */
@media (max-width: 768px) {
    html[data-theme='light'] .desk-page,
    html[data-theme='light'] .layout-main-section {
        padding: 4px !important;
    }

    html[data-theme='light'] .desk-page .workspace .card-container {
        padding: 8px;
        gap: 6px;
    }

    html[data-theme='light'] .widget.links-widget-box .link-item,
    html[data-theme='light'] .desk-page .workspace .shortcut,
    html[data-theme='light'] .quick-access .shortcut {
        min-height: 38px;
        padding: 6px 8px;
    }
}