:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --orange: #EA580C;
    --orange-light: #FFEDD5;
    --danger-light: #FECACA;
    --danger-strong: #DC2626;
    --bg-color: #F3F4F6;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--bg-color);
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-main);
}

* { box-sizing: border-box; }

/* Utils */
.text-muted { color: var(--text-muted); }
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Typography */
h1, h2, h3 { margin-top: 0; color: var(--text-main); }
a { text-decoration: none; color: inherit; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background-color: white; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-secondary:hover { background-color: #F9FAFB; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.75rem; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 0.375rem; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-danger { background-color: #FEE2E2; color: #B91C1C; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }
.form-group input, .form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Login View */
.login-container { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { width: 100%; max-width: 400px; padding: 2.5rem; border-radius: 1rem; }

/* Layout */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 250px; display: flex; flex-direction: column; z-index: 10; border-right: 1px solid var(--border-color); border-radius: 0; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); }
.sidebar-header h2 { font-size: 1.25rem; margin: 0; color: var(--primary); font-weight: 700; }
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.nav-item:hover, .nav-item.active {
    color: var(--primary);
    background-color: rgba(79, 70, 229, 0.05);
    border-left-color: var(--primary);
}
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); font-size: 0.875rem; }
.user-info { margin-bottom: 0.5rem; font-weight: 600; }

.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-header { padding: 1rem 2rem; border-bottom: 1px solid var(--border-color); border-radius: 0; z-index: 5; }
.main-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.view-container { flex: 1; overflow-y: auto; padding: 2rem; }

/* Kanban Dashboard */
.board-container { display: flex; gap: 1.5rem; height: 100%; align-items: flex-start; }
.board-column { flex: 1; display: flex; flex-direction: column; background: rgba(243, 244, 246, 0.5); border-radius: 0.75rem; padding: 1rem; min-height: 400px; border: 1px dashed var(--border-color); }
.board-column h3 { font-size: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border-color); margin-bottom: 1rem; }
.task-list { display: flex; flex-direction: column; gap: 0.75rem; }
.task-card { background: white; padding: 1rem; border-radius: 0.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-size: 0.875rem; border-left: 4px solid var(--primary); position: relative; transition: transform 0.1s; }
.task-card:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.task-card.due-today { background-color: var(--warning-light); border-left-color: var(--warning); }
.task-card.due-past { background-color: var(--danger-light); border-left-color: var(--danger-strong); }

.task-card .company { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.task-card .procedure { color: var(--text-muted); margin-bottom: 0.5rem; font-size: 0.8rem; }
.task-card .dates { font-size: 0.75rem; display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.task-card .actions { display: flex; justify-content: flex-end; }

/* Filters */
.filters-bar { background: white; padding: 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem; display: flex; gap: 1rem; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* Data Tables */
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 0.5rem; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 0.875rem; }
.data-table th { background: #F9FAFB; font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.75rem; }
.data-table tr:hover { background: #F9FAFB; }

/* Two column layout for forms */
.row { display: flex; flex-wrap: wrap; margin: -0.5rem; }
.col { flex: 1; padding: 0.5rem; min-width: 200px; }

/* AutoComplete dropdown */
.autocomplete-items { position: absolute; border: 1px solid var(--border-color); border-top: none; z-index: 99; top: 100%; left: 0; right: 0; background-color: #fff; max-height: 200px; overflow-y: auto; border-radius: 0 0 0.375rem 0.375rem; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.autocomplete-items div { padding: 10px; cursor: pointer; font-size: 0.875rem; }
.autocomplete-items div:hover { background-color: #e9e9e9; }
.autocomplete-wrapper { position: relative; }

/* Excel-like Filter Popup */
.filter-popup { position: absolute; background: white; border: 1px solid var(--border-color); box-shadow: 0 4px 12px rgba(0,0,0,0.15); border-radius: 0.375rem; padding: 0.5rem; z-index: 1000; width: 200px; font-size: 0.875rem; }
.filter-popup-header { display: flex; justify-content: space-between; margin-bottom: 5px; font-weight: 600; }
.filter-popup-search { width: 100%; padding: 4px; margin-bottom: 5px; border: 1px solid #ddd; border-radius: 3px; }
.filter-popup-items { max-height: 200px; overflow-y: auto; margin-bottom: 5px; }
.filter-popup-item { padding: 4px; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.filter-popup-item:hover { background-color: #f3f4f6; }
.th-filter { display: inline-flex; align-items: center; justify-content: space-between; width: 100%; cursor: pointer; }
.th-filter:hover { background-color: rgba(0,0,0,0.02); }
.filter-icon { color: #aaa; margin-left: auto; padding-left: 5px; font-size: 10px; }
.filter-icon.active { color: var(--primary); }
.filter-bar-kanban { display: flex; gap: 10px; margin-bottom: 10px; }
