/* ========================================
   パシャマネ - ダッシュボード用スタイル
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 30px;
}

/* ========================================
   デバイスモックアップ
   ======================================== */

.device-mockup {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    width: 100%;
}

.device-frame {
    background: #1a1a1a;
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    width: 390px;
    height: 844px;
    position: relative;
    flex-shrink: 0;
}

.device-frame::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 30px;
    background: #1a1a1a;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    color: #fff;
    font-size: 14px;
}

.status-icons {
    display: flex;
    gap: 6px;
}

.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px 20px;
    border-radius: 0 0 20px 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.app-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: white;
    padding: 2px;
}

.app-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    opacity: 0.95;
}

.selector-container {
    display: flex;
    gap: 8px;
}

.store-selector {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 10px;
    flex: 1;
}

.month-selector {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 10px;
    flex: 1;
}

.store-selector i.fa-store,
.month-selector i.fa-calendar-alt {
    font-size: 13px;
    opacity: 0.9;
}

.store-dropdown,
.month-dropdown {
    background: transparent;
    border: none;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    padding: 0 18px 0 2px;
    outline: none;
}

.store-dropdown option,
.month-dropdown option {
    background: #667eea;
    color: white;
}

.store-selector i.fa-chevron-down,
.month-selector i.fa-chevron-down {
    font-size: 9px;
    pointer-events: none;
    position: absolute;
    right: 8px;
}

/* ========================================
   コンテンツエリア
   ======================================== */

.device-content {
    background: #f5f5f7;
    height: 650px;
    overflow-y: auto;
    padding: 20px;
    border-radius: 28px;
}

.device-content::-webkit-scrollbar {
    width: 6px;
}

.device-content::-webkit-scrollbar-track {
    background: transparent;
}

.device-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ========================================
   当月売上バナー
   ======================================== */

.sales-header {
    margin-bottom: 16px;
}

.sales-banner {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(52, 199, 89, 0.3);
}

.sales-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sales-label {
    font-size: 14px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.sales-sublabel {
    font-size: 11px;
    font-weight: 500;
    color: white;
    opacity: 0.9;
}

.sales-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.sales-amount {
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.sales-period {
    font-size: 11px;
    font-weight: 500;
    color: white;
    opacity: 0.9;
}

/* ========================================
   仕入・原価率カード
   ======================================== */

.cost-rate-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.cost-rate-card {
    background: white;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cost-rate-card.unified {
    border-left: 4px solid #667eea;
}

.cost-rate-card.food {
    border-left: 4px solid #ff9500;
}

.cost-rate-card.material {
    border-left: 4px solid #007aff;
}

.cost-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.cost-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cost-category {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.cost-period {
    font-size: 11px;
    color: #666;
}

.cost-value {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
}

.rate-grid {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rate-item {
    flex: 1;
    text-align: center;
}

.rate-label {
    display: block;
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.rate-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.rate-divider {
    width: 1px;
    height: 35px;
    background: #e5e5e5;
}

/* ========================================
   当月累計仕入額
   ======================================== */

.total-summary {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.total-row:last-of-type {
    border-bottom: none;
    margin-bottom: 10px;
}

.total-row.main {
    padding-top: 0;
}

.total-row.highlight {
    padding-top: 12px;
    margin-top: 4px;
    border-top: 2px solid #e5e5e5;
}

.total-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.total-row.main .total-label {
    font-size: 15px;
    font-weight: 700;
}

.total-row.highlight .total-label {
    font-size: 15px;
    font-weight: 700;
}

.total-value {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
}

.total-row.main .total-value {
    font-size: 20px;
    color: #667eea;
}

.total-row.highlight .total-value {
    font-size: 20px;
}

.total-value.positive {
    color: #34c759;
}

.total-value.negative {
    color: #ff3b30;
}

.update-time {
    font-size: 11px;
    color: #999;
    text-align: right;
    padding-top: 4px;
}

/* ========================================
   売上・仕入カード（横並び） - 削除予定
   ======================================== */

.sales-cost-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.sales-cost-card {
    background: white;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.sales-cost-card.sales {
    border-left: 4px solid #34c759;
}

.sales-cost-card.cost {
    border-left: 4px solid #ff9500;
}

.sales-cost-card .card-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.sales-cost-card .card-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.3;
}

.sales-cost-card .card-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.sales-cost-card .card-detail {
    font-size: 10px;
    color: #999;
}

/* ========================================
   F率カード（横並び）
   ======================================== */

.f-rate-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.f-rate-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.f-rate-card.current {
    border: 2px solid #667eea;
}

.f-rate-card.average {
    border: 2px solid #999;
}

.card-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.card-value .unit {
    font-size: 18px;
    margin-left: 2px;
}

.f-rate-card.current .card-value {
    color: #667eea;
}

.card-comparison {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.card-comparison.up {
    color: #ff3b30;
}

.card-comparison.stable {
    color: #34c759;
}

.card-comparison i {
    margin-right: 2px;
}

.card-calculation {
    font-size: 10px;
    color: #999;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

.card-period {
    font-size: 11px;
    color: #999;
}

/* ========================================
   本日の仕入状況
   ======================================== */

.today-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 24px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.today-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.today-title {
    font-size: 16px;
    font-weight: 700;
}

.today-total {
    font-size: 13px;
    opacity: 0.95;
}

.today-total strong {
    font-size: 16px;
    font-weight: 700;
}

.today-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.today-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 10px 12px;
    border-radius: 8px;
}

.today-vendor {
    font-size: 14px;
    font-weight: 600;
}

.today-amount {
    font-size: 15px;
    font-weight: 700;
}

.today-note {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.today-note i {
    margin-top: 2px;
    opacity: 0.8;
}

.today-note strong {
    font-weight: 700;
    text-decoration: underline;
}

/* ========================================
   セクション見出し
   ======================================== */

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

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ========================================
   業者別予算消化リスト
   ======================================== */

.vendor-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.vendor-item {
    background: white;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #34c759;
}

.vendor-item.alert-warning {
    border-left-color: #ff9500;
    background: #fff9f0;
}

.vendor-item.alert-danger {
    border-left-color: #ff3b30;
    background: #fff5f5;
}

.vendor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.vendor-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vendor-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.alert-badge.warning {
    background: #ff9500;
    color: white;
}

.alert-badge.danger {
    background: #ff3b30;
    color: white;
}

.vendor-amount {
    text-align: right;
}

.amount {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.amount.warning {
    color: #ff9500;
}

.amount.over {
    color: #ff3b30;
}

.budget {
    font-size: 12px;
    color: #999;
    margin-left: 2px;
}

/* プログレスバー */
.progress-bar-container {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e5e5e5;
    border-radius: 4px;
    overflow: visible;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar.safe {
    background: linear-gradient(90deg, #34c759 0%, #30d158 100%);
}

.progress-bar.warning {
    background: linear-gradient(90deg, #ff9500 0%, #ff9f0a 100%);
}

.progress-bar.danger {
    background: linear-gradient(90deg, #ff3b30 0%, #ff453a 100%);
    border-radius: 4px 0 0 4px;
}

.progress-overflow {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #ff3b30,
        #ff3b30 5px,
        #ff6b60 5px,
        #ff6b60 10px
    );
    border-radius: 0 4px 4px 0;
    animation: slide 1s linear infinite;
}

@keyframes slide {
    0% { background-position: 0 0; }
    100% { background-position: 14px 0; }
}

.vendor-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-text {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.remain-amount {
    font-size: 12px;
    color: #34c759;
    font-weight: 600;
}

.over-amount {
    font-size: 12px;
    color: #ff3b30;
    font-weight: 700;
}

/* ========================================
   合計サマリー
   ======================================== */

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    padding-top: 14px;
    margin-top: 6px;
    border-top: 2px solid #e5e5e5;
}

.summary-label {
    font-size: 14px;
    color: #666;
}

.summary-value {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.summary-row.total .summary-label {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.summary-row.total .summary-value {
    font-size: 20px;
}

.summary-value.success {
    color: #34c759;
}

/* ========================================
   ボトムナビゲーション
   ======================================== */

.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 20px;
    border-radius: 0 0 28px 28px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.3s;
    text-decoration: none;
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: #667eea;
}

.nav-item.camera {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    position: relative;
    top: -20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nav-item.camera i {
    font-size: 24px;
}

/* ========================================
   説明パネル
   ======================================== */

.info-panel {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    flex-shrink: 0;
}

.info-panel h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 22px;
}

.info-panel ul {
    list-style: none;
}

.info-panel > ul > li {
    margin-bottom: 16px;
    line-height: 1.7;
    color: #333;
}

.info-panel ul ul {
    margin-top: 8px;
    margin-left: 20px;
}

.info-panel ul ul li {
    margin-bottom: 6px;
    font-size: 14px;
}

.info-panel strong {
    color: #667eea;
}

/* ========================================
   レスポンシブ対応
   ======================================== */

@media (max-width: 1200px) {
    body {
        flex-direction: column;
    }

    .device-mockup {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 500px) {
    body {
        padding: 10px;
    }

    .device-frame {
        width: 100%;
        max-width: 390px;
        height: auto;
        max-height: 90vh;
    }

    .device-content {
        height: auto;
        max-height: calc(90vh - 220px);
    }

    .info-panel {
        width: 100%;
        max-width: 390px;
    }
}