:root {
    /* Color Palette - Earth Tone Theme */
    --bg-color: #f7f6f0;
    --bg-dark: #eee8d8;
    --glass-bg: #ffffff;
    --glass-border: rgba(0, 0, 0, 0.08);
    
    --primary: #8fa08e;
    --primary-light: #b5cbbb;
    --accent: #d2b48c;
    --accent-light: #e5ccaf;
    --accent-gradient: linear-gradient(135deg, #a4b49b 0%, #c4cfb4 100%);
    
    --text-main: #3d4a3e;
    --text-secondary: #748b76;
    --border-color: rgba(90, 110, 95, 0.15);
    --success: #679267;
    --warning: #cc9955;
    --danger: #d96c6c;
    --radius: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);

    --sidebar-bg: rgba(247, 246, 240, 0.8);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-focus-bg: #ffffff;
    --search-bg: rgba(255, 255, 255, 0.6);

    --fc-btn-bg: rgba(146, 175, 153, 0.15);
    --fc-btn-text: #3d4a3e;
    --fc-btn-hover: rgba(146, 175, 153, 0.3);
    --select-arrow: #3d4a3e;

    --btn-secondary-bg: rgba(61, 74, 62, 0.08);
    --btn-secondary-text: var(--text-main);
    --btn-danger-bg: rgba(217, 108, 108, 0.15);
}

.freee-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    color: white !important;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    cursor: pointer;
}

.freee-badge.quote {
    background: #5a8e6b;
}

.freee-badge.invoice {
    background: #6a9bd1;
}

.freee-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

[data-theme="light"] {
    --bg-color: #f7f6f0;
    --bg-dark: #eee8d8;
    --text-main: #3d4a3e;
    --text-secondary: #748b76;
    --border-color: rgba(90, 110, 95, 0.2);
    --glass-bg: #ffffff;

    --sidebar-bg: rgba(247, 246, 240, 0.8);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-focus-bg: #ffffff;
    --search-bg: rgba(255, 255, 255, 0.6);

    --fc-btn-bg: rgba(146, 175, 153, 0.15);
    --fc-btn-text: #3d4a3e;
    --fc-btn-hover: rgba(146, 175, 153, 0.3);

    --btn-secondary-bg: rgba(61, 74, 62, 0.08);
    --btn-secondary-text: var(--text-main);
    --btn-danger-bg: rgba(217, 108, 108, 0.15);
    --glass-border: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    color: var(--text-main) !important;
}

[data-theme="light"] .glass-input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] {
    --bg-color: #2b2e2a;
    --bg-dark: #222521;
    --glass-bg: rgba(30, 35, 30, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #e8eee8;
    --text-secondary: #a0b0a0;
    --border-color: rgba(255, 255, 255, 0.1);
    --fc-btn-bg: rgba(255, 255, 255, 0.1);
    --fc-btn-text: #ffffff;
    --fc-btn-hover: rgba(255, 255, 255, 0.2);
    --btn-secondary-bg: rgba(255, 255, 255, 0.08);
    --btn-secondary-text: var(--text-main);
    --btn-danger-bg: rgba(239, 68, 68, 0.2);
    
    --primary: #7a8c79;
    --primary-light: #aaa;
    --accent-gradient: linear-gradient(135deg, #7a8c79 0%, #a4b49b 100%);
    --sidebar-bg: rgba(30, 35, 30, 0.8);
    --input-bg: rgba(0,0,0,0.3);
    --input-focus-bg: rgba(0,0,0,0.5);
    --search-bg: rgba(255,255,255,0.05);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    color: var(--text-main) !important;
}

[data-theme="dark"] .glass-input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .glass-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.gap-8 {
    gap: 8px;
}

.mt-24 {
    margin-top: 24px;
}

.p-20 {
    padding: 20px;
}

.p-24 {
    padding: 24px;
}

.app-container {
    display: flex;
    height: 100vh;
    padding: 16px;
    gap: 16px;
}

/* Glassmorphism Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass:hover {
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.2);
}

.glass-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.glass-input:focus {
    border-color: var(--primary);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 5000;
    min-width: 220px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    display: none;
    flex-direction: column;
}

.dropdown:hover .dropdown-menu {
    display: flex;
}

/* Bridge the gap for hover stability */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -50px;
    right: -50px;
    height: 30px;
    /* Testing background: rgba(255,0,0,0.1); */
    z-index: -1;
}

/* Ensure items don't bleed out of rounded corners since overflow:hidden is removed */
.dropdown-item:first-child {
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.dropdown-item:last-child {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    background: var(--sidebar-bg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 56px;
    padding-left: 8px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='12' cy='12' r='10'/%3e%3ccircle cx='12' cy='12' r='2'/%3e%3cline x1='12' y1='2' x2='12' y2='10'/%3e%3cline x1='12' y1='14' x2='12' y2='22'/%3e%3cline x1='22' y1='12' x2='14' y2='12'/%3e%3cline x1='10' y1='12' x2='2' y2='12'/%3e%3cline x1='19.07' y1='4.93' x2='13.41' y2='10.59'/%3e%3cline x1='10.59' y1='13.41' x2='4.93' y2='19.07'/%3e%3cline x1='19.07' y1='19.07' x2='13.41' y2='13.41'/%3e%3cline x1='10.59' y1='10.59' x2='4.93' y2='4.93'/%3e%3c/svg%3e");
    background-size: 85%;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 12px rgba(143, 160, 142, 0.4);
}

.logo h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

nav ul {
    list-style: none;
}

nav li {
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    font-weight: 500;
}

nav li:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    transform: translateX(4px);
}

nav li.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.5);
}

nav li i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.top-bar {
    height: 72px;
    border-radius: var(--radius);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 100;
    overflow: visible;
}

.view-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.view-actions {
    display: flex;
    gap: 12px;
}

.search-box {
    background: var(--search-bg);
    border-radius: var(--radius);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 260px;
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    /* Removed overflow-x: auto to prevent dropdown clipping */
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

.top-actions::-webkit-scrollbar {
    display: none;
}

.top-actions>*,
.view-actions>* {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.clock {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--accent-light);
    letter-spacing: 1px;
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--fc-btn-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--btn-danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    color: white;
}

/* View Container */
.view-content {
    flex: 1;
    overflow-y: auto;
}

.view-content[data-view="kanban"] {
    overflow-y: hidden;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Customer Detail Modal Enhancements */
.customer-details-container {
    color: var(--text-primary);
}

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

.detail-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

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

.tab-btn.active {
    color: var(--accent-light);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-light);
}

.tab-pane {
    display: none;
}

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

.btn-line {
    background: #06C755;
    color: white;
    font-size: 0.8rem;
    padding: 8px 16px;
}

.btn-line:hover {
    background: #05b04a;
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.3);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.bike-card-mini {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.bike-model {
    font-weight: 600;
    font-size: 0.95rem;
}

.bike-serial {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.log-item {
    padding: 12px;
    border-left: 2px solid var(--accent-color);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 12px;
    border-radius: 0 8px 8px 0;
}

.log-date {
    font-size: 0.75rem;
    color: var(--accent-light);
    margin-bottom: 4px;
}

.log-work {
    font-weight: 600;
    font-size: 0.9rem;
}

.log-notes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.mt-8 {
    margin-top: 8px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: 100%;
    max-width: 800px;
    border-radius: var(--radius);
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
}

.hidden {
    display: none;
}

/* Modal Header & Close Button */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1.75rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding-bottom: 4px;
    /* Adjustment for center alignment */
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: #ef4444;
    transform: rotate(90deg);
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
}

.status-dot.warning {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.success {
    color: var(--success);
}

.status-dot.success {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Dashboard & Animation Update */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-stats-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.btn-stats-settings {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-stats-settings:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

.dashboard-side {
    padding: 24px;
    border-radius: var(--radius);
}

.focus-card {
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid var(--accent-light);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.focus-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.focus-customer {
    color: var(--accent-light);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.focus-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.relative {
    position: relative;
}

.delete-btn-absolute {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    z-index: 10;
    transition: all 0.2s;
}

.delete-btn-absolute:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.hover-show-delete:hover .delete-btn-absolute,
.hover-show-delete:active .delete-btn-absolute {
    display: flex;
}


/* Animations */
.slide-up {
    animation: slideUp 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Adjustments (Focus: Task Input & Details) */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        padding: 8px;
        overflow-y: auto;
        height: auto;
    }

    body {
        height: auto;
        overflow-y: auto;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 8px;
        padding: 12px;
        height: auto;
    }

    .sidebar nav ul {
        display: flex;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .sidebar nav ul::-webkit-scrollbar {
        display: none;
    }

    .sidebar nav li {
        width: auto;
        white-space: nowrap;
        padding: 8px 12px;
        margin-bottom: 0;
    }

    .logo {
        margin-bottom: 12px;
        justify-content: center;
    }

    .sidebar-footer {
        display: none;
    }

    .top-bar {
        padding: 8px 12px;
        flex-direction: column;
        height: auto;
        gap: 8px;
        align-items: stretch;
    }

    .top-actions {
        order: 1;
        width: 100%;
        padding: 4px 0;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        align-items: center;
    }

    .top-actions>*,
    .view-actions>* {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .search-box {
        order: 2;
        width: 100% !important;
        margin-top: 4px;
        flex-shrink: 0;
    }

    .top-actions .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .clock {
        display: none;
    }

    .modal-content {
        max-width: 95%;
        padding: 16px;
        margin: 10px;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .view-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .view-actions::-webkit-scrollbar {
        display: none;
    }

    .view-actions .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .grid-2,
    .task-detail-grid,
    .dashboard-layout,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .task-info-panel {
        position: static;
        margin-bottom: 16px;
    }

    .detail-table {
        display: block;
        overflow-x: auto;
    }

    .sync-status {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}

/* Detail Table Grid Styles */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.detail-table th,
.detail-table td {
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    text-align: left;
    transition: background 0.2s;
}

.detail-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .detail-table {
    background: #fff;
}

[data-theme="light"] .detail-table th {
    background: #f8fafc;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-full {
    grid-column: 1 / -1;
}

.modal-form label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.glass-select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    outline: none;
    appearance: none;
    /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.glass-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* File Input Sytling */
.file-upload-box {
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-upload-box:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Placeholder Transparency */
::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Image Preview Styling */
.file-upload-box {
    position: relative;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 200px;
    border-radius: 4px;
}

.remove-img-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}

.remove-img-btn:hover {
    background: #ef4444;
}

/* Zoom Modal */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
}

.image-zoom-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);

}

/* Authentication Overlay */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 32px;
}

.auth-card .logo {
    justify-content: center;
}

.text-danger {
    color: #ef4444;
}

.w-full {
    width: 100%;
}

.mb-24 {
    margin-bottom: 24px;
}

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

/* FullCalendar Theme Overrides */
.fc {
    --fc-border-color: var(--border-color);
    --fc-button-text-color: var(--fc-btn-text);
    --fc-button-bg-color: var(--fc-btn-bg);
    --fc-button-border-color: var(--border-color);
    --fc-event-bg-color: #3b82f6;
    --fc-event-border-color: #2563eb;
    --fc-today-bg-color: rgba(79, 70, 229, 0.05);
    --fc-page-bg-color: #ffffff;
}

.fc {
    color: var(--text-main);
}

.fc-theme-standard .fc-scrollgrid {
    border-color: var(--fc-border-color);
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--fc-border-color);
}

.fc-col-header-cell-cushion,
.fc-daygrid-day-number {
    color: var(--text-secondary);
    text-decoration: none !important;
}

.fc-col-header-cell-cushion:hover,
.fc-daygrid-day-number:hover {
    color: var(--text-main);
}

.fc-list-event-title,
.fc-list-event-time {
    color: var(--text-main) !important;
}

[data-theme="light"] .fc-list-day-cushion {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .fc-list-event:hover td {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .fc-list-day-text,
[data-theme="light"] .fc-list-day-side-text {
    color: var(--text-main) !important;
}


/* Helper for today's highlighting */
.fc-day-today {
    background-color: rgba(79, 70, 229, 0.1) !important;
}

/* Buttons */
.fc-button-primary {
    background: var(--fc-btn-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--fc-btn-text) !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transition: all 0.2s;
}

.fc-button-primary:hover,
.fc-button-primary:focus {
    background: var(--fc-btn-hover) !important;
    border-color: var(--border-color) !important;
    color: var(--fc-btn-text) !important;
}

.fc-button-active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

.fc-button-primary:disabled {
    opacity: 0.4 !important;
    background: var(--fc-btn-bg) !important;
    color: var(--fc-btn-text) !important;
}

/* Toolbar Title */
.fc-toolbar-title {
    font-size: 1.25rem !important;
    font-weight: 600;
    color: var(--text-main);
}

/* Events */
.fc-event {
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* TimeGrid slots */
.fc-timegrid-slot-label-cushion {
    color: var(--text-secondary);
}

.fc-timegrid-axis-cushion {
    color: var(--text-secondary);
}

/* List View */
.fc-list {
    border-color: var(--border-color);
}

.fc-list-day-cushion {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.fc-list-event:hover td {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Memo View Styles */
.notes-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.notes-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.notes-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    width: 100%;
    height: 100%;
}

.flex-1 {
    flex: 1;
}

.flex-col {
    flex-direction: column;
}

.h-full {
    height: 100%;
}

.mb-16 {
    margin-bottom: 16px;
}

.items-center {
    align-items: center;
}

.text-sm {
    font-size: 0.875rem;
}

/* Zebra List for Dashboard Items */
.zebra-list {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.zebra-list>div {
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.zebra-list>div:last-child {
    border-bottom: none;
}

.zebra-list>div:nth-child(even) {
    background: rgba(255, 255, 255, 0.1) !important;
    /* Lighter "White-ish" */
}

.zebra-list>div:nth-child(odd) {
    background: rgba(255, 255, 255, 0.03) !important;
    /* Subtle "Gray-ish" */
}

.zebra-list>div:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Bulk Preview Styles */
.bulk-preview-container {
    margin-top: 16px;
    max-height: 250px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.bulk-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.bulk-preview-table th {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    color: var(--text-secondary);
}

.bulk-preview-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.bulk-summary {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: bold;
}

/* ============================
   Gemini AI Analysis Styles
   ============================ */

.ai-analysis-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
}

[data-theme="light"] .ai-analysis-section {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.ai-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .ai-result-grid {
        grid-template-columns: 1fr;
    }
}

.ai-result-card {
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeInUp 0.5s ease-out both;
}

.ai-result-card:nth-child(1) {
    animation-delay: 0s;
}

.ai-result-card:nth-child(2) {
    animation-delay: 0.1s;
}

.ai-result-card:nth-child(3) {
    animation-delay: 0.2s;
}

.ai-result-card:nth-child(4) {
    animation-delay: 0.3s;
}

.ai-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .ai-card-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.ai-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.ai-card-body {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.ai-card-body p {
    margin-bottom: 8px;
}

.ai-card-body strong {
    color: var(--text-main);
}

.ai-card-body ul.ai-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.ai-card-body ul.ai-list li {
    padding: 6px 0 6px 20px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .ai-card-body ul.ai-list li {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.ai-card-body ul.ai-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.8rem;
}

.ai-card-body ul.ai-list li:last-child {
    border-bottom: none;
}

/* Loading Animation */
.ai-loading-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
    animation: aiPulse 2s ease-out infinite;
}

.ai-pulse-ring.delay-1 {
    animation-delay: 0.5s;
}

.ai-pulse-ring.delay-2 {
    animation-delay: 1s;
}

@keyframes aiPulse {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.ai-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: aiSpin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes aiSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {

    /* すべての要素を完全に非表示にする */
    body> :not(#print-area) {
        display: none !important;
    }

    /* print-area のみ強制的に表示する */
    #print-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: white !important;
        color: black !important;
    }

    /* Hide scrollbars and fix height for print */
    body {
        background: white !important;
        height: auto !important;
        overflow: visible !important;
    }
}