:root {
    /* Primary Colors - Indigo */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    
    /* Neutral Colors - Slate */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Semantic Colors */
    --success-color: #22c55e;
    --success-light: #dcfce7;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --info-color: #3b82f6;
    --info-light: #dbeafe;

    /* Backgrounds & Text */
    --bg-body: var(--slate-50);
    --bg-surface: #ffffff;
    --text-main: var(--slate-800);
    --text-muted: var(--slate-500);
    --border-color: var(--slate-200);

    /* Layout & Spacing */
    --header-height: 64px;
    --sidebar-width: 250px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-700);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--slate-900);
    color: var(--slate-300);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-logo i { color: var(--primary-400); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--slate-300);
    gap: 12px;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255,255,255,0.05);
    color: white;
    border-left: 3px solid var(--primary-500);
}

.nav-item i { width: 20px; text-align: center; }

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.top-header {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 16px; }

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--slate-600);
    cursor: pointer;
}

/* Content */
.content {
    flex: 1;
    padding: 24px;
}

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

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-800);
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body { padding: 20px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-700);
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--slate-900);
    background-color: #fff;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control:focus {
    border-color: var(--primary-500);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
textarea.form-control { min-height: 100px; resize: vertical; }

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: var(--radius-md);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}
.btn i { margin-right: 6px; }

.btn-primary {
    color: #fff;
    background-color: var(--primary-600);
    border-color: var(--primary-600);
}
.btn-primary:hover {
    background-color: var(--primary-700);
    border-color: var(--primary-700);
}

.btn-secondary {
    color: var(--slate-700);
    background-color: #fff;
    border-color: var(--slate-300);
}
.btn-secondary:hover {
    background-color: var(--slate-50);
    color: var(--slate-900);
}

.btn-danger {
    color: #fff;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}
.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

/* Tables */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--slate-800);
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px 16px;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}
.table th {
    vertical-align: bottom;
    font-weight: 600;
    background-color: var(--slate-50);
    color: var(--slate-600);
    font-size: 0.875rem;
    white-space: nowrap;
}
.table tbody tr:hover { background-color: var(--slate-50); }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-full);
    background-color: var(--slate-200);
    color: var(--slate-700);
}
.badge-primary { background-color: var(--primary-100); color: var(--primary-700); }
.badge-success { background-color: var(--success-light); color: var(--success-color); }
.badge-danger { background-color: var(--danger-light); color: var(--danger-color); }

/* Alerts */
.alert {
    position: relative;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert-success { background-color: var(--success-light); border-color: #bbf7d0; color: #166534; }
.alert-danger { background-color: var(--danger-light); border-color: #fecaca; color: #991b1b; }

/* Utilities */
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    color: var(--slate-700);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.pagination-btn:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
}
.pagination-btn.active {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
}
.pagination-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    color: var(--slate-400);
}
