:root {
    --primary: #8f6e28; 
    --primary-hover: #73571d;
    --dark-bg: #111215;
    --darker-bg: #08080a;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: #cda873;
    --text-main: #1f2937;
    --text-muted: #57534e;
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    
    /* 古いiPad対策：長押しによるテキスト選択やコピペメニュー(Callout)を完全に無効化 */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

/* もし今後テキスト入力欄(input)を使う場合は、そこだけ選択・入力を許可する */
input[type="text"], input[type="number"], input[type="email"], input[type="password"], textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at top right, #24221c, #0a0a0c);
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}
.shape-1 { top: -10%; left: -10%; width: 55vw; height: 55vw; background: rgba(255, 255, 255, 0.12); }
.shape-2 { bottom: -10%; right: -10%; width: 45vw; height: 45vw; background: rgba(212, 175, 55, 0.22); }

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

.digital-paper {
    background: linear-gradient(145deg, #f7f3ea 0%, #ebe3d3 50%, #dfd5c0 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid #cda873;
    border-radius: 16px;
    padding: 40px 30px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(205, 168, 115, 0.35);
    margin-bottom: 50px;
}

.logo { text-align: center; margin-bottom: 2rem; }
.logo h1 { font-weight: 500; letter-spacing: 4px; color: var(--primary); font-size: 1.8rem; }
.logo p { color: var(--text-muted); font-size: 0.9rem; letter-spacing: 2px; }

.instruction { text-align: center; margin-bottom: 2rem; color: var(--primary); font-size: 1.1rem; pointer-events: none; -webkit-user-select: none; user-select: none; }

/* Canvas Box */
.canvas-box {
    margin-bottom: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px;
    border: 1.5px solid #cda873;
    box-shadow: 0 4px 15px rgba(143, 110, 40, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

.canvas-title {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #dcd3be;
    border-radius: 8px;
    overflow: hidden;
}

.drawing-canvas {
    width: 100%;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
    display: block;
    position: relative;
    z-index: 2;
    -webkit-touch-callout: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Templates (Under the canvas) */
.canvas-template {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    pointer-events: none;
    font-weight: 500;
}

.date-template {
    gap: 10px;
    font-size: 3rem;
}

.payment-template {
    flex-direction: column;
    justify-content: space-evenly;
}

.payment-methods {
    display: flex;
    gap: 40px;
    font-size: 1.6rem;
}

.amount-field {
    font-size: 2.5rem;
    display: flex;
    align-items: baseline;
}

.amount-field .underline {
    border-bottom: 3px solid #111827;
    min-width: 250px;
    display: inline-block;
    margin-left: 10px;
}

.btn-clear {
    background: #4b5563;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-clear:hover { background: #374151; }

.btn-undo {
    background: #6366f1;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-undo:hover { background: #4f46e5; }

.scroll-spacer {
    text-align: center;
    padding: 40px 0;
    color: #9ca3af;
    letter-spacing: 2px;
    font-size: 1rem;
    border-top: 1px dashed #d1c4aa;
    margin-top: 40px;
}

.staff-section {
    opacity: 0.95;
}

.save-action {
    margin-top: 40px;
    text-align: center;
    padding: 20px;
    background: #ffffff;
    border: 1.5px solid #cda873;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(143, 110, 40, 0.1);
}

.save-btn-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.tab-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.tab-btn.active {
    background: linear-gradient(135deg, #dfc18d, #cda873);
    color: #1a160d;
    border-color: #dfc18d;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}
.tab-btn.drag-over {
    transform: scale(1.05);
    background: rgba(212, 175, 55, 0.3);
    border: 2px dashed var(--primary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.btn-primary {
    width: 100%;
    max-width: 400px;
    padding: 1.2rem;
    background: linear-gradient(135deg, #dfc18d 0%, #cda873 50%, #b8935c 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(205, 168, 115, 0.4);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #e6c898 0%, #d8b481 50%, #c49f69 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(205, 168, 115, 0.5);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.login-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    background: linear-gradient(145deg, #ffffff 0%, #fbf9f4 50%, #f4eee1 100%);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 40px rgba(212, 175, 55, 0.4);
    color: #1f2937;
}

.secret-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    opacity: 0;
    cursor: default;
    z-index: 100;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: bold;
    z-index: 1000;
    transition: opacity 0.3s;
}
.hidden { display: none !important; opacity: 0; pointer-events: none; }

/* Dashboard Styles */
.dashboard-header { background: rgba(255, 255, 255, 0.05); padding: 1rem 2rem; border-bottom: 1px solid var(--glass-border); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.btn-outline { padding: 0.8rem 1.5rem; background: transparent; color: var(--primary); border: 1px solid var(--primary); border-radius: 8px; text-decoration: none;}

.date-select {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}
.date-select:focus { border-color: var(--primary); }

.dashboard-main { padding: 2rem; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: #ffffff;
    border: 2px solid #cda873;
    border-radius: 14px;
    padding: 22px;
    cursor: grab;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 0 15px rgba(205, 168, 115, 0.25);
    color: #1f2937;
}
.card:active {
    cursor: grabbing;
}
.card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: bold;
    border-bottom: 1.5px solid #e8dec8;
    padding-bottom: 12px;
}
.card-img-label {
    font-size: 0.88rem;
    color: #6b5c3b;
    font-weight: 600;
    margin-top: 14px;
    margin-bottom: 6px;
}
.card img {
    width: 100%;
    background: white;
    border-radius: 6px;
    border: 1px solid #ccc;
    display: block;
}