/**
 * eduSign 共用樣式
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft JhengHei", sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
}

/* ===== 導覽列 ===== */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    color: white;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.navbar-user-name {
    font-size: 14px;
}

.navbar-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.navbar-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-narrow {
    max-width: 800px;
}

/* ===== 卡片 ===== */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* ===== 按鈕 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #34a853;
    color: white;
}

.btn-success:hover {
    background: #2d9249;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-outline {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f9fafb;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 表格 ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.table tr:hover {
    background: #f9fafb;
}

.table-responsive {
    overflow-x: auto;
}

/* ===== 表單 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* ===== 訊息提示 ===== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* ===== 狀態標籤 ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-draft {
    background: #e5e7eb;
    color: #4b5563;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-closed {
    background: #fee2e2;
    color: #dc2626;
}

.status-signed {
    background: #dbeafe;
    color: #1e40af;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

/* ===== 簽名板 ===== */
.signature-container {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 20px;
    background: #fafafa;
    margin-bottom: 20px;
}

.signature-canvas {
    width: 100%;
    height: 200px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
}

.signature-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* ===== 文件列表 ===== */
.document-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.document-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.2s;
}

.document-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.document-info {
    flex: 1;
}

.document-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.document-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.document-deadline {
    color: #dc2626;
}

.document-actions {
    display: flex;
    gap: 10px;
}

/* ===== 空狀態 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
}

/* ===== 統計卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

/* ===== 頁籤 ===== */
.tabs {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 10px 20px;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.tab:hover {
    color: #374151;
}

.tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ===== 分頁 ===== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
}

.pagination a {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

.pagination a:hover {
    background: #f9fafb;
}

.pagination span.current {
    background: #667eea;
    color: white;
}

/* ===== RWD ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .container {
        padding: 16px;
    }

    .card {
        padding: 16px;
    }

    .document-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .document-actions {
        width: 100%;
    }

    .document-actions .btn {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}
