:root {
    --primary-color: #009ca8;
    /* 理由書AI Teal */
    --primary-dark: #007a85;
    --accent-color: #7c3aed;
    /* Purple for Evidence buttons */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --font-heading: 'Noto Sans JP', sans-serif;
    --font-body: 'Noto Sans JP', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

/* Header */
.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.brand-logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.header-user-wrapper {
    position: relative;
    margin-left: auto;
}

.header-user-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-md);
    transition: background 0.15s;
}

.header-user-btn:hover {
    background: rgba(255,255,255,0.12);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.header-user-detail {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    text-align: left;
}

.header-user-name {
    font-weight: 600;
    font-size: 0.82rem;
}

.header-user-office {
    font-size: 0.7rem;
    opacity: 0.7;
}

.header-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 200;
    overflow: hidden;
}

.header-user-wrapper.open .header-user-dropdown {
    display: block;
}

.header-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.1s;
}

.header-user-dropdown a:hover {
    background: #f3f4f6;
}

.header-user-dropdown a i {
    width: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.header-user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.header-nav a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Container */
.container-fluid {
    width: 100%;
    padding: 1.5rem 2rem;
    max-width: 1920px;
    margin: 0 auto;
}

/* Utility Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flex-wrap {
    flex-wrap: wrap;
}

.w-full {
    width: 100%;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    height: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background-color: white;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 156, 168, 0.1);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* Dense Checkboxes */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    background: #f9fafb;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.checkbox-item:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.checkbox-item input[type="checkbox"] {
    accent-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.9rem;
    text-decoration: none;
    gap: 0.5rem;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #16a34a;
}

.btn-ai {
    background-color: #f3e8ff;
    color: var(--accent-color);
    border: 1px solid #d8b4fe;
    font-size: 0.8rem;
}

.btn-ai:hover {
    background-color: #e9d5ff;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tr:hover {
    background-color: #f9fafb;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.table-checkbox-center {
    text-align: center;
    vertical-align: middle;
}

.w-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.status-done {
    background-color: #dcfce7;
    color: #166534;
}

.status-draft {
    background-color: #f3f4f6;
    color: #4b5563;
}

.status-generating {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Section Header for Form */
.form-section-header {
    background: #1f2937;
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
    align-items: center;
}

/* Upload Box for Grid */
.upload-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    background: #f9fafb;
    transition: all 0.2s;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-box:hover {
    border-color: var(--primary-color);
    background: #ecfeff;
}

/* Dashboard Redesign (Grid Layout) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 2rem;
    align-items: start;
    min-height: calc(100vh - 56px - 3rem);
}

/* Left Sidebar Menu */
.dashboard-sidebar {
    position: sticky;
    top: calc(56px + 1.5rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.menu-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background-color: white;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    height: 140px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

/* Background Image Overlay */
.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
    transition: all 0.3s;
}

/* Hover Effects */
.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.menu-card:hover::before {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.2) 100%);
}

/* Content z-index adjustment */
.menu-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.menu-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.menu-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.02em;
}

.menu-card-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Specific Backgrounds */
.menu-bg-create {
    background: linear-gradient(135deg, #009ca8, #0d9488);
    background-image: url('/shared/images/dashboard_bg_create.png');
    background-size: cover;
    background-position: center;
}

.menu-bg-history {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    background-image: url('/shared/images/dashboard_bg_history.png');
    background-size: cover;
    background-position: center;
}

.menu-bg-settings {
    background: linear-gradient(135deg, #64748b, #475569);
    background-image: url('/shared/images/dashboard_bg_settings.png');
    background-size: cover;
    background-position: center;
}

.menu-bg-search {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    background-image: url('/shared/images/dashboard_bg_search.png');
    background-size: cover;
    background-position: center;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ============================================
   Login Page (body.login-page)
   ============================================ */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.login-card {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border-color);
}

.login-logo {
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.login-logo i {
    color: var(--primary-color);
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .input-icon-wrapper {
    position: relative;
}

.login-form .input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.login-form .input-icon-wrapper .form-control {
    padding-left: 2.75rem;
    height: 48px;
}

.login-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    gap: 0.5rem;
    font-family: inherit;
}

.login-btn:hover {
    background-color: var(--primary-dark);
}

.login-btn:active {
    transform: scale(0.98);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
    border-left: 4px solid var(--danger-color);
}

.login-footer {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    color: #9ca3af;
    font-size: 0.8rem;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(56px + 1rem);
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    min-width: 300px;
    max-width: 450px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out forwards;
}

.toast.removing {
    animation: slideOutRight 0.3s ease-in forwards;
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-info {
    border-left: 4px solid var(--info-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ============================================
   Wizard / Slider Styles
   ============================================ */
.wizard-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wizard-steps-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wizard-step-item {
    text-align: left;
    white-space: nowrap;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wizard-step-item:hover {
    background-color: #f3f4f6;
}

.wizard-step-item.active {
    background-color: var(--primary-color);
    color: white;
}

.wizard-step-item.active i {
    color: white !important;
}

.wizard-slide {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.wizard-slide.active {
    display: block;
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    padding-bottom: 2rem;
}

/* Document Map Styles */
.document-map-container {
    width: 200px;
    flex-shrink: 0;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.document-minimap {
    width: 100%;
    background: white;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 1rem;
    aspect-ratio: 210 / 297;
}

.map-section {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    font-size: 0.6rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s;
    cursor: default;
    border-radius: 2px;
}

.map-section.active {
    background: #dbeafe;
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(0, 156, 168, 0.4);
    z-index: 10;
    transform: scale(1.02);
}

.map-basic {
    height: 15%;
}

.map-housing {
    height: 10%;
}

.map-manager {
    height: 10%;
}

.map-detail {
    height: 40%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: none;
    background: transparent;
}

.map-detail-row {
    flex: 1;
    background: #e2e8f0;
    width: 100%;
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-detail-row.active {
    background: #dbeafe;
    border-style: solid;
    border-color: var(--primary-color);
}

.map-overall {
    height: 15%;
}

/* ============================================
   Template Thumbnail Nav (Wizard)
   ============================================ */
.template-thumb-wrapper {
    width: 100%;
    margin-bottom: 0.75rem;
}

.template-thumb-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-align: center;
}

.template-thumb {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
}

.thumb-img {
    width: 100%;
    display: block;
    pointer-events: none;
}

.thumb-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.thumb-region {
    position: absolute;
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
    border-radius: 2px;
}

.thumb-region.active {
    border-color: rgba(0, 156, 168, 0.8);
    background: rgba(0, 156, 168, 0.15);
    box-shadow: 0 0 0 2px rgba(0, 156, 168, 0.3);
}

.thumb-region:hover:not(.active) {
    background: rgba(0, 156, 168, 0.06);
    border-color: rgba(0, 156, 168, 0.3);
}

/* ============================================
   Step Region Mapping Tool (Admin)
   ============================================ */
.step-mapping-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1rem;
    min-height: 500px;
}

.step-list-panel {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.step-list-item:hover {
    background: #f3f4f6;
}

.step-list-item.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    font-weight: 600;
}

.step-list-item .step-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-weight: 600;
}

.step-badge.configured {
    background: #dcfce7;
    color: #166534;
}

.step-badge.unconfigured {
    background: #f3f4f6;
    color: #9ca3af;
}

.draw-canvas-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.draw-page-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
}

.draw-page-tab {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.draw-page-tab:hover {
    color: #3b82f6;
}

.draw-page-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.draw-canvas-wrapper {
    position: relative;
    aspect-ratio: 297 / 210;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: white;
}

.draw-iframe {
    width: 1120px;
    height: 794px;
    border: none;
    transform-origin: 0 0;
    pointer-events: none;
}

.draw-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: crosshair;
}

.draw-rect {
    position: absolute;
    border: 2px solid #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 2px;
    pointer-events: auto;
    cursor: move;
}

.draw-rect .resize-handle {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border-radius: 2px;
    cursor: nwse-resize;
}

.draw-rect-label {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.65rem;
    color: #3b82f6;
    font-weight: 700;
    pointer-events: none;
}

/* ============================================
   Responsive
   ============================================ */

/* Tablet ~1280x800 */
@media (max-width: 1366px) {
    .container-fluid {
        padding: 1.25rem 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 380px 1fr;
        gap: 1.5rem;
    }

    .menu-card {
        height: 140px;
        padding: 1.25rem;
    }

    .header-nav {
        gap: 1rem;
    }

    .header-nav a {
        font-size: 0.82rem;
    }

    .data-table {
        font-size: 0.83rem;
    }

    .data-table th {
        padding: 0.6rem 0.75rem;
    }

    .data-table td {
        padding: 0.6rem 0.75rem;
    }
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 240px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .app-header {
        padding: 0 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: static;
    }

    .dashboard-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .menu-card {
        height: 120px;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .dashboard-menu {
        grid-template-columns: 1fr;
    }
}
