/**
 * ブリーダーCRM - スタイルシート
 * MUJI inspired minimal design
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
    --primary: #3c3c43;
    --primary-light: #6d6d72;
    --primary-dark: #2f2f34;
    --brand-red: #7f0019;
    --accent-red: #dd0c14;
    --kinari: #f4eede;
    --beige: #e0ceaa;
    --bg-canvas: #f1f1ef;
    --bg-main: #f7f7f4;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --surface-header: #fbfaf7;
    --surface-label: #efede8;
    --surface-hover: #f4f3ef;
    --text-primary: #3c3c43;
    --text-secondary: #6d6d72;
    --text-muted: #76767b;
    --text-disabled: #9d9da0;
    --border: #d0cdc5;
    --border-light: #e6e3dc;
    --border-strong: #bdb8ad;
    --success: #4f6f52;
    --warning: #9b6a20;
    --danger: #dd0c14;
    --info: #6d6d72;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: none;
    --radius: 0;
    --radius-sm: 0;
    --radius-lg: 0;
    --radius-control: 4px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Arial, "Noto Sans JP", "Noto Sans JP Fallback", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    background: var(--bg-canvas);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 15px;
    font-feature-settings: normal;
    font-kerning: auto;
    letter-spacing: 0;
    overflow-wrap: break-word;
    line-break: strict;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

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

.alert-badge {
    position: relative;
    padding: 8px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
}

.alert-badge:hover {
    background: #fee2e2;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.user-menu:hover {
    background: var(--bg-main);
    text-decoration: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Main Layout ===== */
.main-container {
    display: flex;
    min-height: calc(100vh - 64px);
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    overflow-y: auto;
}

.menu-section {
    margin-bottom: 16px;
}

.menu-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    margin-bottom: 4px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.15s;
    cursor: pointer;
}

.menu-item:hover {
    background: var(--bg-main);
    color: var(--text-primary);
    text-decoration: none;
}

.menu-item.active {
    background: var(--primary);
    color: white;
}

.menu-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Content Area ===== */
.content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    min-width: 0;
}

.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

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

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Quick Actions ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.quick-action-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.quick-action-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    text-decoration: none;
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.quick-action-icon svg,
.quick-action-icon .svg-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.quick-action-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

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

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg,
.stat-icon .svg-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.stat-icon.blue { background: #eff6ff; color: var(--info); }
.stat-icon.green { background: #ecfdf5; color: var(--success); }
.stat-icon.orange { background: #fffbeb; color: var(--warning); }
.stat-icon.gray { background: var(--bg-main); color: var(--primary); }

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-change {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-action {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.card-action:hover {
    text-decoration: underline;
}

.card-body {
    padding: 16px 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-main);
}

/* ===== Dashboard Grid ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* ===== Lists ===== */
.recent-list {
    display: flex;
    flex-direction: column;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-muted);
    flex-shrink: 0;
}

.recent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-avatar svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.recent-info {
    flex: 1;
    min-width: 0;
}

.recent-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.recent-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.recent-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

.badge-breeding { background: #fef3c7; color: #92400e; }
.badge-sold { background: #d1fae5; color: #065f46; }
.badge-available { background: #dbeafe; color: #1e40af; }

/* ===== Alerts ===== */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}

.alert-item.danger { background: #fef2f2; }
.alert-item.warning { background: #fffbeb; }
.alert-item.info { background: #eff6ff; }

.alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.alert-dot.danger { background: var(--danger); }
.alert-dot.warning { background: var(--warning); }
.alert-dot.info { background: var(--info); }

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.alert-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Flash Messages */
.flash {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.flash-success,
.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-danger,
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-warning,
.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.flash-info,
.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: " *";
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(96, 107, 115, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--bg-main);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover {
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

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

.btn-secondary:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-main);
}

.table td {
    font-size: 14px;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--bg-main);
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.badge-primary { background: var(--primary); color: white; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gray { background: var(--bg-main); color: var(--text-secondary); }

/* ===== Auth Page ===== */
.auth-page {
    background: var(--bg-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.auth-box h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--text-muted);
}

.empty-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
}

.pagination li {
    display: flex;
    align-items: center;
    list-style: none;
}

.pagination a,
.pagination span {
    min-width: 38px;
    min-height: 34px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--bg-white);
}

.pagination a:hover {
    background: var(--bg-main);
    color: var(--text-primary);
    text-decoration: none;
}

.pagination .active,
.pagination .active span {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination li.active {
    background: transparent;
}

/* ===== Search & Filter ===== */
.search-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-input input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-white);
}

.search-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-input svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Mobile Navigation ===== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
}

.mobile-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary);
    text-decoration: none;
}

.mobile-nav-icon {
    width: 24px;
    height: 24px;
}

.mobile-nav-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }

    body {
        padding-bottom: 70px;
    }

    .content,
    .main {
        padding: 16px;
    }

    .header {
        padding: 0 16px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .quick-action-card {
        padding: 16px 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .user-info {
        display: none;
    }

    .page-title {
        font-size: 20px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .animal-detail-header,
    .animal-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .animal-detail-title {
        font-size: 24px;
    }

    .animal-action-row,
    .detail-grid,
    .detail-note-list {
        grid-template-columns: 1fr;
    }

    .detail-list > div {
        grid-template-columns: 1fr;
    }

    .detail-list dt {
        padding-bottom: 4px;
        background: transparent;
    }

    .detail-list dd {
        padding-top: 4px;
    }

    .card-body {
        padding: 12px 16px;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn {
        min-height: 44px;
    }

    .form-control {
        min-height: 44px;
        font-size: 16px;
    }

    .footer {
        display: none;
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header {
        height: 56px;
    }

    .logo-text {
        font-size: 16px;
    }

    .alert-badge span {
        display: none;
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-action-card,
.stat-card,
.card {
    animation: fadeInUp 0.4s ease-out;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.d-none { display: none; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ===== Responsive List/Table Toggle ===== */
.list-view { display: none; }
.table-view { display: block; }

@media (max-width: 768px) {
    .table-view { display: none; }
    .list-view { display: block; }
}

/* ===== List Items (Mobile) ===== */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s;
}
.list-item:hover {
    background: var(--bg-main);
    text-decoration: none;
}
.list-item-avatar {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    flex-shrink: 0;
}
.list-item-avatar.alert-danger { background: #fee2e2; }
.list-item-avatar.alert-warning { background: #fef3c7; }
.list-item-avatar.alert-info { background: #dbeafe; }
.list-item-content {
    flex: 1;
    min-width: 0;
}
.list-item-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.list-item-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}
.list-item-action {
    flex-shrink: 0;
}

/* ===== Floating Action Button ===== */
.fab {
    position: fixed;
    right: 20px;
    bottom: 84px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 90;
    text-decoration: none;
}
.fab:hover {
    background: var(--primary-dark);
    text-decoration: none;
}
@media (max-width: 768px) {
    .fab { display: flex; }
}

/* ===== Badge Secondary ===== */
.badge-secondary {
    background: var(--bg-main);
    color: var(--text-secondary);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab {
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: 14px;
    transition: all 0.15s;
}
.tab:hover {
    color: var(--text-primary);
    text-decoration: none;
}
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

/* ===== Image Gallery ===== */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-main);
}
.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-item-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* ===== Table Responsive ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.search-bar-input {
    flex: 1;
}
.search-reset {
    cursor: pointer;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.empty-state-message {
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ===== SVG Icons ===== */
.svg-icon {
    --icon-url: none;
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    flex: 0 0 auto;
    background: currentColor;
    vertical-align: -0.2em;
    -webkit-mask: var(--icon-url) center / contain no-repeat;
    mask: var(--icon-url) center / contain no-repeat;
}

.icon-alert-triangle { --icon-url: url("../icons/alert-triangle.svg"); }
.icon-animal-add { --icon-url: url("../icons/animal-add.svg"); }
.icon-birth { --icon-url: url("../icons/birth.svg"); }
.icon-building { --icon-url: url("../icons/building.svg"); }
.icon-cat { --icon-url: url("../icons/cat.svg"); }
.icon-check { --icon-url: url("../icons/check.svg"); }
.icon-clipboard { --icon-url: url("../icons/clipboard.svg"); }
.icon-clipboard-check { --icon-url: url("../icons/clipboard-check.svg"); }
.icon-dna { --icon-url: url("../icons/dna.svg"); }
.icon-document { --icon-url: url("../icons/document.svg"); }
.icon-dog { --icon-url: url("../icons/dog.svg"); }
.icon-heart { --icon-url: url("../icons/heart.svg"); }
.icon-hospital { --icon-url: url("../icons/hospital.svg"); }
.icon-mating { --icon-url: url("../icons/mating.svg"); }
.icon-mating-check { --icon-url: url("../icons/mating-check.svg"); }
.icon-paw { --icon-url: url("../icons/paw.svg"); }
.icon-phone { --icon-url: url("../icons/phone.svg"); }
.icon-pill { --icon-url: url("../icons/pill.svg"); }
.icon-plus { --icon-url: url("../icons/plus.svg"); }
.icon-report { --icon-url: url("../icons/report.svg"); }
.icon-sale { --icon-url: url("../icons/sale.svg"); }
.icon-scale { --icon-url: url("../icons/scale.svg"); }
.icon-stethoscope { --icon-url: url("../icons/stethoscope.svg"); }
.icon-syringe { --icon-url: url("../icons/syringe.svg"); }
.icon-user { --icon-url: url("../icons/user.svg"); }
.icon-user-plus { --icon-url: url("../icons/user-plus.svg"); }

.list-item-avatar .svg-icon {
    width: 24px;
    height: 24px;
}

.list-item-avatar.alert-danger {
    color: var(--danger);
}

.empty-state-icon .svg-icon {
    width: 1em;
    height: 1em;
}

.fab .svg-icon {
    width: 24px;
    height: 24px;
}

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

.table-alert {
    color: var(--danger);
}

/* ===== Dashboard Layout ===== */
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}
.dashboard-col {
    min-width: 0;
}
@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Header Left ===== */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Sidebar Nav ===== */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}
@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }
}

/* ===== Form Check ===== */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
}
.form-check-label {
    font-size: 14px;
    color: var(--text-primary);
}

/* ===== Alert Base ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.alert a {
    color: inherit;
    text-decoration: underline;
}

/* ===== Badge Count (Notification) ===== */
.badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Filter Chips ===== */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

/* ===== Info Table ===== */
.info-table {
    width: 100%;
}
.info-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--bg-main);
    font-weight: 500;
    width: 30%;
}
.info-table td {
    padding: 8px 12px;
}

/* ===== Animal Info ===== */
.animal-info {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* ===== Animal Detail Page ===== */
.animal-detail-page {
    max-width: 1180px;
    margin: 0 auto;
}

.animal-detail-header {
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.animal-title-block {
    min-width: 0;
}

.detail-back-link {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.animal-detail-title {
    margin: 0 0 12px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
}

.animal-badges,
.animal-header-actions,
.detail-footer-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.animal-header-actions {
    justify-content: flex-end;
    flex-shrink: 0;
}

.animal-action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.animal-action {
    min-height: 56px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    text-decoration: none;
}

.animal-action:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.animal-action svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    color: var(--primary);
    flex-shrink: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.detail-panel {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    overflow: hidden;
}

.detail-panel-wide {
    grid-column: 1 / -1;
}

.detail-panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    background: #fbfcfd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-panel-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: minmax(120px, 34%) minmax(0, 1fr);
    border-bottom: 1px solid var(--border-light);
}

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

.detail-list dt,
.detail-list dd {
    margin: 0;
    min-width: 0;
    padding: 13px 16px;
}

.detail-list dt {
    color: var(--text-muted);
    background: #f8fafb;
    font-size: 12px;
    font-weight: 700;
}

.detail-list dd {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.detail-list dd a {
    font-weight: 700;
}

.detail-empty,
.detail-empty-state,
.detail-subtext {
    color: var(--text-muted);
}

.detail-empty-state {
    margin: 0;
    padding: 18px 16px;
    font-size: 13px;
}

.detail-subtext {
    display: inline-flex;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 500;
}

.detail-note,
.detail-note-list {
    margin: 0;
    padding: 16px;
}

.detail-note-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    list-style: none;
}

.detail-note-list li {
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fbfcfd;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.detail-footer-actions {
    margin-top: 20px;
}

.detail-footer-actions form {
    margin: 0;
}

/* ===== Meta Row ===== */
.meta-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== PDF / Report Specific Styles ===== */
.stamp-area {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    margin-top: 32px;
}
.stamp-box {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
}
.check-table {
    width: 100%;
    border-collapse: collapse;
}
.check-table th,
.check-table td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}
.check-table th {
    background: var(--bg-main);
    font-weight: 500;
}
.breeder-section,
.vet-section {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.breeder-section h3,
.vet-section h3 {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* ===== Date/Period/Summary for Reports ===== */
.date-line {
    text-align: right;
    margin-bottom: 16px;
    color: var(--text-secondary);
}
.period {
    margin-bottom: 16px;
    font-weight: 500;
}
.summary {
    background: var(--bg-main);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.result {
    padding: 12px 16px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}
.detail {
    font-size: 13px;
    color: var(--text-secondary);
}
.note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}
.num {
    font-family: 'Inter', monospace;
    font-weight: 500;
}
.circle {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    display: inline-block;
}

/* ===== Quick Action (for show pages) ===== */
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12px;
    min-width: 80px;
}
.quick-action:hover {
    background: var(--border);
    text-decoration: none;
}

/* ===== Page Classes ===== */
.page {
    max-width: 210mm;
    margin: 0 auto;
    padding: 20mm;
    background: white;
}

/* ===== MUJI Theme Refinement ===== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

a {
    color: var(--text-primary);
}

a:hover {
    color: var(--brand-red);
}

.header {
    height: 72px;
    padding: 0 32px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    border-radius: 0;
    background: var(--primary);
}

.logo-text {
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0;
}

.header-right {
    gap: 20px;
}

.alert-badge {
    min-width: 72px;
    border-radius: var(--radius-control);
    border-color: #f0c5c8;
    background: #fff;
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
}

.alert-badge:hover,
.user-menu:hover {
    background: var(--bg-main);
}

.user-menu {
    border-radius: 0;
    padding: 6px 0;
}

.user-avatar {
    border-radius: 0;
    background: var(--primary);
}

.main-container {
    min-height: calc(100vh - 72px);
}

.sidebar {
    width: 272px;
    padding: 32px 20px;
    background: #fff;
    border-right: 1px solid var(--border);
    gap: 0;
}

.menu-section {
    margin-bottom: 28px;
}

.menu-label {
    padding: 0 12px 8px;
    margin-bottom: 6px;
    color: var(--text-disabled);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.menu-item {
    min-height: 44px;
    padding: 10px 12px;
    border-left: 3px solid transparent;
    border-radius: 0;
    color: var(--text-secondary);
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.menu-item:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.menu-item.active {
    border-left-color: var(--brand-red);
    background: var(--kinari);
    color: var(--text-primary);
    font-weight: 700;
}

.content,
.main-content {
    padding: 40px;
    background: var(--bg-canvas);
}

.main,
.animal-detail-page {
    max-width: 1120px;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0;
}

.page-subtitle {
    color: var(--text-secondary);
    line-height: 1.6;
}

.quick-actions,
.stats-grid,
.dashboard-grid,
.dashboard-row {
    gap: 24px;
}

.quick-action-card,
.stat-card,
.card,
.detail-panel,
.auth-box {
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    animation: none;
    background: #fff;
}

.quick-action-card {
    min-height: 132px;
    padding: 20px;
    align-items: flex-start;
    justify-content: space-between;
    background: #fff;
}

.quick-action-card:hover {
    border-color: var(--primary);
    box-shadow: none;
    transform: none;
}

.quick-action-icon,
.stat-icon,
.recent-avatar,
.list-item-avatar {
    border-radius: 0;
    background: var(--bg-main);
    color: var(--text-primary);
}

.quick-action-label,
.recent-name,
.list-item-title {
    font-weight: 700;
}

.stat-card {
    padding: 22px 24px;
    background: #fff;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.stat-icon.blue,
.stat-icon.green,
.stat-icon.orange,
.stat-icon.gray {
    background: var(--bg-main);
    color: var(--text-primary);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0;
}

.card {
    margin-bottom: 24px;
}

.card-header,
.detail-panel-header {
    padding: 16px 20px;
    background: var(--surface-header);
    border-bottom: 1px solid var(--border);
}

.card-title,
.detail-panel-header h2 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--bg-main);
}

.card-action {
    color: var(--text-secondary);
    font-weight: 700;
}

.card-action:hover {
    color: var(--brand-red);
}

.form-label,
.form-check-label {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
}

.form-control,
.search-input input {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: #fff;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    transition: border-color 0.15s;
}

.form-control:focus,
.search-input input:focus {
    border-color: var(--primary);
    box-shadow: none;
}

.form-control:disabled {
    background: var(--bg-main);
    color: var(--text-disabled);
}

select.form-control {
    background-position: right 12px center;
}

.btn {
    min-height: 36px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
    border-color: var(--primary);
    background: var(--primary);
}

.btn-primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.btn-secondary,
.btn-outline {
    border-color: var(--border);
    background: transparent;
    color: var(--text-primary);
}

.btn-secondary:hover,
.btn-outline:hover {
    border-color: var(--primary);
    background: var(--bg-main);
    color: var(--text-primary);
}

.btn-danger {
    border-color: var(--danger);
    background: var(--danger);
}

.btn-danger:hover {
    border-color: #b6080e;
    background: #b6080e;
}

.btn-success {
    border-color: var(--brand-red);
    background: var(--brand-red);
}

.btn-success:hover {
    border-color: #5f0013;
    background: #5f0013;
}

.btn-sm {
    min-height: 34px;
    padding: 7px 14px;
}

.btn-lg {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 13px;
}

.table {
    background: #fff;
}

.table th,
.table td,
.check-table th,
.check-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.table th,
.check-table th,
.info-table th {
    background: var(--surface-label);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.table td,
.info-table td {
    color: var(--text-primary);
    font-size: 14px;
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

.badge,
.recent-badge,
.badge-count {
    border-radius: var(--radius-control);
    font-weight: 700;
    letter-spacing: 0;
}

.badge {
    border: 1px solid transparent;
    font-size: 11px;
}

.alert-badge .badge-count {
    top: -6px;
    right: 5px;
}

.badge-primary {
    background: var(--primary);
    color: #fff;
}

.badge-success,
.badge-sold {
    border-color: #d9e5d7;
    background: #f2f6f0;
    color: #3f5d43;
}

.badge-warning,
.badge-breeding {
    border-color: #ead8b1;
    background: #fbf6ea;
    color: #765319;
}

.badge-danger {
    border-color: #f0c5c8;
    background: #fff5f5;
    color: var(--danger);
}

.badge-info,
.badge-available,
.badge-gray,
.badge-secondary {
    border-color: var(--border-light);
    background: var(--bg-main);
    color: var(--text-secondary);
}

.badge-gender,
.badge-status {
    min-width: 54px;
    justify-content: center;
}

.badge-gender-male {
    border-color: #b7c9dc;
    background: #eef5fb;
    color: #31506f;
}

.badge-gender-female {
    border-color: #e7c2ca;
    background: #fff3f5;
    color: #8a3d4d;
}

.badge-gender-unknown {
    border-color: var(--border-light);
    background: var(--bg-main);
    color: var(--text-secondary);
}

.badge-status-alive {
    border-color: #bfd7bf;
    background: #f1f7ef;
    color: #365f39;
}

.badge-status-sold {
    border-color: #e6cf9e;
    background: #fbf4e4;
    color: #7a5518;
}

.badge-status-dead {
    border-color: #c8c8c8;
    background: #eeeeec;
    color: #55565a;
}

.animal-inline-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.flash,
.alert,
.alert-item,
.summary,
.result,
.quick-action {
    border-radius: 0;
}

.flash-success,
.alert-success {
    background: #f2f6f0;
    color: #3f5d43;
    border-color: #d9e5d7;
}

.flash-danger,
.alert-danger {
    background: #fff5f5;
    color: var(--danger);
    border-color: #f0c5c8;
}

.flash-warning,
.alert-warning {
    background: #fbf6ea;
    color: #765319;
    border-color: #ead8b1;
}

.flash-info,
.alert-info {
    background: var(--bg-main);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

.auth-page {
    background: var(--kinari);
}

.auth-box {
    padding: 40px;
    background: #fff;
}

.auth-logo {
    color: var(--text-primary);
    font-size: 26px;
    font-weight: 700;
}

.pagination a,
.pagination span,
.tabs .tab {
    border-radius: 0;
}

.pagination .active,
.pagination .active span,
.tab.active {
    color: var(--text-primary);
    border-color: var(--primary);
    background: var(--kinari);
}

.image-item,
.image-item-remove,
.fab,
.circle {
    border-radius: 0;
}

.fab {
    background: var(--primary);
    box-shadow: none;
}

.animal-detail-header.card {
    margin-bottom: 20px;
    padding: 24px;
}

.detail-back-link {
    color: var(--text-secondary);
    font-weight: 700;
}

.animal-detail-title {
    font-size: 32px;
    line-height: 1.6;
}

.animal-action {
    min-height: 60px;
    border-color: var(--border-light);
    border-radius: 0;
    background: #fff;
    font-weight: 700;
}

.animal-action:hover {
    border-color: var(--primary);
    box-shadow: none;
}

.animal-action svg {
    color: var(--brand-red);
}

.detail-grid {
    gap: 24px;
}

.detail-panel {
    background: #fff;
    border-color: var(--border);
}

.detail-list > div {
    grid-template-columns: minmax(132px, 32%) minmax(0, 1fr);
    border-bottom-color: var(--border-light);
}

.detail-list dt,
.detail-list dd {
    padding: 14px 16px;
    line-height: 1.6;
}

.detail-list dt {
    background: var(--surface-label);
    border-right: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.detail-list dd {
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.detail-empty,
.detail-empty-state,
.detail-subtext {
    color: var(--text-disabled);
}

.detail-subtext {
    margin-left: 10px;
}

.detail-note-list {
    gap: 12px;
}

.detail-note-list li {
    border-color: var(--border-light);
    border-radius: 0;
    background: var(--bg-main);
    color: var(--text-secondary);
}

.breeder-section,
.vet-section,
.stamp-box {
    border-radius: 0;
}

.quick-action-card,
.stat-card,
.card {
    animation: none !important;
}

/* ===== Customer Pages ===== */
.customer-page,
.customer-detail-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.customer-directory-card,
.customer-profile-hero,
.customer-panel {
    margin-bottom: 20px;
    border: 1px solid var(--border);
    background: #fff;
}

.customer-directory-card,
.customer-profile-hero {
    border-top: 4px solid var(--primary);
}

.customer-directory-header,
.customer-profile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px;
    background: #fff;
}

.customer-directory-header {
    border-bottom: 1px solid var(--border);
}

.customer-kicker {
    margin: 0 0 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.customer-directory-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.45;
}

.customer-directory-tools {
    display: grid;
    grid-template-columns: auto minmax(360px, 520px);
    gap: 16px 24px;
    align-items: center;
    padding: 18px 24px;
    background: var(--surface-header);
    border-bottom: 1px solid var(--border);
}

.customer-list-card .card-header,
.customer-detail-header {
    min-height: auto;
}

.search-bar form {
    flex: 1;
    min-width: 0;
}

.search-bar-input {
    width: 100%;
}

.customer-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
    gap: 16px 24px;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.customer-filter {
    margin-bottom: 0;
}

.filter-chip {
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: #fff;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

.filter-chip:hover {
    border-color: var(--primary);
    background: var(--surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.filter-chip.active {
    border-color: var(--primary);
    background: var(--kinari);
    color: var(--text-primary);
}

.customer-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.customer-search-input {
    width: 100%;
}

.customer-record-list {
    display: grid;
}

.customer-record-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px) auto;
    gap: 20px;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    text-decoration: none;
}

.customer-record-card:last-child {
    border-bottom: none;
}

.customer-record-card:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.customer-record-primary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.customer-record-name {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
}

.customer-record-subtitle {
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.customer-record-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.customer-record-stat {
    min-width: 0;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.customer-record-stat span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.customer-record-stat strong {
    display: block;
    margin-top: 3px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.customer-record-action {
    min-height: 34px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
}

.customer-table th,
.customer-table td,
.customer-history-table th,
.customer-history-table td {
    vertical-align: middle;
}

.customer-table th:first-child,
.customer-table td:first-child {
    width: 112px;
}

.customer-table th:nth-child(5),
.customer-table td:nth-child(5) {
    width: 104px;
    text-align: right;
}

.customer-table th:last-child,
.customer-table td:last-child {
    width: 96px;
    text-align: right;
}

.customer-empty-state {
    padding: 44px 24px;
}

.customer-detail-header {
    padding: 20px 24px;
    border-color: var(--border-strong);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.customer-profile-top {
    padding-bottom: 20px;
}

.customer-contact-panel .customer-field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-contact-panel .customer-field:nth-child(2n) {
    border-right: 1px solid var(--border-light);
}

.customer-contact-panel .customer-field:nth-child(3n) {
    border-left: none;
    border-right: none;
}

.customer-title-block {
    min-width: 0;
}

.customer-detail-title {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.45;
}

.customer-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.customer-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
}

.customer-header-actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
}

.customer-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

.customer-panel {
    overflow: hidden;
}

.customer-panel-header {
    min-height: 68px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.customer-panel-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
}

.customer-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-field {
    min-width: 0;
    min-height: 84px;
    padding: 16px 18px;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: #fff;
}

.customer-field:nth-child(2n) {
    border-right: none;
}

.customer-field-label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.customer-field-value {
    display: block;
    margin-top: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.customer-panel-body {
    padding: 18px 20px;
}

.customer-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.customer-detail-page .detail-list > div {
    grid-template-columns: 176px minmax(0, 1fr);
}

.customer-note {
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.8;
}

.customer-empty-text {
    margin: 0;
    padding: 18px 20px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.customer-panel-body .customer-empty-text {
    padding: 0;
}

.customer-followup-header {
    min-height: 60px;
}

.customer-follow-list .list-item {
    padding: 14px 16px;
    border-color: var(--border-light);
}

.customer-follow-list .list-item:last-child {
    border-bottom: none;
}

/* ===== Report Pages ===== */
.report-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.report-hero {
    margin-bottom: 20px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    background: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.report-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.45;
}

.report-subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}

.report-filter-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    padding: 18px 20px;
}

.report-filter-form-compact {
    grid-template-columns: minmax(240px, 420px) auto;
}

.report-filter-field {
    min-width: 0;
}

.report-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-stat-grid .customer-field:nth-child(2n) {
    border-right: 1px solid var(--border-light);
}

.report-stat-grid .customer-field:nth-child(3n) {
    border-right: none;
}

.report-table-panel .table-responsive {
    margin: 0;
}

.report-table {
    margin: 0;
}

.report-table th,
.report-table td {
    vertical-align: middle;
}

.report-table tbody tr:last-child td {
    border-bottom: none;
}

.report-list-view {
    display: block;
}

/* ===== Legacy Page Alignment ===== */
.content > .card {
    max-width: 1120px;
    margin: 0 auto 20px;
    border-color: var(--border);
    border-top: 4px solid var(--primary);
    background: #fff;
}

.content > .card + .card {
    margin-top: 20px;
}

.card-header {
    min-height: 68px;
    padding: 16px 20px;
    border-bottom-color: var(--border);
    background: var(--surface-header);
    gap: 16px;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
}

.card-body {
    padding: 18px 20px 20px;
    background: #fff;
}

.card-footer {
    padding: 18px 20px;
    border-top-color: var(--border);
    background: var(--surface-header);
}

.card-body > form.mb-3 {
    margin: -18px -20px 20px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-header);
}

.card-body > form.mb-3 .form-row,
.card-body form[data-validate] .form-row,
.card-body form[data-validate] .form-row-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.card-body > form.mb-3 .form-group,
.card-body form[data-validate] .form-group {
    min-width: 0;
    margin-bottom: 0;
}

.card-body > form.mb-3 .form-row + .form-row,
.card-body form[data-validate] .form-row + .form-row,
.card-body form[data-validate] .form-row-3 + .form-row,
.card-body form[data-validate] .form-row + .form-row-3 {
    margin-top: 16px;
}

.card-body > form.mb-3 .d-flex,
.card-body > form.mb-3 > .btn,
.card-body form[data-validate] .form-actions {
    margin-top: 18px;
}

.card-body form[data-validate] h3,
.card-body > h3 {
    margin: 26px -20px 16px;
    padding: 13px 20px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface-header);
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
}

.card-body form[data-validate] h3:first-of-type,
.card-body > h3:first-child {
    margin-top: -18px;
    border-top: none;
}

.card-body .form-check {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    background: var(--surface-header);
}

.card-body .form-check-label {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.form-actions {
    justify-content: flex-end;
}

.table {
    margin: 0;
}

.table th {
    background: var(--surface-header);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.table th,
.table td {
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    border: 1px solid var(--border-light);
}

.table-responsive .table th:first-child,
.table-responsive .table td:first-child {
    padding-left: 16px;
}

.content > .card > .card-body > .table-responsive,
.content > .card > .card-body > .list-view,
.content > .card > .card-body > .table-view {
    margin-top: 18px;
}

.content > .card > .card-body > form.mb-3 + .list-view,
.content > .card > .card-body > form.mb-3 + .table-view {
    margin-top: 0;
}

/* ===== Structured Forms ===== */
.structured-form {
    display: grid;
    gap: 20px;
}

.structured-form-body {
    padding: 18px 20px 20px;
    display: grid;
    gap: 18px;
}

.structured-form-grid {
    display: grid;
    gap: 16px;
}

.structured-form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.structured-form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.structured-form .form-group {
    min-width: 0;
    margin-bottom: 0;
}

.structured-check {
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: var(--surface-header);
}

.structured-check .form-check-label {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.structured-form textarea.form-control {
    min-height: 104px;
}

.structured-actions {
    margin: 0;
    padding: 18px 20px;
    border: 1px solid var(--border);
    background: #fff;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 768px) {
    .header {
        height: 64px;
        padding: 0 16px;
    }

    .header-right {
        gap: 8px;
    }

    .alert-badge {
        min-width: 44px;
        padding: 8px 10px;
    }

    .user-menu {
        gap: 0;
    }

    .user-name {
        display: none;
    }

    .content,
    .main,
    .main-content {
        padding: 20px 16px;
    }

    .page-title,
    .animal-detail-title,
    .customer-detail-title {
        font-size: 22px;
    }

    .quick-action-card,
    .stat-card,
    .card-body,
    .animal-detail-header.card,
    .customer-detail-header.card {
        padding: 16px;
    }

    .animal-detail-header,
    .animal-header-actions,
    .customer-detail-header {
        flex-direction: column;
        align-items: stretch;
    }

    .animal-header-actions .btn,
    .customer-header-actions .btn {
        width: 100%;
    }

    .customer-toolbar {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .customer-directory-header,
    .customer-profile-top {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 20px;
    }

    .customer-directory-tools {
        grid-template-columns: 1fr;
        padding: 16px 20px;
    }

    .customer-search {
        grid-template-columns: 1fr;
    }

    .customer-search .btn {
        width: 100%;
    }

    .customer-record-card {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px 20px;
    }

    .customer-record-meta {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .customer-record-action {
        justify-self: start;
    }

    .customer-overview-grid,
    .customer-field-grid {
        grid-template-columns: 1fr;
    }

    .customer-contact-panel .customer-field-grid {
        grid-template-columns: 1fr;
    }

    .customer-contact-panel .customer-field:nth-child(2n),
    .customer-contact-panel .customer-field:nth-child(3n),
    .customer-field,
    .customer-field:nth-child(2n) {
        border-right: none;
    }

    .customer-panel-header {
        min-height: 60px;
        padding: 14px 16px;
    }

    .customer-panel-body,
    .customer-empty-text {
        padding: 16px;
    }

    .customer-panel-body .customer-empty-text {
        padding: 0;
    }

    .report-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 20px;
    }

    .report-title {
        font-size: 22px;
    }

    .report-filter-form,
    .report-filter-form-compact,
    .report-stat-grid {
        grid-template-columns: 1fr;
    }

    .report-filter-form .btn {
        width: 100%;
    }

    .report-stat-grid .customer-field:nth-child(2n),
    .report-stat-grid .customer-field:nth-child(3n) {
        border-right: none;
    }

    .structured-form-grid-2,
    .structured-form-grid-3 {
        grid-template-columns: 1fr;
    }

    .structured-form-body,
    .structured-actions {
        padding: 16px;
    }

    .structured-actions {
        flex-direction: column;
    }

    .structured-actions .btn {
        width: 100%;
    }

    .customer-detail-page .detail-list > div {
        grid-template-columns: 1fr;
    }

    .animal-action-row,
    .detail-grid,
    .detail-note-list {
        grid-template-columns: 1fr;
    }

    .animal-action {
        justify-content: flex-start;
    }

    .detail-list > div {
        grid-template-columns: 1fr;
    }

    .detail-list dt {
        border-right: none;
        padding-bottom: 6px;
    }

    .detail-list dd {
        padding-top: 6px;
    }
}

@media (max-width: 420px) {
    .logo {
        gap: 8px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 15px;
    }

    .header .btn-sm {
        min-height: 34px;
        padding: 7px 10px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .header,
    .sidebar,
    .mobile-nav,
    .footer,
    .btn,
    .form-actions,
    .no-print,
    .fab {
        display: none !important;
    }

    body {
        padding: 0;
        background: white;
    }

    .content,
    .main,
    .main-content {
        padding: 0;
    }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }

    .page {
        max-width: none;
        padding: 0;
    }
}
