/* ログインページ */
body.login-page {
    background-color: #eeeeee;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    max-width: 450px;
    width: 100%;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.login-form .form-control:focus {
    border-color: #f59900;
    box-shadow: 0 0 0 0.2rem rgba(245, 153, 0, 0.25);
}

:root {
    --header-height: 64px;
    --sidebar-width: 260px;
    --color-background: #f2f5fa;
    --color-surface: #ffffff;
    --color-surface-muted: #f7f9fc;
    --color-border: #d6dfeb;
    --color-text: #2a3b4d;
    --color-muted: #748399;
    --color-primary: #ffbe4d;
    --color-primary-dark: #f59900;
    --color-accent-soft: #fff1dc;
}

/* フォームのエラーメッセージは明確な赤で表示 */
.error-message {
    color: #dc3545;
    font-weight: 600;
}

/* フォームレイアウト */
.main-card .form {
    width: 100%;
}

.main-card .form fieldset {
    border: 0;
    margin: 0;
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.main-card .form fieldset legend {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

.main-card .form-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.75rem;
}

.main-card .form-note {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-muted);
    margin: 0 0 1rem;
}

.main-card .form fieldset .input {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
}

.main-card .form fieldset > label.control-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--color-text);
}

.main-card .form fieldset input:not([type="checkbox"]):not([type="radio"]),
.main-card .form fieldset select,
.main-card .form fieldset textarea {
    width: 100%;
    max-width: 640px;
}

.main-card .form fieldset .form-group {
    margin: 0;
}

/* 共通スタイル */
body {
    background-color: var(--color-background);
    color: var(--color-text);
    min-height: 100vh;
    font-size: 0.875rem;
}

.top-navbar {
    background-color: var(--color-primary-dark);
    min-height: var(--header-height);
}

.top-navbar .navbar-brand {
    color: #ffffff;
}

.top-navbar .navbar-brand:hover,
.top-navbar .navbar-brand:focus {
    color: #ffffff;
}

.top-navbar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.top-navbar .btn-outline-light:hover,
.top-navbar .btn-outline-light:focus {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
}

.top-navbar .dropdown-menu {
    border-radius: 0.75rem;
    border: 1px solid rgba(185, 98, 0, 0.15);
    box-shadow: 0 18px 35px rgba(185, 98, 0, 0.2);
    background: #ffffff;
}

.top-navbar .dropdown-item {
    color: var(--color-text);
}

.top-navbar .dropdown-item:hover,
.top-navbar .dropdown-item:focus {
    background-color: rgba(245, 153, 0, 0.15);
    color: var(--color-primary-dark);
}

.navbar-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.4rem;
    color: var(--color-text);
}

.navbar-brand-sub {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.55);
}

.table-responsive {
    overflow-x: auto;
}

.table-responsive.overflow-hidden {
    overflow-x: auto !important;
    overflow-y: hidden;
}

.table-responsive table {
    width: 100%;
    min-width: min(1024px, 100%);
}

.table-responsive .actions {
    white-space: nowrap;
}

.table-xs {
    font-size: 0.75rem;
}

.table-text-ellipsis {
    display: inline-block;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.sidebar-backdrop {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 10, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.layout-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - var(--header-height));
    transition: grid-template-columns 0.3s ease;
}

body.sidebar-collapsed .layout-wrapper {
    grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
    background-color: #eeeeee;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - var(--header-height));
    position: relative;
    box-sizing: border-box;
}

.sidebar-inner {
    padding: 1.25rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #333333;
    font-weight: 500;
    padding: 0.52rem 0.85rem;
    border-radius: 0.85rem;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    color: #555555;
}

.sidebar .nav-link span {
    flex: 1;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    color: #111111;
    background-color: #dddddd;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.sidebar .nav-link.active {
    color: #111111;
    background-color: #d1d1d1;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.sidebar .nav-link.active i {
    color: #111111;
}

.content-area {
    background: transparent;
    display: flex;
}

.main-content {
    flex: 1;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.main-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.main-card {
    background: var(--color-surface);
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    box-shadow: 0 18px 40px rgba(185, 98, 0, 0.15);
}

.main-card h1,
.main-card h2,
.main-card h3 {
    font-weight: 600;
    color: var(--color-text);
}

.main-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    line-height: 1.5;
}

.main-card thead {
    background-color: var(--color-primary);
}

.main-card th,
.main-card td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.main-card .table-break-cell,
.main-card .table-break-cell a {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.main-card th {
    color: #ffffff;
    font-weight: 600;
}

.main-card thead a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 600;
}

.main-card thead a:hover,
.main-card thead a:focus {
    color: #fff7e0;
    text-decoration: underline;
}

.main-card th.actions {
    color: #ffffff;
}

.main-card td {
    color: var(--color-text);
    font-weight: 500;
}

.main-card tbody tr:hover {
    background-color: rgba(245, 153, 0, 0.12);
}

.main-card .actions a {
    margin-right: 0.75rem;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.main-card tbody a,
.main-card tfoot a {
    color: var(--color-primary-dark);
}

.main-card .actions a:last-child {
    margin-right: 0;
}

.main-card .actions a:hover {
    text-decoration: underline;
    color: #bf6a00;
}

.main-inner .button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: var(--color-primary-dark);
    color: #ffffff !important;
    border-radius: 0.75rem;
    padding: 0.55rem 1.15rem;
    font-weight: 600;
    border: none;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.main-inner .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(185, 98, 0, 0.35);
}

.main-inner .button.float-right {
    margin-left: auto;
    float: none;
}

.main-inner .paginator {
    color: var(--color-muted);
    margin-top: 1.25rem;
}

.main-inner .paginator .pagination {
    gap: 0.35rem;
}

.main-inner .paginator .pagination > li > a,
.main-inner .paginator .pagination > li > span {
    border-radius: 0.6rem;
    border: 1px solid var(--color-border);
    padding: 0.4rem 0.75rem;
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.main-inner .paginator .pagination > li.active > a,
.main-inner .paginator .pagination > li.active > span {
    background: var(--color-primary);
    border-color: rgba(199, 118, 0, 0.65);
    color: #ffffff;
}

.main-inner .message {
    border-radius: 0.85rem;
    padding: 0.75rem 1.1rem;
    border: 1px solid rgba(245, 153, 0, 0.25);
    background: rgba(245, 153, 0, 0.12);
    color: var(--color-primary-dark);
}

.main-inner .message.error {
    border-color: rgba(220, 38, 38, 0.25);
    background: rgba(248, 113, 113, 0.12);
    color: #b91c1c;
}

.admins.index.content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admins.index.content h3 {
    margin-bottom: 0;
    font-size: 1.4rem;
    color: var(--color-text);
}

.admins.index.content .table-responsive {
    border: 1px solid var(--color-border);
    border-radius: 0.9rem;
    overflow: hidden;
}

.admins.index.content table {
    margin: 0;
}

@media (max-width: 991.98px) {
    body.sidebar-collapsed .layout-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .layout-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: min(80%, 280px);
        height: calc(100vh - var(--header-height));
        transform: translateX(-105%);
        transition: transform 0.3s ease, opacity 0.3s ease;
        visibility: hidden;
        pointer-events: none;
        z-index: 1080;
    }

    .sidebar-inner {
        gap: 1rem;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        opacity: 1;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .main-content {
        padding: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .main-card {
        border-radius: 0.85rem;
    }

    .main-card th,
    .main-card td {
        padding: 0.65rem;
    }
}
